spiff-arena/spiffworkflow-backend/migrations/versions/12a8864399d4_.py

46 lines
1.5 KiB
Python
Raw Normal View History

"""empty message
Revision ID: 12a8864399d4
Revises: bc2b84d013e0
Create Date: 2023-12-19 08:07:12.265442
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '12a8864399d4'
down_revision = 'bc2b84d013e0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('json_data_store', schema=None) as batch_op:
batch_op.drop_index('ix_json_data_store_name')
op.drop_table('json_data_store')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('json_data_store',
sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
sa.Column('name', mysql.VARCHAR(length=255), nullable=True),
sa.Column('location', mysql.VARCHAR(length=255), nullable=True),
sa.Column('data', mysql.JSON(), nullable=True),
sa.Column('updated_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True),
sa.Column('created_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id'),
mysql_collate='utf8mb4_0900_ai_ci',
mysql_default_charset='utf8mb4',
mysql_engine='InnoDB'
)
with op.batch_alter_table('json_data_store', schema=None) as batch_op:
batch_op.create_index('ix_json_data_store_name', ['name'], unique=False)
# ### end Alembic commands ###