laravel-roles/database/migrations
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
..
2025_01_01_000001_create_blax_role_tables.php fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
2025_01_01_000002_create_blax_access_table.php fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
2026_04_26_000001_add_source_to_accesses_table.php fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
2026_04_27_000001_create_required_accesses_table.php fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
2026_04_29_000001_fix_required_accesses_uuid_columns.php fix: align schema with HasUuids design + add reusable MorphAliasRegistry 2026-04-29 11:48:51 +02:00
2026_04_29_000002_fix_role_tables_to_uuid.php fix(uuid-migration): non-destructive snapshot + verify, plus cleanup command 2026-04-29 13:49:52 +02:00