Expand KOC LOOP MCP operations

This commit is contained in:
巫凤萍
2026-08-07 14:12:52 +08:00
parent 1a9a113229
commit 5670a7939b
15 changed files with 2426 additions and 24 deletions

View File

@@ -165,6 +165,13 @@ export async function ensureSchema(database?: D1Database) {
expires_at TEXT NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
`CREATE TABLE IF NOT EXISTS mcp_export_tokens (
token_hash TEXT PRIMARY KEY,
kind TEXT NOT NULL,
payload TEXT NOT NULL,
expires_at TEXT NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
];
for (const statement of statements) {
@@ -340,6 +347,11 @@ export async function ensureSchema(database?: D1Database) {
"CREATE INDEX IF NOT EXISTS auth_sessions_expires_at_idx ON auth_sessions(expires_at)",
)
.run();
await db
.prepare(
"CREATE INDEX IF NOT EXISTS mcp_export_tokens_expires_at_idx ON mcp_export_tokens(expires_at)",
)
.run();
await db
.prepare(
`UPDATE distributions