[Rails] Active Record Migration (Database Migration)
參考資料:Active Record Migrations @ RailsGuides
# CLI
# 會去執行 ./lib/tasks/dev.rake,需先設定
$ bin/rails dev:build
# 把資料庫砍掉重建
$ bin/rails db:drop db:create db:migrate db:seed
# ./db/migrate/20170919064947_add_need_eticket_to_activities.rb
def change
# add_column :table_name, :column_name, :type, :options
add_column :activities, :need_eticket, :boolean, {comment: '是否使用電子票券', default: false}
end