chore: 服务启动不再自动迁移数据库
schema 变更改为显式 db:push / 手动应用后再启动。
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { createApp } from "./app.ts";
|
||||
import { loadEnv } from "./env.ts";
|
||||
import { createDb, runMigrations } from "@new-api-key-usage/db";
|
||||
import { createDb } from "@new-api-key-usage/db";
|
||||
import { appLogger, setupLogging } from "@new-api-key-usage/core";
|
||||
|
||||
const env = loadEnv(process.env);
|
||||
@@ -9,13 +8,6 @@ setupLogging(env.LOG_LEVEL);
|
||||
|
||||
const db = createDb(env.DATABASE_URL);
|
||||
|
||||
const migrationsFolder =
|
||||
process.env.MIGRATIONS_FOLDER ??
|
||||
fileURLToPath(new URL("../../../packages/db/drizzle", import.meta.url));
|
||||
|
||||
await runMigrations(db, migrationsFolder);
|
||||
appLogger("server").info("数据库迁移已就绪");
|
||||
|
||||
const app = createApp({
|
||||
db,
|
||||
skKeyEncryptionSecret: env.SK_KEY_ENCRYPTION_SECRET,
|
||||
|
||||
Reference in New Issue
Block a user