From 1a5d1f1ebf166466832ebb82bf9c0954a4fa5b03 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 1 Jun 2022 12:25:21 +0800 Subject: [PATCH] fix: default value of time zone --- packages/core/cli/bin/index.js | 1 + packages/core/database/src/database.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/core/cli/bin/index.js b/packages/core/cli/bin/index.js index 032e1c0c5..94b39fd6a 100755 --- a/packages/core/cli/bin/index.js +++ b/packages/core/cli/bin/index.js @@ -11,6 +11,7 @@ const env = { API_BASE_PATH: '/api/', DB_DIALECT: 'sqlite', DB_STORAGE: 'storage/db/nocobase.sqlite', + DB_TIMEZONE: '+00:00', DEFAULT_STORAGE_TYPE: 'local', LOCAL_STORAGE_DEST: 'storage/uploads', }; diff --git a/packages/core/database/src/database.ts b/packages/core/database/src/database.ts index 233c2e8df..dec73f699 100644 --- a/packages/core/database/src/database.ts +++ b/packages/core/database/src/database.ts @@ -94,6 +94,8 @@ export class Database extends EventEmitter implements AsyncEmitter { if (options.dialect === 'sqlite') { delete opts.timezone; + } else if (!opts.timezone) { + opts.timezone = '+00:00'; } this.sequelize = new Sequelize(opts);