-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Erase fails when functions depend on each other #203
Comments
I forgot to mention - this doesn't seem to happen consistently. Maybe the ordering of dropping functions isn't deterministic? |
Thanks for the feedback, I'm going to check what can be done |
Just release Evolve 3.0.0-alpha2 that should fix your issue. Waiting for your feedback. |
Thanks for this! I'll try with that version and get back to you. It might take a while as the issue is intermittent. |
Since I'm using Evolve.Tool, is there a way for me to try this version on the command line? Or would you need to release a new version of the tool also? |
So I'm gonna release a version of Evolve.Tool too. It should be available in the hour. Note that in the version 3.0.0, Evolve.Tool needs either netcoreapp3.1 or net5.0 on your machine. (netcoreapp2.2 support is over) |
Unfortunately I'm getting a different error now. I think it's happening because a table with a computed column depends on that function, and functions are now being dropped before tables.
|
Ok then. Again, thank you for your feedback. Your description of the issue is really clear. |
@johnwright Evolve-Tool 3.0.0-alpha3 released Happy testing ;) |
Thanks for the update! I'm still seeing an error, but it doesn't look like it's related to function dependencies this time. It's just a regular foreign key dependency between tables. Several tables have a foreign key referencing
Is it possible that the |
Ok your database schema is challenging. Let me check the logic one more time. If you could send me your database scripts on my personnal mail it would be perfect. But I understand if there is sensitive data you cannot share of course. |
What's strange, is that I drop FK constraints first : SELECT TABLE_NAME, CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE IN ('FOREIGN KEY','CHECK') AND TABLE_SCHEMA = 'dbo'; |
Yes, it returns a lot of rows - it looks like the drop didn't work properly. I've emailed the schema to evolve-db@hotmail.com, I hope that makes it clearer what's going on here. |
Thank you @johnwright The good news is I can reproduce the issue now. The bad news is that is not trivial. Your database objects rely a lot on each other. Like I said, it's challenging. I need time for that kind of issue. I will work on it this week-end. I hope I will release an alpha4 by monday. I'll keep you in touch |
Thanks for your help, I really appreciate it. I had a look at the equivalent code in Flyway, and they are using a similar approach - I'll try testing with Flyway to see if their code works for this schema. |
I've tried with Flyway, and it also isn't able to clean the schema. It fails because a check constraint is dependent on a computed column! |
Ok, thanks. It is nice to know. Nevertheless, I'll try to find a solution as I told you. |
@johnwright Evolve-Tool 3.0.0-alpha4 released The issue is now fixed on my computer ;) Happy testing again |
This is now working - thanks very much! I owe you a coffee if you're ever in London. |
I've got family there, who knows :) ? |
Absolutely, especially since we will be using Evolve for the duration of this client project and most likely for others too! |
Thank you, appreciated it. I would be happy to put the logo of your company on the Evolve's homepage and/or documentation if you want. And tell me if the git history is alright for you now, I'm not a git wizard |
Git history looks good, thanks very much. Sponsorship should be set up now! |
Yes it is ! Thank you very much. Highly appreciated. Feel free to send me feedback or contact me for anything related to Evolve |
Sample output:
Evolve Tool version: 2.4.0
SQL Server version: Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Home 10.0 (Build 15063: )
N.B. both functions are defined
WITH SCHEMABINDING
.The text was updated successfully, but these errors were encountered: