# ============================================================================= # QWHPI — Quebec Weekly Housing Price Index # Author : Simon-Pierre Boucher # Contact : contact@spboucher.ai # File : db/migrations/versions/001_initial_schema.py # Purpose : Initial migration — creates the full QWHPI schema (db/schema.sql). # ============================================================================= """Initial QWHPI schema. Revision ID: 001 Revises: """ from __future__ import annotations from pathlib import Path from alembic import op revision = "001" down_revision = None branch_labels = None depends_on = None SCHEMA_SQL = Path(__file__).resolve().parents[2] / "schema.sql" def upgrade() -> None: op.execute(SCHEMA_SQL.read_text()) def downgrade() -> None: for table in ("vintages", "liquidity", "observations", "model_runs", "series", "geographies"): op.execute(f"DROP TABLE IF EXISTS {table} CASCADE")