"""Phase 13.5 — Medical Record."""
from alembic import op
from app.core.database import Base
import app.models  # noqa: F401

revision = "0006_phase_135_medical_record"
down_revision = "0005_phase_134_patient_portal"
branch_labels = None
depends_on = None


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


def downgrade():
    for table in (
        "medical_record_access_logs",
        "immunization_records",
        "medication_statements",
        "allergies",
        "conditions",
        "encounters",
        "medical_records",
    ):
        op.drop_table(table)
