mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
make sure it is really relative path, even when started from root folder
This commit is contained in:
parent
1b10ce7f09
commit
3dda798ad1
@ -3,6 +3,7 @@
|
||||
import { entities } from 'database'
|
||||
import { Connection as DbConnection, FileLogger, createConnection } from 'typeorm'
|
||||
|
||||
import path from 'node:path'
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
export class Connection {
|
||||
@ -38,7 +39,7 @@ export class Connection {
|
||||
synchronize: false,
|
||||
logging: true,
|
||||
logger: new FileLogger('all', {
|
||||
logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH,
|
||||
logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH),
|
||||
}),
|
||||
extra: {
|
||||
charset: 'utf8mb4_unicode_ci',
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import path from 'node:path'
|
||||
import { CONFIG } from '@/config'
|
||||
// TODO This is super weird - since the entities are defined in another project they have their own globals.
|
||||
// We cannot use our connection here, but must use the external typeorm installation
|
||||
import { entities } from 'database'
|
||||
import { Connection, FileLogger, createConnection } from 'typeorm'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
export const connection = async (): Promise<Connection | null> => {
|
||||
try {
|
||||
return createConnection({
|
||||
@ -19,7 +19,7 @@ export const connection = async (): Promise<Connection | null> => {
|
||||
synchronize: false,
|
||||
logging: true,
|
||||
logger: new FileLogger('all', {
|
||||
logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH,
|
||||
logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH),
|
||||
}),
|
||||
extra: {
|
||||
charset: 'utf8mb4_unicode_ci',
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import path from 'node:path'
|
||||
import { CONFIG } from '@/config'
|
||||
// TODO This is super weird - since the entities are defined in another project they have their own globals.
|
||||
// We cannot use our connection here, but must use the external typeorm installation
|
||||
@ -18,7 +19,7 @@ const connection = async (): Promise<Connection | null> => {
|
||||
synchronize: false,
|
||||
logging: true,
|
||||
logger: new FileLogger('all', {
|
||||
logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH,
|
||||
logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH),
|
||||
}),
|
||||
extra: {
|
||||
charset: 'utf8mb4_unicode_ci',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user