mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 00:06:04 +00:00
Replace manual if-sqlite/if-postgres branching with Alembic: - Add alembic dependency - Create programmatic alembic env (no CLI/alembic.ini needed) - Support async engines via run_sync passthrough - render_as_batch=True for SQLite ALTER TABLE compatibility - Auto-stamp baseline on first run (existing DB at version 25) - Run alembic upgrade head after legacy migrations - Include sample migration showing schema + data migration patterns - Add alembic dir to package-data for distribution
25 lines
535 B
Python
25 lines
535 B
Python
"""baseline: stamp existing schema (db version 25)
|
|
|
|
This is a no-op migration that marks the starting point for Alembic.
|
|
All tables already exist via create_all() + legacy DBMigration system.
|
|
|
|
Revision ID: 0001_baseline
|
|
Revises: None
|
|
Create Date: 2026-04-08
|
|
"""
|
|
|
|
revision = '0001_baseline'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# No-op: existing schema is already at database_version=25
|
|
# This revision serves as the Alembic baseline.
|
|
pass
|
|
|
|
|
|
def downgrade() -> None:
|
|
pass
|