mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
use 127.0.0.1 instead if localhost as default host for db
This commit is contained in:
parent
d0a7becc1f
commit
159d63b620
@ -113,8 +113,7 @@ export class AppDatabase {
|
||||
database: CONFIG.DB_DATABASE,
|
||||
port: CONFIG.DB_PORT,
|
||||
})
|
||||
// this.drizzleDataSource = drizzle({ client: this.drizzleConnection })
|
||||
this.drizzleDataSource = drizzle('mysql2://root@127.0.0.1:3306/gradido_test')
|
||||
this.drizzleDataSource = drizzle({ client: this.drizzleConnection })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ const database = {
|
||||
DB_CONNECT_RETRY_DELAY_MS: process.env.DB_CONNECT_RETRY_DELAY_MS
|
||||
? Number.parseInt(process.env.DB_CONNECT_RETRY_DELAY_MS)
|
||||
: 500,
|
||||
DB_HOST: process.env.DB_HOST ?? 'localhost',
|
||||
DB_HOST: process.env.DB_HOST ?? '127.0.0.1',
|
||||
DB_PORT: process.env.DB_PORT ? Number.parseInt(process.env.DB_PORT) : 3306,
|
||||
DB_USER: process.env.DB_USER ?? 'root',
|
||||
DB_PASSWORD: process.env.DB_PASSWORD ?? '',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { drizzle, MySql2Database } from 'drizzle-orm/mysql2'
|
||||
import { MySql2Database } from 'drizzle-orm/mysql2'
|
||||
import { AppDatabase, drizzleDb } from '../AppDatabase'
|
||||
import { openaiThreadsTable } from '../schemas'
|
||||
import {
|
||||
@ -15,11 +15,7 @@ let db: MySql2Database
|
||||
beforeAll(async () => {
|
||||
await appDB.init()
|
||||
db = drizzleDb()
|
||||
try {
|
||||
await db.delete(openaiThreadsTable)
|
||||
} catch(e) {
|
||||
console.error(JSON.stringify(e, null, 2))
|
||||
}
|
||||
await db.delete(openaiThreadsTable)
|
||||
})
|
||||
afterAll(async () => {
|
||||
await appDB.destroy()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user