Task 003: add postgres schema and seed data
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
"""initial postgres schema
|
||||
|
||||
Revision ID: 202605210003
|
||||
Revises:
|
||||
Create Date: 2026-05-21 00:03:00.000000
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from alembic import op
|
||||
|
||||
from src.infrastructure.schema import POSTGRES_SCHEMA_STATEMENTS
|
||||
|
||||
|
||||
revision = "202605210003"
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
for statement in POSTGRES_SCHEMA_STATEMENTS:
|
||||
op.execute(statement)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
for table_name in (
|
||||
"prompt_versions",
|
||||
"publish_commits",
|
||||
"research_run_manifests",
|
||||
"agent_jobs",
|
||||
"workflow_events",
|
||||
"assets",
|
||||
"article_drafts",
|
||||
"claims",
|
||||
"evidence_items",
|
||||
"plan_sections",
|
||||
"article_plans",
|
||||
"boundary_questions",
|
||||
"articles",
|
||||
"script_config_versions",
|
||||
"target_sites",
|
||||
"users",
|
||||
):
|
||||
op.execute(f"DROP TABLE IF EXISTS {table_name} CASCADE")
|
||||
Reference in New Issue
Block a user