-
Notifications
You must be signed in to change notification settings - Fork 0
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
Updated DumpSqlCommand to compare against existing database #21
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.
TBH I would prefer some sort of flexibility - being able to both generate dump from the schema file and as a diff.
There's also an issue with Comparator itself - it always shows some changes, even though it shouldn't. For example, on the latest commerce 4.6.x-dev I'm getting the following results when executing the command without file argument: https://gist.github.com/alongosz/e1a3d95a40f819c3c46f7b3781f75622
Moreover when I tried to create custom schema file which defines app_my_table
relation, I got the following result: https://gist.github.com/alongosz/8ddceb3d8cf31f16ad6f0d75d97ad493
Those were the reasons I've never introduced schema diff & easy upgrade when working on this package. It's very unstable.
@alongosz I would never advocate using this tool to perform an "easy upgrade". The main purpose of it is to generate a list of potential SQL commands, just like The reason why it is unstable are differences in metadata provided by database vendors and the fact that we are already behind in DBAL v3 adoption. When checking their implementation in DBAL I've already noticed a few changes. Changed in c08028e to allow both current database comparison and straight up schema generation from scratch. |
@Steveb-p Do you think then that maybe it's worth to add a warning at the beginning of the execution? Something about making database backup and reviewing the script before applying it. I already can imagine people trying to use it, trusting it's a complete feature with correct output. I was a bit reluctant to suggest that because without it you could stream the output directly to dbms sql interpreter
👌
👍 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
v4.6
This PR makes it so that schema comparison is executed against current database.
Checklist:
main
for features, the oldest supported for bugs).$ composer fix-cs
).@ibexa/engineering
).