Schema.rb used to be a good place to quickly see what the default values for the columns were and whether they could be nullable, but now it's messy. For example, here is a user table:
create_table "users", force: :cascade do |t|
t.string "name", null: false
t.string "email", null: false
t.string "locale", default: "en-ca", null: false
t.string "password_digest", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
end
And now it looks awful:
create_table "users", id: :serial, force: :cascade do |t|
t.string "name", null: false
t.string "email", null: false
t.string "locale", default: "en-ca", null: false
t.string "password_digest", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true
end
Why did this happen and how can I fix it while maintaining good changes, such id: :serialas implicit ones btree?
source
share