Skip to content

Commit fcc0746

Browse files
authored
Merge pull request #43 from YangZhiBoGreenHand/yzb/fix/migration
fix: update add action migration
2 parents ca5cb1b + 2b2d652 commit fcc0746

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/models/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ActionBase(BaseModel):
2323
body_param_schema: Optional[dict] = Field(default=None, sa_column=Column(JSON))
2424
body_type: str = Field(nullable=False)
2525
function_def: Optional[dict] = Field(default=None, sa_column=Column(JSON))
26-
use_for_everyone: bool = Field(default=False, sa_column=Column(Boolean, default=False))
26+
use_for_everyone: bool = Field(default=False, nullable=False)
2727

2828

2929
class Action(ActionBase, PrimaryKeyMixin, TimeStampMixin, table=True):

migrations/versions/2024-02-23-15-55_e7339aab6549.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def upgrade() -> None:
4747
)
4848
op.add_column("run", sa.Column("extra_body", sa.JSON(), nullable=True))
4949
op.execute(
50-
" ALTER TABLE open_assistant.token_relation MODIFY COLUMN relation_type enum('Assistant','File','Thread','Action') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;"
50+
" ALTER TABLE token_relation MODIFY COLUMN relation_type enum('Assistant','File','Thread','Action') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;"
5151
)
5252
# ### end Alembic commands ###
5353

@@ -57,6 +57,6 @@ def downgrade() -> None:
5757
op.drop_table("action")
5858
op.drop_column("run", "extra_body")
5959
op.execute(
60-
"ALTER TABLE open_assistant.token_relation MODIFY COLUMN relation_type enum('Assistant','File','Thread') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;"
60+
"ALTER TABLE token_relation MODIFY COLUMN relation_type enum('Assistant','File','Thread') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;"
6161
)
6262
# ### end Alembic commands ###

0 commit comments

Comments
 (0)