todoapp-ns86xt/migrations/script.py.mako
Automated Action d593baa23c Set up Alembic database migrations with initial Todo table migration
- Initialize Alembic in migrations/ directory (not alembic/)
- Configure alembic.ini with correct SQLite absolute path: sqlite:////app/storage/db/db.sqlite
- Configure migrations/env.py to import Base correctly from app.db.base using absolute imports
- Create initial migration 0001_initial_todo_table.py for Todo model
- Migration creates todos table with id, title, description, completed, created_at, updated_at fields
- Includes proper indexes for id (primary key) and title fields
- Uses absolute imports to avoid ModuleNotFoundError issues
- Follows exact specifications for SQLite URL and import paths
2025-06-20 23:23:49 +00:00

24 lines
509 B
Mako

"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
def upgrade() -> None:
${upgrades if upgrades else "pass"}
def downgrade() -> None:
${downgrades if downgrades else "pass"}