岗位会商
This commit is contained in:
1 parent
1cd99a5a90
commit
1bc203b5cd
23 files changed
+2230
-401
No files matched your search
+47
@@ -0,0 +1,47 @@
|
||||
"""Persist position-roundtable built-in agent thread ids.
|
||||
|
||||
Revision ID: 20260721_04
|
||||
Revises: 20260721_03
|
||||
Create Date: 2026-07-21
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260721_04"
|
||||
down_revision = "20260721_03"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
return table_name in inspect(op.get_bind()).get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
return column_name in {column["name"] for column in inspect(op.get_bind()).get_columns(table_name)}
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
table = "position_roundtable_sessions"
|
||||
if not _has_table(table):
|
||||
return
|
||||
if not _has_column(table, "summary_thread_id"):
|
||||
op.add_column(table, sa.Column("summary_thread_id", sa.String(length=128), nullable=True))
|
||||
if not _has_column(table, "action_plan_thread_id"):
|
||||
op.add_column(table, sa.Column("action_plan_thread_id", sa.String(length=128), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
table = "position_roundtable_sessions"
|
||||
if not _has_table(table):
|
||||
return
|
||||
for column in ("action_plan_thread_id", "summary_thread_id"):
|
||||
if _has_column(table, column):
|
||||
op.drop_column(table, column)
|
||||
Reference in new issue
Block a user