"""Add Department table Revision ID: 60b4aee3ad2d Revises: 48f1ca8fa73a Create Date: 2026-02-23 20:56:21.095082 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '60b4aee3ad2d' down_revision = '48f1ca8fa73a' branch_labels = None depends_on = None def upgrade(): conn = op.get_bind() insp = sa.inspect(conn) if 'departments' in set(insp.get_table_names()): return op.create_table( 'departments', sa.Column('id', sa.Integer(), nullable=False), sa.Column('name', sa.String(length=100), nullable=False), sa.Column('description', sa.Text(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'), ) def downgrade(): conn = op.get_bind() insp = sa.inspect(conn) if 'departments' not in set(insp.get_table_names()): return op.drop_table('departments')