@nocobase/data-source-manager 2.1.0-alpha.20 → 2.1.0-alpha.21

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.
@@ -100,16 +100,18 @@ const _DatabaseDataSource = class _DatabaseDataSource extends import_data_source
100
100
  ...fieldOptions,
101
101
  ...modelOptions
102
102
  };
103
+ const dbSyncedKeys = ["allowNull"];
103
104
  const incomingPossibleTypes = Array.isArray(fieldOptions.possibleTypes) ? fieldOptions.possibleTypes : fieldOptions.type ? [fieldOptions.type] : [];
104
105
  const hasCompatibleStorageType = this.hasCompatibleStorageType(fieldOptions.type, modelOptions.type);
105
- const shouldUseIncomingType = Boolean(fieldOptions.rawType) && (modelOptions.rawType ? fieldOptions.rawType !== modelOptions.rawType && !hasCompatibleStorageType : !incomingPossibleTypes.includes(modelOptions.type) && !hasCompatibleStorageType);
106
+ const shouldUseIncomingType = Boolean(fieldOptions.rawType) && Boolean(modelOptions.rawType || modelOptions.type) && (modelOptions.rawType ? fieldOptions.rawType !== modelOptions.rawType && !hasCompatibleStorageType : !incomingPossibleTypes.includes(modelOptions.type) && !hasCompatibleStorageType);
106
107
  if (shouldUseIncomingType) {
107
108
  newOptions.type = fieldOptions.type;
108
109
  newOptions.interface = fieldOptions.interface;
109
110
  newOptions.rawType = fieldOptions.rawType;
110
111
  }
111
112
  for (const key of [.../* @__PURE__ */ new Set([...Object.keys(modelOptions), ...Object.keys(fieldOptions)])]) {
112
- if (modelOptions[key] === null && fieldOptions[key]) {
113
+ const shouldUseIncoming = dbSyncedKeys.includes(key) || modelOptions[key] === null && key in fieldOptions;
114
+ if (shouldUseIncoming) {
113
115
  newOptions[key] = fieldOptions[key];
114
116
  }
115
117
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/data-source-manager",
3
- "version": "2.1.0-alpha.20",
3
+ "version": "2.1.0-alpha.21",
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.0-alpha.20",
10
- "@nocobase/cache": "2.1.0-alpha.20",
11
- "@nocobase/database": "2.1.0-alpha.20",
12
- "@nocobase/resourcer": "2.1.0-alpha.20",
13
- "@nocobase/utils": "2.1.0-alpha.20",
9
+ "@nocobase/actions": "2.1.0-alpha.21",
10
+ "@nocobase/cache": "2.1.0-alpha.21",
11
+ "@nocobase/database": "2.1.0-alpha.21",
12
+ "@nocobase/resourcer": "2.1.0-alpha.21",
13
+ "@nocobase/utils": "2.1.0-alpha.21",
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": "3d1535db6bf93ca23257faf474afee0d565f54c6"
22
+ "gitHead": "b4c2b469f321ecaec7863a8ae371a02fe6a35aa2"
23
23
  }