-
Notifications
You must be signed in to change notification settings - Fork 67
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
yamltodb fails when datatype of view column changes #206
Comments
Prior to the change, yamltodb was generating a |
I can see how DROP VIEW CASCADE could work, but it would require the CREATE VIEW statements to be in the correct order. I found this recursive query on SO for determining the dependency order on any given view or table:
Since that would be more involved, I think changing the raise to a comment as you suggested, and keeping the DROP VIEW and CREATE VIEW statements in the output to be manually reordered would be the second best option. |
FYI, we don't need a special query thanks to @dvarrazzo implementation of "dependency tracking" (in essence a topological sort of almost all the db objects). However, the "tracking" did not include table columns, because they're like different animals, so to speak. It was also implemented before I added capturing of the view columns and datatypes (mainly because they could be used to fix #90!). I'm not sure what would happen if we issued a DROP VIEW at the point where we find a view dependent on another that also has a column or datatype change (although it may not be too difficult to come up with a simple test case). |
I have a SQL view where the datatype of a column has changed, and yamltodb fails with:
Looks like it is related to this closed issue and commit:
#90
12d1192
If it's not possible for yamltodb to handle those, is there a way to bypass the error so I can get the result to modify manually? It looks like prior to this commit it was generating an output which just needed some minor changes.
The text was updated successfully, but these errors were encountered: