forked from sr2/cloud-api
feat: project consistency
This commit is contained in:
parent
7804816a1a
commit
cb70f17ad5
16 changed files with 572 additions and 219 deletions
37
alembic/versions/2026-06-15_group_name_unique_per_org.py
Normal file
37
alembic/versions/2026-06-15_group_name_unique_per_org.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""group name unique per org
|
||||
|
||||
Revision ID: 98e20aae555c
|
||||
Revises: b6c8614ef799
|
||||
Create Date: 2026-06-15 11:05:16.673658
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "98e20aae555c"
|
||||
down_revision: Union[str, Sequence[str], None] = "b6c8614ef799"
|
||||
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.drop_constraint(op.f("group_name_key"), "group", type_="unique")
|
||||
op.create_unique_constraint("uniq_group_name_org_id", "group", ["name", "org_id"])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint("uniq_group_name_org_id", "group", type_="unique")
|
||||
op.create_unique_constraint(
|
||||
op.f("group_name_key"), "group", ["name"], postgresql_nulls_not_distinct=False
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue