fix: support mysql lower_case_table_names=1
This commit is contained in:
parent
94e38e453a
commit
9d1b10d635
@ -30,6 +30,7 @@ DB_TABLE_PREFIX=
|
|||||||
# DB_USER=nocobase
|
# DB_USER=nocobase
|
||||||
# DB_PASSWORD=nocobase
|
# DB_PASSWORD=nocobase
|
||||||
# DB_LOGGING=on
|
# DB_LOGGING=on
|
||||||
|
# DB_UNDERSCORED=true
|
||||||
|
|
||||||
################# CACHE #################
|
################# CACHE #################
|
||||||
# default is memory cache, when develop mode,code's change will be clear memory cache, so can use 'cache-manager-fs-hash'
|
# default is memory cache, when develop mode,code's change will be clear memory cache, so can use 'cache-manager-fs-hash'
|
||||||
|
@ -482,8 +482,8 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
|
|||||||
|
|
||||||
if (this.db.inDialect('mysql')) {
|
if (this.db.inDialect('mysql')) {
|
||||||
const result = await this.db.sequelize.query(`SHOW VARIABLES LIKE 'lower_case_table_names'`, { plain: true });
|
const result = await this.db.sequelize.query(`SHOW VARIABLES LIKE 'lower_case_table_names'`, { plain: true });
|
||||||
if (result?.Value === '1') {
|
if (result?.Value === '1' && !this.db.options.underscored) {
|
||||||
console.log(chalk.red(`mysql variable 'lower_case_table_names' must be set to '0' or '2'`));
|
console.log(`Your database lower_case_table_names=1, please add ${chalk.yellow('DB_UNDERSCORED=true')} to the .env file`);
|
||||||
if (options?.exit) {
|
if (options?.exit) {
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user