rake db:migrate updates create_table block

Viewed 21

I am resolving a conflict on schema.rb by running rake db:migrate

The migration changing the definition

create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t| end

To

create_table "data_migrations", force: :cascade do |t|
  t.string "version", null: false
end

Are those 2 equivalent? Where does this change comes from?

1 Answers

Yes the above two definitions are same and they pertain to "schema_migrations" which version control and store the migration version history. They only have one column "version" which is string type and primary key for the table. They might have been modified when rake tasks related to schema load are run.

Related