gate2: fix ix_contacts_tenant_id conflict — drop old index before recreate in 0021

This commit is contained in:
Agent Zero
2026-07-31 18:51:15 +02:00
parent e43a906cde
commit d37388423d
@@ -70,6 +70,8 @@ def upgrade() -> None:
logger.info("Table %s does not exist — nothing to rename", tbl) logger.info("Table %s does not exist — nothing to rename", tbl)
# ── 2. Create new contacts table ────────────────────────────────── # ── 2. Create new contacts table ──────────────────────────────────
# Drop indexes that were carried over from the renamed old tables
op.execute("DROP INDEX IF EXISTS ix_contacts_tenant_id")
op.create_table( op.create_table(
"contacts", "contacts",
sa.Column("id", UUID(as_uuid=True), primary_key=True, server_default=sa.text("gen_random_uuid()")), sa.Column("id", UUID(as_uuid=True), primary_key=True, server_default=sa.text("gen_random_uuid()")),