chore: bootstrap repository with governance docs
Initialize git, add Apache-2.0 LICENSE, .gitattributes (LF line endings), AGENTS.md (entry points, stack, discovery order, baseline checks), RUNBOOK.md (dev boot, prod deploy with overlay, ingestion, failures, rollback, scaling notes), .env.prod.example with rotated credential placeholders, and dev-only warnings on .env.example. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
25
scripts/init_db.py
Normal file
25
scripts/init_db.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Apply Alembic migrations against the configured Postgres."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from alembic import command
|
||||
from alembic.config import Config
|
||||
|
||||
from app.config import settings
|
||||
|
||||
|
||||
def main() -> int:
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
cfg = Config(str(root / "alembic.ini"))
|
||||
cfg.set_main_option("script_location", str(root / "app" / "db" / "migrations"))
|
||||
cfg.set_main_option("sqlalchemy.url", settings.database_url)
|
||||
command.upgrade(cfg, "head")
|
||||
print("alembic upgrade head: ok")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user