import type { Kysely } from "kysely"; import { execDdl } from "../src/migration-helpers.ts"; // PI-2 上游模型列表:「获取模型列表」从上游的模型列表接口拉到的结果(归一化后的 [{id, displayName, contextWindow, // supportsVision, supportsTools, pricing}])存 models,拉取时间存 models_fetched_at。null = 从没拉过,用随包静态表。 // biome-ignore lint/suspicious/noExplicitAny: 迁移不依赖应用表类型 export async function up(db: Kysely): Promise { await execDdl( db, `alter table pi_upstream add column models jsonb; alter table pi_upstream add column models_fetched_at timestamptz;`, ); } // biome-ignore lint/suspicious/noExplicitAny: 同上 export async function down(db: Kysely): Promise { await execDdl( db, `alter table pi_upstream drop column if exists models_fetched_at; alter table pi_upstream drop column if exists models;`, ); }