You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-12-22 00:27:39 +02:00
changing mysql collate and charset to be case insensitive
This commit is contained in:
17
backend/model/sql/enitites/EntityUtils.ts
Normal file
17
backend/model/sql/enitites/EntityUtils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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 ? 'utf8mb4' : null;
|
||||
}
|
||||
|
||||
public get collation(): string {
|
||||
return Config.Server.database.type === DatabaseType.mysql ? 'utf8mb4_bin' : null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const columnCharsetCS = new ColumnCharsetCS();
|
||||
Reference in New Issue
Block a user