Updated migration to support sqlite
This commit is contained in:
@@ -34,6 +34,7 @@ def run_migrations_offline() -> None:
|
|||||||
target_metadata=target_metadata,
|
target_metadata=target_metadata,
|
||||||
literal_binds=True,
|
literal_binds=True,
|
||||||
dialect_opts={"paramstyle": "named"},
|
dialect_opts={"paramstyle": "named"},
|
||||||
|
render_as_batch=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
with context.begin_transaction():
|
with context.begin_transaction():
|
||||||
|
|||||||
@@ -16,9 +16,11 @@ depends_on = None
|
|||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
"""Perform the upgrade."""
|
"""Perform the upgrade."""
|
||||||
op.alter_column("filament", "color_hex", type_=sa.String(length=8), existing_nullable=True)
|
with op.batch_alter_table("filament") as batch_op:
|
||||||
|
batch_op.alter_column("color_hex", type_=sa.String(length=8), existing_nullable=True)
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
"""Perform the downgrade."""
|
"""Perform the downgrade."""
|
||||||
op.alter_column("filament", "color_hex", type_=sa.String(length=6), existing_nullable=True)
|
with op.batch_alter_table("filament") as batch_op:
|
||||||
|
batch_op.alter_column("color_hex", type_=sa.String(length=6), existing_nullable=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user