40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""org perm perms join table
|
|
|
|
Revision ID: 85edbf9a176c
|
|
Revises: 98e20aae555c
|
|
Create Date: 2026-06-16 13:31:57.427953
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "85edbf9a176c"
|
|
down_revision: Union[str, Sequence[str], None] = "98e20aae555c"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"org_permissions",
|
|
sa.Column("org_id", sa.Integer(), nullable=False),
|
|
sa.Column("permission_id", sa.Integer(), nullable=False),
|
|
sa.ForeignKeyConstraint(["org_id"], ["organisation.id"], ondelete="CASCADE"),
|
|
sa.ForeignKeyConstraint(["permission_id"], ["permission.id"], ondelete="CASCADE"),
|
|
sa.PrimaryKeyConstraint("org_id", "permission_id"),
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table("org_permissions")
|
|
# ### end Alembic commands ###
|