fix: model issue
parent
da90753256
commit
edb1bd7d26
@ -0,0 +1,67 @@
|
|||||||
|
"""fix merge error
|
||||||
|
|
||||||
|
Revision ID: 71afb1a6d8dc
|
||||||
|
Revises: e885e2eddbad
|
||||||
|
Create Date: 2025-05-02 22:37:16.506584
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import models as models
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '71afb1a6d8dc'
|
||||||
|
down_revision = 'e885e2eddbad'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('tool_published_apps', schema=None) as batch_op:
|
||||||
|
batch_op.add_column(sa.Column('tenant_id', models.types.StringUUID(), nullable=False))
|
||||||
|
batch_op.add_column(sa.Column('conversation_id', models.types.StringUUID(), nullable=True))
|
||||||
|
batch_op.add_column(sa.Column('file_key', sa.String(length=255), nullable=False))
|
||||||
|
batch_op.add_column(sa.Column('mimetype', sa.String(length=255), nullable=False))
|
||||||
|
batch_op.add_column(sa.Column('original_url', sa.String(length=2048), nullable=True))
|
||||||
|
batch_op.add_column(sa.Column('name', sa.String(), nullable=False))
|
||||||
|
batch_op.add_column(sa.Column('size', sa.Integer(), nullable=False))
|
||||||
|
|
||||||
|
with op.batch_alter_table('workflow_app_logs', schema=None) as batch_op:
|
||||||
|
batch_op.drop_index('workflow_app_log_app_idx')
|
||||||
|
batch_op.create_index('workflow_app_log_app_idx', ['tenant_id', 'app_id', 'created_at'], unique=False)
|
||||||
|
batch_op.create_index('workflow_app_log_workflow_run_idx', ['workflow_run_id'], unique=False)
|
||||||
|
|
||||||
|
with op.batch_alter_table('workflow_conversation_variables', schema=None) as batch_op:
|
||||||
|
batch_op.drop_index('workflow_conversation_variables_app_id_idx')
|
||||||
|
batch_op.drop_index('workflow_conversation_variables_created_at_idx')
|
||||||
|
batch_op.create_index('workflow__conversation_variables_app_id_idx', ['app_id'], unique=False)
|
||||||
|
batch_op.create_index('workflow__conversation_variables_created_at_idx', ['created_at'], unique=False)
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('workflow_conversation_variables', schema=None) as batch_op:
|
||||||
|
batch_op.drop_index('workflow__conversation_variables_created_at_idx')
|
||||||
|
batch_op.drop_index('workflow__conversation_variables_app_id_idx')
|
||||||
|
batch_op.create_index('workflow_conversation_variables_created_at_idx', ['created_at'], unique=False)
|
||||||
|
batch_op.create_index('workflow_conversation_variables_app_id_idx', ['app_id'], unique=False)
|
||||||
|
|
||||||
|
with op.batch_alter_table('workflow_app_logs', schema=None) as batch_op:
|
||||||
|
batch_op.drop_index('workflow_app_log_workflow_run_idx')
|
||||||
|
batch_op.drop_index('workflow_app_log_app_idx')
|
||||||
|
batch_op.create_index('workflow_app_log_app_idx', ['tenant_id', 'app_id'], unique=False)
|
||||||
|
|
||||||
|
with op.batch_alter_table('tool_published_apps', schema=None) as batch_op:
|
||||||
|
batch_op.drop_column('size')
|
||||||
|
batch_op.drop_column('name')
|
||||||
|
batch_op.drop_column('original_url')
|
||||||
|
batch_op.drop_column('mimetype')
|
||||||
|
batch_op.drop_column('file_key')
|
||||||
|
batch_op.drop_column('conversation_id')
|
||||||
|
batch_op.drop_column('tenant_id')
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
Loading…
Reference in New Issue