If you have recently migrated your rails application and tried the rails db:setup or rails db:schema:load commands, you might have noticed an error like this:
Column aaa_id
on table bbb
does not match column id
on aaaa
, which has type bigint(20)
. To resolve this issue, change the type of the aaa_id
column on bbb
to be :bigint. (For example t.bigint :aaa_id
).
I will recommend the use of bigint if you are creating a new rails application, in the case of existing application, please add the following code into application.rb file to avoid this issue.
In the Schema.rb file, make sure that you mention id: :integer in create table block
Before
After
Great content! Super high-quality! Keep it up! 🙂
Wow because this is great job! Congrats and keep it up.
asdfasdf