build: 打通 FastAPI 与 Vue 最小工程、依赖与数据库连接

后端入口、配置、Redis 与 Alembic 迁移就位;前端 Vite 工程可安装可构建。
This commit is contained in:
WangShen007 committed 2026-09-22 20:15:00 +08:00
1 parent ec5835ca77
commit 977783c126
167 files changed
+26082

No files matched your search

@@ -0,0 +1,41 @@
"""Add metered flag to investigation_runs
Revision ID: add_tkt_metered_001
Revises: add_tkt_row_scope_001
Create Date: 2026-07-21
Marks whether an investigation run's LLM usage counts against the org's message
budget (hosted model only). Existing rows default to false — nothing is
retroactively metered on upgrade.
"""
from alembic import op
import sqlalchemy as sa
revision = "add_tkt_metered_001"
down_revision = "add_tkt_row_scope_001"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"investigation_runs",
sa.Column(
"metered",
sa.Boolean(),
nullable=False,
server_default=sa.text("false"),
),
)
# The enterprise message-limit check sums llm_calls of metered runs per
# billing window — an index on (org, metered, created_at) keeps that cheap.
op.create_index(
"ix_investigation_runs_metered_period",
"investigation_runs",
["organization_id", "metered", "created_at"],
)
def downgrade() -> None:
op.drop_index("ix_investigation_runs_metered_period", table_name="investigation_runs")
op.drop_column("investigation_runs", "metered")