mirror of https://github.com/langgenius/dify.git
Drop offline guards in is_deleted migration
This commit is contained in:
parent
53c6c27a98
commit
5efe443d85
|
|
@ -25,13 +25,6 @@ backup_table_name = 'conversations_4f02b6704509_bak'
|
|||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
context = op.get_context()
|
||||
if context.is_offline_mode():
|
||||
# In offline mode we cannot reflect columns; skip backup/data moves.
|
||||
with op.batch_alter_table('conversations', schema=None) as batch_op:
|
||||
batch_op.drop_column('is_deleted')
|
||||
return
|
||||
|
||||
bind = op.get_bind()
|
||||
metadata = sa.MetaData()
|
||||
conversations = sa.Table('conversations', metadata, autoload_with=bind)
|
||||
|
|
@ -67,10 +60,6 @@ def downgrade():
|
|||
batch_op.add_column(sa.Column('is_deleted', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
|
||||
|
||||
# Restore soft-deleted conversations from backup table if it exists
|
||||
context = op.get_context()
|
||||
if context.is_offline_mode():
|
||||
return
|
||||
|
||||
bind = op.get_bind()
|
||||
metadata = sa.MetaData()
|
||||
inspector = inspect(bind)
|
||||
|
|
|
|||
Loading…
Reference in New Issue