gate2: fix all migrations for fresh DB installation

This commit is contained in:
Agent Zero
2026-07-31 19:16:11 +02:00
parent d37388423d
commit 010ef448e7
40 changed files with 230 additions and 207 deletions
@@ -33,10 +33,10 @@ def upgrade() -> None:
name="ck_pd_end_after_start",
),
)
op.create_index("ix_pd_from_user", "permission_delegations", ["from_user_id"])
op.create_index("ix_pd_to_user", "permission_delegations", ["to_user_id"])
op.create_index("ix_pd_tenant", "permission_delegations", ["tenant_id"])
op.create_index("ix_pd_active", "permission_delegations", ["active"])
op.execute('CREATE INDEX IF NOT EXISTS ix_pd_from_user ON permission_delegations (from_user_id)')
op.execute('CREATE INDEX IF NOT EXISTS ix_pd_to_user ON permission_delegations (to_user_id)')
op.execute('CREATE INDEX IF NOT EXISTS ix_pd_tenant ON permission_delegations (tenant_id)')
op.execute('CREATE INDEX IF NOT EXISTS ix_pd_active ON permission_delegations (active)')
def downgrade() -> None: