Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[11.x] Enhance database migrations #51373
[11.x] Enhance database migrations #51373
Changes from 11 commits
d2f441e
b77e691
1a43f5f
fa6211a
9a38044
f2c6235
35c97a5
6af0984
694edbf
d687bca
44a7e5d
f94495e
09f8845
ba88fec
407a6d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Step 5. When compiling to SQL, we update the state on each command.
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.
Step 2. We have already added
ColumnDefinition
s to list of Blueprint's commands, so there is no need to prepend a command for added / changed columns.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.
Step 3. We walk through the commands and convert
ColumnDefinition
s into eighter an "add" or a "change" command.Then we call
addAlterCommands
method.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.
Step 4. SQLite doesn't support some alter commands, so we need to recreate the table in order to apply changes.
This method walks through the commands and adds "alter commands" whenever needed.
If any alter command has been added, we initiate an "state" for the Blueprint.
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.
it seems that you can remove this line since the var is no longer used down the line.
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.
IDK I prefer to keep it as is.
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 think someone will come up with PR to remove the unused variable at some point. No reason to define it.
I mean line 309
$lastCommandWasAlter = false;
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.
Step 1. When modifying a table, we also add each
ColumnDefinition
to list of Blueprint's commands, to keep the order of commands.