2019-02-07 23:21:23 +08:00
|
|
|
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 {
|
2019-02-07 23:44:51 +08:00
|
|
|
return Config.Server.database.type === DatabaseType.mysql ? 'utf8' : null;
|
2019-02-07 23:21:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public get collation(): string {
|
2019-02-07 23:44:51 +08:00
|
|
|
return Config.Server.database.type === DatabaseType.mysql ? 'utf8_bin' : null;
|
2019-02-07 23:21:23 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const columnCharsetCS = new ColumnCharsetCS();
|