I\'ve created a model Order
with UUID as the primary key.
Now, I\'d like to change it back to a normal incremental integer.
I\'ve tried to run a migration
Does the table have data?
If no, just drop old id column and add new:
remove_column :orders, :id
add_column :orders, :id, :primary_key
If yes, rename id
column to id_deprecated
rename_column :orders, :id, :id_deprecated
add_column :orders, :id, :primary_key
and add your logic to handle references of old_id in other tables.