If you have the following
def migrate
create table_for(Comment) do
primary_key id : UUID
add_timestamps
add_belongs_to user : User, on_delete: :cascade
end
end
Then you run lucky db.migrate, you may run in to an error that mentions something like:
foreign key constraint "comment_user_id_fkey" cannot be implemented (Exception)
This is because the user id might be UUID, but you forgot to add the foreign_key_type: UUID to your add_belongs_to.
If we have a way to catch this error, we should.