@nocobase/data-source-manager 2.1.36 → 2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,6 +34,7 @@ var import_database_introspector = require("./database-introspector/database-int
|
|
|
34
34
|
var import_postgres_introspector = require("./database-introspector/postgres-introspector");
|
|
35
35
|
var import_mariadb_introspector = require("./database-introspector/mariadb-introspector");
|
|
36
36
|
var import_data_source = require("./data-source");
|
|
37
|
+
const PRESERVED_LOGICAL_FIELD_TYPES_ON_SYNC = ["formula"];
|
|
37
38
|
const _DatabaseDataSource = class _DatabaseDataSource extends import_data_source.DataSource {
|
|
38
39
|
createDatabaseIntrospector(db) {
|
|
39
40
|
if (db.isPostgresCompatibleDialect()) {
|
|
@@ -104,7 +105,8 @@ const _DatabaseDataSource = class _DatabaseDataSource extends import_data_source
|
|
|
104
105
|
const incomingPossibleTypes = Array.isArray(fieldOptions.possibleTypes) ? fieldOptions.possibleTypes : fieldOptions.type ? [fieldOptions.type] : [];
|
|
105
106
|
const hasCompatibleStorageType = this.hasCompatibleStorageType(fieldOptions.type, modelOptions.type);
|
|
106
107
|
const shouldUseIncomingType = Boolean(fieldOptions.rawType) && Boolean(modelOptions.rawType || modelOptions.type) && (modelOptions.rawType ? fieldOptions.rawType !== modelOptions.rawType && !hasCompatibleStorageType : !incomingPossibleTypes.includes(modelOptions.type) && !hasCompatibleStorageType);
|
|
107
|
-
|
|
108
|
+
const shouldPreserveLogicalType = PRESERVED_LOGICAL_FIELD_TYPES_ON_SYNC.includes(modelOptions.type);
|
|
109
|
+
if (shouldUseIncomingType && !shouldPreserveLogicalType) {
|
|
108
110
|
newOptions.type = fieldOptions.type;
|
|
109
111
|
newOptions.interface = fieldOptions.interface;
|
|
110
112
|
newOptions.rawType = fieldOptions.rawType;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/data-source-manager",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.37",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "2.1.
|
|
10
|
-
"@nocobase/cache": "2.1.
|
|
11
|
-
"@nocobase/database": "2.1.
|
|
12
|
-
"@nocobase/resourcer": "2.1.
|
|
13
|
-
"@nocobase/utils": "2.1.
|
|
9
|
+
"@nocobase/actions": "2.1.37",
|
|
10
|
+
"@nocobase/cache": "2.1.37",
|
|
11
|
+
"@nocobase/database": "2.1.37",
|
|
12
|
+
"@nocobase/resourcer": "2.1.37",
|
|
13
|
+
"@nocobase/utils": "2.1.37",
|
|
14
14
|
"@types/jsonwebtoken": "^8.5.8",
|
|
15
15
|
"jsonwebtoken": "^9.0.2"
|
|
16
16
|
},
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
20
20
|
"directory": "packages/auth"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "a0c3201363ae028058845af0176ee902a9eeb3e1"
|
|
23
23
|
}
|