-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make migration id bigserial #641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm cool with this change, but one thing I'm wondering is what happens for existing apps that try to run a migration? Crystal-db will try to pull out the serial
field, and cast to Int64
, right? Will the upcast still work, or will that tank? 🤔
Or we say this is a breaking change, and then write up a little migration that updates the existing column....
side note, ignore the ameba failures. Everything has been updating to 0.14 which seems to have some issues. |
It's been a few compiler versions, but I don't think upcasting works. If it expects an Int64 and gets an Int32, it doesn't work. That makes this a breaking change, but I think it's still 🆗. |
I'd rather not have a breaking change here. We can create an alias |
I've never used Cockroachdb, but I'm under the impression the error is more on the db side where it's defined as |
This is a cockroachdb issue and one that I have brought up with there team. Here is an old issue linked here. Migrating existing application is a concern for sure. I think the idea of an alias can solve the problem of older applications. I think a concern like this eventually migrate to avram so different database adapters could handle this. |
Ah, so if we had the alias, and old apps used |
Just tested this by:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @wontruefree 🎉
Cockrochdb uses a bigserial and this breaks with using the migrator. This is compatible with both postgresql and cockroachdb.