"""Phase 12.5 — POS Pro schema."""
from alembic import op
import sqlalchemy as sa
from app.core.database import Base
import app.models  # noqa: F401

revision = "0006_phase_125_pos_pro"
down_revision = "0005_phase_124_pos_lite"
branch_labels = None
depends_on = None


def upgrade():
    bind = op.get_bind()
    Base.metadata.create_all(bind=bind)


def downgrade():
    bind = op.get_bind()
    for table in (
        "pos_stations",
        "pos_floor_plans",
        "pos_tax_lines",
        "pos_discounts",
        "pos_payments",
    ):
        if sa.inspect(bind).has_table(table):
            op.drop_table(table)
