mirror of
https://github.com/OHV-IT/collabrix.git
synced 2025-12-15 16:48:36 +01:00
31 lines
818 B
Python
31 lines
818 B
Python
"""Add assignee_id to kanban_card table
|
|
|
|
Revision ID: 0003
|
|
Revises: 0001
|
|
Create Date: 2024-12-13 00:00:00.000000
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '0003'
|
|
down_revision = '0001'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# Add assignee_id column to kanban_card table
|
|
op.add_column('kanban_card', sa.Column('assignee_id', sa.Integer(), nullable=True))
|
|
# Add foreign key constraint
|
|
op.create_foreign_key('fk_kanban_card_assignee_id', 'kanban_card', 'user', ['assignee_id'], ['id'])
|
|
|
|
|
|
def downgrade() -> None:
|
|
# Drop foreign key constraint
|
|
op.drop_constraint('fk_kanban_card_assignee_id', 'kanban_card', type_='foreignkey')
|
|
# Remove assignee_id column
|
|
op.drop_column('kanban_card', 'assignee_id')
|