45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
"""empty message
|
|
|
|
Revision ID: 78f5c2c65bf3
|
|
Revises: 698a921acb46
|
|
Create Date: 2023-10-17 10:03:40.828441
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '78f5c2c65bf3'
|
|
down_revision = '698a921acb46'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('kkv_data_store',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('top_level_key', sa.String(length=255), nullable=False),
|
|
sa.Column('secondary_key', sa.String(length=255), nullable=False),
|
|
sa.Column('value', sa.JSON(), nullable=False),
|
|
sa.Column('updated_at_in_seconds', sa.Integer(), nullable=False),
|
|
sa.Column('created_at_in_seconds', sa.Integer(), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
with op.batch_alter_table('kkv_data_store', schema=None) as batch_op:
|
|
batch_op.create_index(batch_op.f('ix_kkv_data_store_secondary_key'), ['secondary_key'], unique=False)
|
|
batch_op.create_index(batch_op.f('ix_kkv_data_store_top_level_key'), ['top_level_key'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('kkv_data_store', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_kkv_data_store_top_level_key'))
|
|
batch_op.drop_index(batch_op.f('ix_kkv_data_store_secondary_key'))
|
|
|
|
op.drop_table('kkv_data_store')
|
|
# ### end Alembic commands ###
|