diff --git a/e2e-common/test-config.ts b/e2e-common/test-config.ts index 49af2603b7..5b2909321a 100644 --- a/e2e-common/test-config.ts +++ b/e2e-common/test-config.ts @@ -1,11 +1,5 @@ import { mergeConfig } from '@vendure/core'; -import { - MysqlInitializer, - PostgresInitializer, - registerInitializer, - SqljsInitializer, - testConfig as defaultTestConfig, -} from '@vendure/testing'; +import { MysqlInitializer, PostgresInitializer, registerInitializer, SqljsInitializer, testConfig as defaultTestConfig } from '@vendure/testing'; import path from 'path'; import { ConnectionOptions } from 'typeorm'; diff --git a/packages/core/src/entity/register-custom-entity-fields.ts b/packages/core/src/entity/register-custom-entity-fields.ts index c57cb0f87b..335b5f9441 100644 --- a/packages/core/src/entity/register-custom-entity-fields.ts +++ b/packages/core/src/entity/register-custom-entity-fields.ts @@ -69,7 +69,14 @@ function registerCustomFieldsForEntity( } options.length = length; } - if (customField.type === 'datetime' && options.precision == null) { + if ( + customField.type === 'datetime' && + options.precision == null && + // Setting precision on an sqlite datetime will cause + // spurious migration commands. See https://github.com/typeorm/typeorm/issues/2333 + dbEngine !== 'sqljs' && + dbEngine !== 'sqlite' + ) { options.precision = 6; } Column(options)(new ctor(), name);