@abtnode/models 1.16.29-next-680cf137 → 1.16.29

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.
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.down = exports.up = void 0;
4
+ const sequelize_1 = require("sequelize");
5
+ const up = async ({ context }) => {
6
+ try {
7
+ const queryInterface = context;
8
+ const tableDescriptions = await queryInterface.describeTable('projects');
9
+ if (!tableDescriptions?.autoUpload) {
10
+ await queryInterface.addColumn('projects', 'autoUpload', {
11
+ type: sequelize_1.DataTypes.BOOLEAN,
12
+ allowNull: false,
13
+ defaultValue: false,
14
+ });
15
+ }
16
+ if (!tableDescriptions?.possibleSameStore) {
17
+ await queryInterface.addColumn('projects', 'possibleSameStore', {
18
+ type: sequelize_1.DataTypes.BOOLEAN,
19
+ allowNull: false,
20
+ defaultValue: false,
21
+ });
22
+ }
23
+ }
24
+ catch (err) {
25
+ if (process.env.NODE_ENV === 'test' && err.message.startsWith('SQLITE_ERROR: duplicate column name')) {
26
+ // ignore
27
+ return;
28
+ }
29
+ throw err;
30
+ }
31
+ };
32
+ exports.up = up;
33
+ const down = async ({ context }) => {
34
+ await context.removeColumn('projects', 'autoUpload');
35
+ await context.removeColumn('projects', 'possibleSameStore');
36
+ };
37
+ exports.down = down;
@@ -28,6 +28,8 @@ export type ProjectState = {
28
28
  tenantScope?: string;
29
29
  createdBy?: string;
30
30
  messageId?: string;
31
+ autoUpload?: boolean;
32
+ possibleSameStore?: boolean;
31
33
  };
32
34
  export declare function createProjectModel(): DynamicModel<ProjectState>;
33
35
  export {};
@@ -30,6 +30,16 @@ function createProjectModel() {
30
30
  type: sequelize_1.DataTypes.STRING(40),
31
31
  allowNull: true,
32
32
  },
33
+ autoUpload: {
34
+ type: sequelize_1.DataTypes.BOOLEAN,
35
+ defaultValue: false,
36
+ allowNull: false,
37
+ },
38
+ possibleSameStore: {
39
+ type: sequelize_1.DataTypes.BOOLEAN,
40
+ defaultValue: false,
41
+ allowNull: false,
42
+ },
33
43
  }, {
34
44
  sequelize,
35
45
  modelName: 'Project',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/models",
3
- "version": "1.16.29-next-680cf137",
3
+ "version": "1.16.29",
4
4
  "description": "Sequelize models for blocklet server and blocklet service",
5
5
  "homepage": "https://github.com/ArcBlock/blocklet-server#readme",
6
6
  "publishConfig": {
@@ -33,8 +33,8 @@
33
33
  "url": "https://github.com/ArcBlock/blocklet-server/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@abtnode/logger": "1.16.29-next-680cf137",
37
- "@abtnode/types": "1.16.29-next-680cf137",
36
+ "@abtnode/logger": "1.16.29",
37
+ "@abtnode/types": "1.16.29",
38
38
  "lodash.clonedeep": "^4.5.0",
39
39
  "lodash.isempty": "^4.4.0",
40
40
  "sequelize": "^6.35.0",
@@ -54,5 +54,5 @@
54
54
  "typescript": "^5.0.4"
55
55
  },
56
56
  "resolutions": {},
57
- "gitHead": "17b7e7c5e43c497980d4fe6b5bb20609328041bd"
57
+ "gitHead": "6c49cffcab4fd0dffc6bed261a5eddf733280ae7"
58
58
  }