@nocobase/database 2.2.0-beta.1 → 2.2.0-beta.11

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.
@@ -37,11 +37,6 @@ export type MigrationRule = 'overwrite' | 'skip' | 'upsert' | 'schema-only' | 'i
37
37
  */
38
38
  export type DataCategory = 'system' | 'business' | 'runtime';
39
39
  export type DataCategories = DataCategory | DataCategory[];
40
- export declare const TAG: {
41
- basic: string;
42
- business: string;
43
- ignoredBackup: string;
44
- };
45
40
  export interface CollectionOptions extends Omit<ModelOptions, 'name' | 'hooks'> {
46
41
  name: string;
47
42
  title?: string;
package/lib/collection.js CHANGED
@@ -45,8 +45,7 @@ var __decorateClass = (decorators, target, key, kind) => {
45
45
  };
46
46
  var collection_exports = {};
47
47
  __export(collection_exports, {
48
- Collection: () => Collection,
49
- TAG: () => TAG
48
+ Collection: () => Collection
50
49
  });
51
50
  module.exports = __toCommonJS(collection_exports);
52
51
  var import_deepmerge = __toESM(require("deepmerge"));
@@ -90,11 +89,6 @@ function EnsureAtomicity(target, propertyKey, descriptor) {
90
89
  return descriptor;
91
90
  }
92
91
  __name(EnsureAtomicity, "EnsureAtomicity");
93
- const TAG = {
94
- basic: "basic",
95
- business: "business",
96
- ignoredBackup: "ignored:backup"
97
- };
98
92
  const _Collection = class _Collection extends import_events.EventEmitter {
99
93
  options;
100
94
  context;
@@ -826,6 +820,5 @@ __decorateClass([
826
820
  let Collection = _Collection;
827
821
  // Annotate the CommonJS export names for ESM import in node:
828
822
  0 && (module.exports = {
829
- Collection,
830
- TAG
823
+ Collection
831
824
  });
@@ -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.1",
3
+ "version": "2.2.0-beta.11",
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.1",
10
- "@nocobase/utils": "2.2.0-beta.1",
9
+ "@nocobase/logger": "2.2.0-beta.11",
10
+ "@nocobase/utils": "2.2.0-beta.11",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -28,7 +28,7 @@
28
28
  "semver": "^7.7.1",
29
29
  "sequelize": "^6.26.0",
30
30
  "umzug": "^3.1.1",
31
- "uuid": "^9.0.1"
31
+ "uuid": "^11.1.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/glob": "^7.2.0"
@@ -38,5 +38,5 @@
38
38
  "url": "git+https://github.com/nocobase/nocobase.git",
39
39
  "directory": "packages/database"
40
40
  },
41
- "gitHead": "f82fa9d0c3aa8e00e53dd94e404a312483b4866b"
41
+ "gitHead": "8dab25af2bb83a81da68158d0dcf836f96103d61"
42
42
  }