-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Preserve check constraint during column move #19105
Preserve check constraint during column move #19105
Conversation
85ef802
to
db4f2d8
Compare
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.
This looks promissing
db4f2d8
to
d3453ed
Compare
Here is the version when merging QA_5_2 -> master |
d3453ed
to
52a6142
Compare
if (! is_array($moveColumns) || ! array_is_list($moveColumns) || ! $this->response->isAjax()) { | ||
$this->response->setRequestStatus(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.
I added the check for array_is_list here and also added the missing setRequestStatus.
Remove array_is_list here again as it is php >= 8.1.
// Ensure the columns from client match the columns from the table | ||
if ( | ||
count($columnNames) !== count($moveColumns) || | ||
array_diff($columnNames, $moveColumns) !== [] | ||
) { | ||
return null; | ||
} |
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.
This is an added sanity check that the columns of the request match the columns from the CREATE TABLE statement.
if ($changes === []) { | ||
return null; | ||
} |
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.
If no changes detected now doesn't return incomplete statement without any column changes.
Calls to this controller were already prevented when pressing ok, but not on preview.
const serialized = $form.serialize(); | ||
if (serialized === $form.data('serialized-unmoved')) { | ||
modalBody.innerHTML = ''; | ||
return; | ||
} |
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.
Don't make a request when nothing was changed. The controller now would return an error in this case. Before, an invalid alter table statement was returned without any column changes.
4308471
to
76ccc3b
Compare
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
76ccc3b
to
3b992e6
Compare
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.
Thank you !
Description
Fixes #17920, fixes #18006, fixes #18962
Closes #19009
See #13592, #14371, #16224