@nocobase/database 3.0.0-alpha.7 → 3.0.0-alpha.9

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.
package/lib/database.js CHANGED
@@ -354,7 +354,7 @@ const _Database = class _Database extends import_events.EventEmitter {
354
354
  if (index.fields) {
355
355
  index.fields = index.fields.map((field) => {
356
356
  if (field.name) {
357
- return { name: (0, import_utils3.snakeCase)(field.name), ...field };
357
+ return { ...field, name: (0, import_utils3.snakeCase)(field.name) };
358
358
  }
359
359
  return (0, import_utils3.snakeCase)(field);
360
360
  });
@@ -128,6 +128,8 @@ const _BelongsToManyField = class _BelongsToManyField extends import_relation_fi
128
128
  let Through;
129
129
  if (database.hasCollection(through)) {
130
130
  Through = database.getCollection(through);
131
+ Through.options.sourceCollectionName ??= this.collection.name;
132
+ Through.options.targetCollectionName ??= this.target;
131
133
  } else {
132
134
  const throughCollectionOptions = {
133
135
  name: through,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "3.0.0-alpha.7",
3
+ "version": "3.0.0-alpha.9",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "Apache-2.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "3.0.0-alpha.7",
10
- "@nocobase/utils": "3.0.0-alpha.7",
9
+ "@nocobase/logger": "3.0.0-alpha.9",
10
+ "@nocobase/utils": "3.0.0-alpha.9",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -38,5 +38,5 @@
38
38
  "url": "git+https://github.com/nocobase/nocobase.git",
39
39
  "directory": "packages/database"
40
40
  },
41
- "gitHead": "19cd28c710f3b3c614ebe2fd7d5a415d527ee559"
41
+ "gitHead": "82aaad40c5be1120839a11301a48e7fe690f48c3"
42
42
  }