@nocobase/database 2.2.0-beta.8 → 2.3.0-alpha.1

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.
@@ -67,6 +67,11 @@ const _BelongsToManyField = class _BelongsToManyField extends import_relation_fi
67
67
  checkAssociationKeys(database) {
68
68
  let { foreignKey, sourceKey, otherKey, targetKey } = this.options;
69
69
  const through = this.through;
70
+ if (through === this.target) {
71
+ throw new Error(
72
+ `BelongsToMany relation "${this.name}" cannot use target collection "${this.target}" as through collection`
73
+ );
74
+ }
70
75
  const throughCollection = database.getCollection(through);
71
76
  if (!throughCollection) {
72
77
  return;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "2.2.0-beta.8",
3
+ "version": "2.3.0-alpha.1",
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": "2.2.0-beta.8",
10
- "@nocobase/utils": "2.2.0-beta.8",
9
+ "@nocobase/logger": "2.3.0-alpha.1",
10
+ "@nocobase/utils": "2.3.0-alpha.1",
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": "fa2502c1e9faf6d74b3f51b42dbc6546638d46af"
41
+ "gitHead": "2377df8ceb12549149017f7f14a61207bf6e49a2"
42
42
  }