panels-origin/db/iam/changesets
Cursor Agent a9fbca232d
Fix IAM v2 migrate: split DO block and harden role backfill
The migrate job failed at changeset 005h during Coolify deploy. Liquibase
was splitting the DO $$ block on inner semicolons (splitStatements:true),
which breaks PL/pgSQL. Move the unique-index DO block to 005h2 with
splitStatements:false.

Add 005g2 to create missing operativo roles per tenant, backfill any
remaining role_id values, demote duplicate tenant_admin users to operativo,
and remove orphan users without tenant_id before SET NOT NULL.

Co-authored-by: alberto.martinez <alberto.martinez@mrdev.mx>
2026-09-08 18:57:19 +00:00
..
001-baseline.sql db: migrar infraestructura de BD a Postgres (fase 0-1) 2026-09-02 20:00:49 +00:00
002-rls.sql db: migrar infraestructura de BD a Postgres (fase 0-1) 2026-09-02 20:00:49 +00:00
003-expenses-warehouse-permissions.sql Gastos, almacén y control presupuestal 2026-09-04 04:29:02 +00:00
004-rpc-users-permissions.sql Gastos, almacén y control presupuestal 2026-09-04 04:29:02 +00:00
005-iam-v2-roles-crud.sql Fix IAM v2 migrate: split DO block and harden role backfill 2026-09-08 18:57:19 +00:00