correct & update example to add/drop constraint #21542
Open
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.
DOC-14789
Update the
ALTER TABLEexample to drop & add constraint atomically. For the following reasons, this example did not work (and may have never worked):primary, nottablename_pkeyas per convention).users) is referenced by several FKs in the MovR dataset, so the txn actually rolls back.autocommit_before_ddlwas introduced, which causes the txn to commit before issuing the DDL, which causes the statements to fail.create_table_with_schema_lockedwas enabled by default, and the MovR tables were adjusted accordingly. This means the tables disallow schema changes unless theschema_lockedstorage param is disabled on the table.The examples are updated (appropriately for each version) to use a different MovR table (
promo_codes), use the correct PK name, disableautocommit_before_ddl, and disable/re-enableschema_lockedto allow the example to work.