44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
"""Initial migration
|
|
|
|
Revision ID: initial_migration
|
|
Revises:
|
|
Create Date: 2025-06-05
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'initial_migration'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### Initial database setup ###
|
|
# This migration is a placeholder to establish the initial database state.
|
|
# SQLite-specific configuration is included in env.py with render_as_batch=True
|
|
|
|
# Create a version tracking table for Alembic
|
|
op.create_table(
|
|
'alembic_version',
|
|
sa.Column('version_num', sa.String(length=32), nullable=False),
|
|
sa.PrimaryKeyConstraint('version_num')
|
|
)
|
|
|
|
# Insert the current version
|
|
op.bulk_insert(
|
|
sa.table('alembic_version',
|
|
sa.column('version_num', sa.String(length=32))),
|
|
[{'version_num': revision}]
|
|
)
|
|
|
|
# ### end commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### Drop everything created in this migration ###
|
|
op.drop_table('alembic_version')
|
|
# ### end commands ### |