nexent icon indicating copy to clipboard operation
nexent copied to clipboard

fix(database): make bootstrap and suadmin initialization idempotent

Open JasonW404 opened this issue 2 months ago • 0 comments

Problem

Fresh Kubernetes deployment can fail during database initialization because seeded role-permission IDs leave the sequence behind the current maximum, and the unified-tag trigger rejects the empty tenant identifier used by the super-admin mapping.

Expected behavior

Database bootstrap and super-admin initialization are repeatable and compatible with the platform super-admin tenant contract.

Acceptance

  • Permission inserts cannot collide due to a stale sequence after initialization.
  • Re-running migrations remains idempotent.
  • Creating or reconciling the super-admin mapping succeeds without disabling triggers manually.
  • Existing migration files remain immutable; corrective schema work is added through a new migration.

JasonW404 avatar Sep 07 '26 06:09 JasonW404