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
45
alembic/versions/2026-05-29_drop_user_groups_org_column.py
Normal file
45
alembic/versions/2026-05-29_drop_user_groups_org_column.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
"""Drop user_groups org column
|
||||
|
||||
Revision ID: d9dc6986fe38
|
||||
Revises: 8132c4b88665
|
||||
Create Date: 2026-05-29 16:10:00.320982
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "d9dc6986fe38"
|
||||
down_revision: Union[str, Sequence[str], None] = "8132c4b88665"
|
||||
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("user_groups_org_id_fkey"), "user_groups", type_="foreignkey")
|
||||
op.drop_column("user_groups", "org_id")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"user_groups",
|
||||
sa.Column("org_id", sa.INTEGER(), autoincrement=False, nullable=False),
|
||||
)
|
||||
op.create_foreign_key(
|
||||
op.f("user_groups_org_id_fkey"),
|
||||
"user_groups",
|
||||
"organisation",
|
||||
["org_id"],
|
||||
["id"],
|
||||
ondelete="CASCADE",
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue