build: 打通 FastAPI 与 Vue 最小工程、依赖与数据库连接
后端入口、配置、Redis 与 Alembic 迁移就位;前端 Vite 工程可安装可构建。
This commit is contained in:
1 parent
ec5835ca77
commit
977783c126
167 files changed
+26082
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"""Row-level scoping for the ticket DB connector
|
||||
|
||||
Revision ID: add_tkt_row_scope_001
|
||||
Revises: a1dbf557bbb0
|
||||
Create Date: 2026-07-20
|
||||
|
||||
Adds the per-table customer-column map that restricts a connector's queries to
|
||||
the ticket customer's own rows, and which customer value fills the predicate.
|
||||
Existing connectors get NULL/'email' — no scoping until an org configures it,
|
||||
so behaviour is unchanged on upgrade.
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import JSON
|
||||
|
||||
revision = "add_tkt_row_scope_001"
|
||||
down_revision = "a1dbf557bbb0"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"ticket_db_connectors",
|
||||
sa.Column("row_scope", JSON(), nullable=True),
|
||||
)
|
||||
op.add_column(
|
||||
"ticket_db_connectors",
|
||||
sa.Column(
|
||||
"row_scope_key",
|
||||
sa.String(length=20),
|
||||
nullable=False,
|
||||
server_default="email",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("ticket_db_connectors", "row_scope_key")
|
||||
op.drop_column("ticket_db_connectors", "row_scope")
|
||||
Reference in new issue
Block a user