"""Add employee_id to DemoAccount

Revision ID: df694c2fc8cd
Revises: 09f614cb47d8
Create Date: 2025-11-14 ...

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'df694c2fc8cd'
down_revision = '09f614cb47d8'
branch_labels = None
depends_on = None


def upgrade():
    # Only change: add employee_id + FK on demo_account
    op.add_column('demo_account', sa.Column('employee_id', sa.Integer(), nullable=True))
    op.create_foreign_key(
        'fk_demoaccount_employee',
        'demo_account',     # source table
        'employee',         # referent table
        ['employee_id'],    # local cols
        ['id']              # remote cols
    )


def downgrade():
    op.drop_constraint('fk_demoaccount_employee', 'demo_account', type_='foreignkey')
    op.drop_column('demo_account', 'employee_id')