Skip to content

Commit

Permalink
fix:ai 的数据库密码先从 install.yaml 中读取,若没配再从 ai 的 config 中读取
Browse files Browse the repository at this point in the history
  • Loading branch information
OYX-1 committed Aug 1, 2024
1 parent 4bef1b3 commit 6cd619b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-forks-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/ai": patch
---

ai 的数据库密码先从 install.yaml 中读取,若没配再从 ai 的 config 中读取
4 changes: 2 additions & 2 deletions apps/ai/src/server/config/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { SeedManager } from "@mikro-orm/seeder";
import { entities } from "src/server/entities";
import { migrations } from "src/server/migrations";

// import { envConfig } from "src/server/trpc/route/config";
import { aiConfig } from "./ai";
import { config } from "./env";

const distPath = "src/server";

Expand All @@ -28,7 +28,7 @@ export const ormConfigs = defineConfig({
port: aiConfig.db.port,
user: aiConfig.db.user,
dbName: aiConfig.db.dbName,
password: aiConfig.db.password, // envConfig.DB_PASSWORD ||
password: config.DB_PASSWORD || aiConfig.db.password,
forceUndefined: true,
extensions: [Migrator, SeedManager],
migrations: {
Expand Down

0 comments on commit 6cd619b

Please sign in to comment.