mikebridge commented on PR #39859: URL: https://github.com/apache/superset/pull/39859#issuecomment-4858627837
### Retested up/down on MySQL 8 locally ✅ Since the MySQL-specific paths (the InnoDB FK drop-and-recreate dance and the `_dedupe_by_min_id` phase against a live UNIQUE/composite-PK constraint) never execute on Postgres or SQLite, I re-ran the migration end-to-end on **MySQL 8.0.44** against seeded data. **Setup** — migrated to the parent revision, then seeded the junction tables with `seed_junction_load.py` (3k `dashboard_slices`, 3k `slice_user`, 3k `dashboard_user`, 1k `dashboard_roles`) and **injected duplicate `(fk1, fk2)` pairs** on the three non-UNIQUE tables. Seeding matters here: InnoDB defers/skips constraint validation on empty tables, so an empty-table pass would be a false positive. `report_schedule_user` was left empty on purpose to also cover the empty-UNIQUE-table path. | Phase | Result | |---|---| | **Up — dedup** | Removed exactly 150 / 450 / 450 rows (min-`id` kept) before the composite PK was added — `_dedupe_by_min_id` verified on real rows | | **Up — `dashboard_slices`** | composite PK `(dashboard_id, slice_id)`; `id` dropped; redundant `UNIQUE` dropped; **both FKs preserved** through the InnoDB recreate | | **Up — `report_schedule_user`** (empty) | converted to composite PK, **both FKs preserved** | | **Down** | `id` restored (`AUTO_INCREMENT`) as PK; `UNIQUE` + FKs restored; dedup correctly not reversed | | **Second up/down cycle** | re-ran on the downgrade-drifted schema (renamed `UNIQUE`) — dynamic constraint-name reflection handled it; stable fixed point, no errors | The crash-safety guard added in `74cdde0ab4` (`_assert_fks_present`) ran on both InnoDB-dance tables and passed without a false positive (both retained their FK constraints, including the empty table). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
