acupedia-api/alembic
Urvish Prajapati 8cb459747f feat(module-builder): add multi-module management, compiler, and therapeutics safety guards 2026-11-13 15:21:28 +05:30
..
versions feat(module-builder): add multi-module management, compiler, and therapeutics safety guards 2026-11-13 15:21:28 +05:30
README.txt Updated serach fix 2026-09-26 22:13:04 +05:30
env.py Updated serach fix 2026-09-26 22:13:04 +05:30

README.txt

AccuPedia Alembic bootstrap
============================

Files:
  env.py
  versions/20260924_0001_baseline_existing_schema.py
  versions/20260924_0002_add_template_search_flags.py

Expected project placement:

  <repo-root>/
  ├── alembic.ini
  ├── alembic/
  │   ├── env.py
  │   ├── script.py.mako
  │   └── versions/
  │       ├── 20260924_0001_baseline_existing_schema.py
  │       └── 20260924_0002_add_template_search_flags.py
  └── app/

Initialization sequence:

1. From repo root:
      alembic init alembic

2. Replace generated alembic/env.py with this env.py.

3. Copy both revision files into alembic/versions/.

4. Ensure alembic.ini keeps a sqlalchemy.url key.
   Its literal value is not used as the authoritative source because env.py
   overwrites it from app.core.config.settings.database_url.

5. Existing database only:
      alembic stamp 20260924_0001

6. Apply new schema change:
      alembic upgrade head

7. Verify:
      alembic current
      alembic heads

Important:
- Do NOT run `alembic stamp head` before applying 20260924_0002. That would mark
  the search-flag migration as applied without actually adding the columns.
- For a brand-new empty database, this two-file baseline approach does not
  create the historical schema. Continue using your existing schema bootstrap
  until the complete historical schema is migrated into Alembic, or create a
  dedicated initial-schema migration later.