spiff-arena/spiffworkflow-backend/migrations/versions/a872f8f2e909_.py

49 lines
1.7 KiB
Python

"""empty message
Revision ID: a872f8f2e909
Revises: 12a8864399d4
Create Date: 2023-12-19 08:40:26.572613
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a872f8f2e909'
down_revision = '12a8864399d4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('json_data_store',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('identifier', sa.String(length=255), nullable=False),
sa.Column('location', sa.String(length=255), nullable=False),
sa.Column('schema', sa.JSON(), nullable=False),
sa.Column('data', sa.JSON(), nullable=False),
sa.Column('description', sa.String(length=255), nullable=True),
sa.Column('updated_at_in_seconds', sa.Integer(), nullable=False),
sa.Column('created_at_in_seconds', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('identifier', 'location', name='_identifier_location_unique')
)
with op.batch_alter_table('json_data_store', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_json_data_store_identifier'), ['identifier'], unique=False)
batch_op.create_index(batch_op.f('ix_json_data_store_name'), ['name'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('json_data_store', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_json_data_store_name'))
batch_op.drop_index(batch_op.f('ix_json_data_store_identifier'))
op.drop_table('json_data_store')
# ### end Alembic commands ###