sprint14-19: ABAC UI rule editor + permission templates + bulk share + analytics + delegation + resolution strategies + migrations 0056-0058
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
"""Add resolution_strategy field to tenants table.
|
||||
|
||||
Revision ID: 0058
|
||||
Revises: 0057
|
||||
Create Date: 2026-07-29
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "0058"
|
||||
down_revision = "0057"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"tenants",
|
||||
sa.Column(
|
||||
"resolution_strategy",
|
||||
sa.String(30),
|
||||
nullable=False,
|
||||
server_default=sa.text("'highest_wins'"),
|
||||
),
|
||||
)
|
||||
op.create_check_constraint(
|
||||
"ck_tenant_resolution_strategy",
|
||||
"tenants",
|
||||
sa.schema.CheckConstraint(
|
||||
"resolution_strategy IN ('highest_wins', 'deny_overrides_allow', 'direct_overrides_group', 'most_restrictive_wins')",
|
||||
name="ck_tenant_resolution_strategy",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_constraint("ck_tenant_resolution_strategy", "tenants")
|
||||
op.drop_column("tenants", "resolution_strategy")
|
||||
Reference in New Issue
Block a user