mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-05-29 23:07:34 +02:00
18 lines
596 B
TypeScript
18 lines
596 B
TypeScript
import {Config} from '../../../../common/config/private/Config';
|
|
import {ServerConfig} 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 === ServerConfig.DatabaseType.mysql ? 'utf8' : null;
|
|
}
|
|
|
|
public get collation(): string {
|
|
return Config.Server.Database.type === ServerConfig.DatabaseType.mysql ? 'utf8_bin' : null;
|
|
|
|
}
|
|
}
|
|
|
|
export const columnCharsetCS = new ColumnCharsetCS();
|