1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/sql/enitites/EntityUtils.ts
Patrik J. Braun f8a361cb9e implementing video converting task
note: braking changes in database and config file
2019-12-09 14:05:06 +01:00

18 lines
570 B
TypeScript

import {Config} from '../../../../common/config/private/Config';
import {DatabaseType} from '../../../../common/config/private/IPrivateConfig';
import {ColumnOptions} from 'typeorm/decorator/options/ColumnOptions';
export class ColumnCharsetCS implements ColumnOptions {
public get charset(): string {
return Config.Server.Database.type === DatabaseType.mysql ? 'utf8' : null;
}
public get collation(): string {
return Config.Server.Database.type === DatabaseType.mysql ? 'utf8_bin' : null;
}
}
export const columnCharsetCS = new ColumnCharsetCS();