38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
"""add simulation settings
|
|
|
|
Revision ID: c7e91a4b2d30
|
|
Revises: 2a4c9d8e7f10
|
|
Create Date: 2026-07-17 18:30:00.000000
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "c7e91a4b2d30"
|
|
down_revision = "2a4c9d8e7f10"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# Some development databases received this table manually before it was
|
|
# brought under Alembic. Keep the migration safe for both those databases
|
|
# and clean installations.
|
|
if "simulation_settings" in sa.inspect(op.get_bind()).get_table_names():
|
|
return
|
|
|
|
op.create_table(
|
|
"simulation_settings",
|
|
sa.Column("key", sa.String(length=255), nullable=False),
|
|
sa.Column("value", sa.Text(), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.PrimaryKeyConstraint("key"),
|
|
)
|
|
|
|
|
|
def downgrade():
|
|
if "simulation_settings" in sa.inspect(op.get_bind()).get_table_names():
|
|
op.drop_table("simulation_settings")
|