/**
 * vitest-pool-workers 測試環境初始化：credential-store-migration T8/T9 測試用 D1 建表。
 * 對齊 kbdb/migrations/0002_credentials.sql schema（不接 migrations_dir，單表直接 exec）。
 */
import { env } from 'cloudflare:test';

await env.CREDENTIALS_DB.exec(
  "CREATE TABLE IF NOT EXISTS credentials (api_key TEXT NOT NULL, name TEXT NOT NULL, service TEXT, sensitivity TEXT NOT NULL DEFAULT 'standard', secret_ref TEXT NOT NULL, created_at INTEGER NOT NULL, last_used_at INTEGER, PRIMARY KEY (api_key, name))",
);
