Update initial Alembic migration script for SQLite setup
This commit is contained in:
parent
8e743adf11
commit
c64d65ebc8
@ -17,12 +17,28 @@ depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
# ### 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():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
# ### Drop everything created in this migration ###
|
||||
op.drop_table('alembic_version')
|
||||
# ### end commands ###
|
Loading…
x
Reference in New Issue
Block a user