class CreateFormulas < ActiveRecord::Migration[5.0]
def change
create_table :formulas, comment: 'formula of truth' do |t|
t.string :name, comment: 'name of formula'
t.string :code, comment: 'ident'
t.string :equation, comment: 'equation of formula'
t.timestamps
end
end
end
And after run rails db:migration, here is what I got from db/schema.rb:
create_table "formulas", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='formula of truth'", comment: "formula of truth" do |t|
t.integer "id"
t.string "name"
t.string "code"
t.string "equation"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
It seems not working on
rails-5.0.0.beta1.1
.Here is a migration:
And after run
rails db:migration
, here is what I got fromdb/schema.rb
: