rails new connector_api --api --database=postgresqlhtml
bundle installsql
rake db:createapi
rails g scaffold issues jira_key:string project_name:string backend:string summary:string description:text trello_card_id:stringruby
rake db:migrateruby-on-rails
------------------------------------------------------------------------------------------------------------------------post
roll back:url
rake db:rollbackspa
rails d scaffold cardspostgresql
------------------------------------------------------------------------------------------------------------------------code
Postgresql
brew services start postgresql
------------------------------------------------------------------------------------------------------------------------
generate a model
bin/rails generate model checklist trello_issue_id:string toggleUser:string toggleDate:timestamp
------------------------------------------------------------------------------------------------------------------------
綁定localhost -- 搭配ngrok
rails s -b localhost
------------------------------------------------------------------------------------------------------------------------
生產環境
rails server -e production
------------------------------------------------------------------------------------------------------------------------
rename_table
rails g migration ChangeColumnInjlists
rename_table :old_table_name, :new_table_name
------------------------------------------------------------------------------------------------------------------------
rails destroy model labels
------------------------------------------------------------------------------------------------------------------------
Create a controller
bin/rails generate controller Git
------------------------------------------------------------------------------------------------------------------------
url: https://stackoverflow.com/questions/1992019/how-can-i-rename-a-database-column-in-a-ruby-on-rails-migration
Delete attribute form model in Ruby on Rail
rails g migration migrationname
remove_column :users, :age
Rails 5: rename table migration
rails g migration change_[old_table_name]_to_[new_table_name]
def change
rename_table :[old_table_name], :[new_table_name]
rename_column :table_name, :old_column, :new_column
end
Rails: add index
add_index :table_name, :column_name, unique: true
Rails: add column table migration
add_column :posts, views, :integer
從staging上pull數據bundle exec cap staging db:pullopen coverage/index.html