Setting the file. One moment.
Subchapter 63.26
references/mysql-migrations/ddl-operations.mdMarkdown3 KBView on GitHub
Migration patterns for specific MySQL DDL operations to DSQL-compatible equivalents.
MUST read type-mapping.md first for data type mappings and the CRITICAL Destructive Operations Warning. for the general Table Recreation Pattern and user verification requirements.
MUST follow this sequence with user verification at each step:
All migrations end with this pattern (referenced in examples below).
CRITICAL: MUST obtain explicit user confirmation before DROP TABLE step.
-- MUST verify counts match
SELECT COUNT(*) FROM target_table;
SELECT COUNT(*) FROM target_table_new;
-- CHECKPOINT: MUST present count comparison to user and obtain confirmation
-- Agent MUST display: "Original table has X rows, new table has Y rows.
-- Proceeding will DROP the original table. This action is IRREVERSIBLE.
-- Do you want to proceed? (yes/no)"
-- MUST NOT proceed without explicit "yes" confirmation
-- MUST swap tables (DESTRUCTIVE - requires user confirmation above).
-- Each DDL below MUST run in its own transaction (DSQL: one DDL per
-- transaction):
DROP TABLE target_table;
ALTER TABLE target_table_new RENAME TO target_table;
-- MUST recreate indexes (each in its own transaction):
CREATE INDEX ASYNC idx_target_tenant ON target_table(tenant_id);Load the relevant file for the specific MySQL DDL operation you need to migrate: