mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
Drop offline guards in is_deleted migration
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user