Go to file
Fabian @ Blax Software 7e19d4ffbe fix(uuid-migration): non-destructive snapshot + verify, plus cleanup command
The bigint→UUID conversion already preserved data via in-place column
swaps, but operators reasonably wanted stronger guarantees. Added:

- Pre-conversion snapshot per affected table:
  CREATE TABLE <name>_bak_bigint_uuid_2026_04_29 LIKE <name>;
  INSERT INTO <name>_bak_bigint_uuid_2026_04_29 SELECT * FROM <name>;
  Idempotent — a retry after a crash never overwrites the original
  snapshot. Snapshots are intentionally not auto-dropped.
- Post-conversion verification:
  - row count must match the snapshot exactly per table; mismatch
    throws and instructs recovery from the bak table
  - FK integrity check: zero orphans in permission_members.permission_id
    / permission_usages.permission_id / role_members.role_id /
    roles.parent_id (allowing NULL on the self-FK)
- Early-return if every affected table is already UUID, so reruns
  on hosts that already migrated don't even create snapshots.

Plus roles:drop-uuid-migration-backup-tables to clean up the
snapshots once the operator is confident — with --dry-run and
explicit confirmation. Verified end-to-end on a disposable bigint
fixture: 3 rows preserved, 0 orphans, snapshot intact, schema
correctly converted to char(36).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:49:52 +02:00
.vscode A traits, I fields 2025-06-16 09:49:36 +02:00
config feat: add HasRequiredAccess trait for OR-combined entity dependencies 2026-04-27 12:35:09 +02:00
database/migrations fix(uuid-migration): non-destructive snapshot + verify, plus cleanup command 2026-04-29 13:49:52 +02:00
src fix(uuid-migration): non-destructive snapshot + verify, plus cleanup command 2026-04-29 13:49:52 +02:00
tests/Unit fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
.dockerignore I has permissions trait 2025-07-10 10:29:53 +02:00
.gitattributes A traits, I fields 2025-06-16 09:49:36 +02:00
.gitignore I context logic & tests 2026-03-31 18:56:47 +02:00
composer.json feat: add Laravel 13 support 2026-04-16 07:49:51 +02:00
phpunit.xml A ccess 2026-02-24 12:07:32 +01:00
pint.json A more files & structure 2025-06-15 11:56:28 +02:00