refactor: 移除提示词模板页面及相关接口,精简岗位/标签/用户提示词模型
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
838e986670
commit
e6662cf673
19 files changed
+55
-729
No files matched your search
+1
-18
@@ -2,8 +2,7 @@
|
||||
|
||||
New tables ``positions`` + ``position_tag_bindings``; new column
|
||||
``users.position_id``; ``origin`` / ``position_id`` on ``agent_favorites`` and
|
||||
``scheduled_task_subscriptions``; ``is_template`` / ``origin`` / ``template_id``
|
||||
/ ``position_id`` on ``user_custom_prompts``.
|
||||
``scheduled_task_subscriptions``.
|
||||
|
||||
Note: the running app also auto-adds these via ``_ensure_orm_columns_sync`` and
|
||||
``create_all`` on startup; this migration keeps the alembic history consistent
|
||||
@@ -77,19 +76,6 @@ def upgrade() -> None:
|
||||
op.add_column(table, sa.Column("position_id", sa.String(64), nullable=True))
|
||||
op.create_index(f"ix_{table}_position_id", table, ["position_id"])
|
||||
|
||||
if _has_table("user_custom_prompts"):
|
||||
if not _has_column("user_custom_prompts", "is_template"):
|
||||
op.add_column("user_custom_prompts", sa.Column("is_template", sa.Boolean(), nullable=False, server_default=sa.text("0")))
|
||||
op.create_index("ix_user_custom_prompts_is_template", "user_custom_prompts", ["is_template"])
|
||||
if not _has_column("user_custom_prompts", "origin"):
|
||||
op.add_column("user_custom_prompts", sa.Column("origin", sa.String(16), nullable=False, server_default="user"))
|
||||
if not _has_column("user_custom_prompts", "template_id"):
|
||||
op.add_column("user_custom_prompts", sa.Column("template_id", sa.String(64), nullable=True))
|
||||
op.create_index("ix_user_custom_prompts_template_id", "user_custom_prompts", ["template_id"])
|
||||
if not _has_column("user_custom_prompts", "position_id"):
|
||||
op.add_column("user_custom_prompts", sa.Column("position_id", sa.String(64), nullable=True))
|
||||
op.create_index("ix_user_custom_prompts_position_id", "user_custom_prompts", ["position_id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
for table in ("agent_favorites", "scheduled_task_subscriptions"):
|
||||
@@ -97,9 +83,6 @@ def downgrade() -> None:
|
||||
op.drop_column(table, "position_id")
|
||||
if _has_column(table, "origin"):
|
||||
op.drop_column(table, "origin")
|
||||
for col in ("position_id", "template_id", "origin", "is_template"):
|
||||
if _has_column("user_custom_prompts", col):
|
||||
op.drop_column("user_custom_prompts", col)
|
||||
if _has_column("users", "position_id"):
|
||||
op.drop_column("users", "position_id")
|
||||
if _has_table("position_tag_bindings"):
|
||||
|
||||
Reference in new issue
Block a user