From 2e9084f369cb7f05899e0abdc919a02e42efe218 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Tue, 20 Aug 2024 14:34:03 +0800 Subject: [PATCH] chore(database): Rename table name from `workflow__conversation_variables` to `workflow_conversation_variables`. (#7432) --- ...ename_workflow__conversation_variables_.py | 28 +++++++++++++++++++ api/models/workflow.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 api/migrations/versions/2024_08_20_0455-2dbe42621d96_rename_workflow__conversation_variables_.py diff --git a/api/migrations/versions/2024_08_20_0455-2dbe42621d96_rename_workflow__conversation_variables_.py b/api/migrations/versions/2024_08_20_0455-2dbe42621d96_rename_workflow__conversation_variables_.py new file mode 100644 index 00000000000000..3dc7fed818ea2b --- /dev/null +++ b/api/migrations/versions/2024_08_20_0455-2dbe42621d96_rename_workflow__conversation_variables_.py @@ -0,0 +1,28 @@ +"""rename workflow__conversation_variables to workflow_conversation_variables + +Revision ID: 2dbe42621d96 +Revises: a6be81136580 +Create Date: 2024-08-20 04:55:38.160010 + +""" +from alembic import op + +import models as models + +# revision identifiers, used by Alembic. +revision = '2dbe42621d96' +down_revision = 'a6be81136580' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.rename_table('workflow__conversation_variables', 'workflow_conversation_variables') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.rename_table('workflow_conversation_variables', 'workflow__conversation_variables') + # ### end Alembic commands ### diff --git a/api/models/workflow.py b/api/models/workflow.py index 759e07c7154e0d..396c023dc159b6 100644 --- a/api/models/workflow.py +++ b/api/models/workflow.py @@ -724,7 +724,7 @@ def created_by_end_user(self): class ConversationVariable(db.Model): - __tablename__ = 'workflow__conversation_variables' + __tablename__ = 'workflow_conversation_variables' id: Mapped[str] = db.Column(StringUUID, primary_key=True) conversation_id: Mapped[str] = db.Column(StringUUID, nullable=False, primary_key=True)