-
Notifications
You must be signed in to change notification settings - Fork 73
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
Change Column Type when FK #375
Comments
Thanks for opening the issue 🙏 I can reproduce your first problem fairly easily; 'change type' operations are implemented by:
The drop of the old column on complete doesn't work because the column is referenced as part of a FK constraint. I will add this issue to the v1 milestone. I'm unable to reproduce the second problem. Could you please provide the series of migrations before |
Won't pgroll also need to update the type on all the columns references the original? It will work if Postrges is able to cast the types automatically, for example One way we could do this is by looking for a |
I'm trying to change a table's
id
column frominteger
(int4
) tobigint
(int8
), but I'm struggling to complete the migration because other tables referenceid
as a foreign key.I tried following this example: https://github.com/xataio/pgroll/blob/main/docs/README.md#change-type
Here's what I have:
When I try to
complete
the migration, I get this error:I see examples for adding/deleting foreign key constraints, but I don't see any examples of changing the type of a column that is referenced as a foreign key.
Does anyone have examples of this?
The text was updated successfully, but these errors were encountered: