fix(database): add timezone support
This commit is contained in:
parent
ec34c34e31
commit
0270553601
@ -9,4 +9,5 @@ export default {
|
||||
database: process.env.DB_DATABASE,
|
||||
host: process.env.DB_HOST,
|
||||
port: process.env.DB_PORT as any,
|
||||
timezone: process.env.DB_TIMEZONE,
|
||||
} as IDatabaseOptions;
|
||||
|
@ -92,6 +92,10 @@ export class Database extends EventEmitter implements AsyncEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.dialect === 'sqlite') {
|
||||
delete opts.timezone;
|
||||
}
|
||||
|
||||
this.sequelize = new Sequelize(opts);
|
||||
this.options = opts;
|
||||
this.collections = new Map();
|
||||
|
@ -33,6 +33,7 @@ export function getConfigByEnv() {
|
||||
charset: 'utf8mb4',
|
||||
collate: 'utf8mb4_unicode_ci',
|
||||
},
|
||||
timezone: process.env.DB_TIMEZONE,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user