feat: 多智能体会商草稿分享(import 复制 / view 公开结果页)
支持会商草稿生成分享码、导入副本与公开只读结果页,并在侧边栏展示最近会商记录。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cca3d8eb41
commit
0fd314632a
20 files changed
+1584
No files matched your search
+57
@@ -0,0 +1,57 @@
|
||||
"""Create roundtable_draft_shares table.
|
||||
|
||||
Per-draft share links for the roundtable-planning page, mirroring
|
||||
``thread_shares`` but pointing at a ``roundtable_drafts`` row. ``import`` codes
|
||||
copy the draft into the recipient's account; ``view`` codes back a public
|
||||
read-only result-report page. ``create_all`` makes the table for brand-new DBs;
|
||||
this revision patches DBs that already exist.
|
||||
|
||||
Revision ID: 20260606_01
|
||||
Revises: 20260605_02
|
||||
Create Date: 2026-06-06
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
revision = "20260606_01"
|
||||
down_revision = "20260605_02"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("roundtable_draft_shares"):
|
||||
return
|
||||
op.create_table(
|
||||
"roundtable_draft_shares",
|
||||
sa.Column("share_code", sa.String(length=32), primary_key=True),
|
||||
sa.Column("owner_user_id", sa.String(length=64), nullable=False),
|
||||
sa.Column("draft_id", sa.String(length=64), nullable=False),
|
||||
sa.Column("revoked", sa.Boolean(), nullable=False, server_default=sa.false()),
|
||||
sa.Column("mode", sa.String(length=16), nullable=False, server_default="import"),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_index(
|
||||
"ix_roundtable_draft_shares_owner_user_id",
|
||||
"roundtable_draft_shares",
|
||||
["owner_user_id"],
|
||||
)
|
||||
op.create_index(
|
||||
"ix_roundtable_draft_shares_draft_id",
|
||||
"roundtable_draft_shares",
|
||||
["draft_id"],
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_table("roundtable_draft_shares"):
|
||||
op.drop_table("roundtable_draft_shares")
|
||||
Reference in new issue
Block a user