generated from dopt-python/py311
update database schema for linking of persons and companies
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""add unique constraint for company person linking table
|
||||
|
||||
Revision ID: 03d4f000f445
|
||||
Revises: 85577ce9f2ab
|
||||
Create Date: 2026-07-22 09:17:46.576581
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "03d4f000f445"
|
||||
down_revision: Union[str, Sequence[str], None] = "85577ce9f2ab"
|
||||
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! ###
|
||||
with op.batch_alter_table("zuordnung_personen_unternehmen") as batch_op:
|
||||
batch_op.create_unique_constraint("uq_un_id_pers_id", ["un_id", "pers_id"])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("zuordnung_personen_unternehmen") as batch_op:
|
||||
batch_op.drop_constraint("uq_un_id_pers_id")
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user