@abtnode/models 1.16.25 → 1.16.26-beta-e0056285

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,28 @@
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('releases');
9
+ if (!tableDescriptions?.publishedStoreIds) {
10
+ await queryInterface.addColumn('releases', 'publishedStoreIds', {
11
+ type: sequelize_1.DataTypes.JSON(),
12
+ defaultValue: [],
13
+ });
14
+ }
15
+ }
16
+ catch (err) {
17
+ if (process.env.NODE_ENV === 'test' && err.message.startsWith('SQLITE_ERROR: duplicate column name')) {
18
+ // ignore
19
+ return;
20
+ }
21
+ throw err;
22
+ }
23
+ };
24
+ exports.up = up;
25
+ const down = async ({ context }) => {
26
+ await context.removeColumn('releases', 'publishedStoreIds');
27
+ };
28
+ exports.down = down;
@@ -18,6 +18,7 @@ export type ReleaseState = {
18
18
  createdAt: Date;
19
19
  updatedAt: Date;
20
20
  status: ReleaseStatus;
21
+ publishedStoreIds?: string[];
21
22
  };
22
23
  export declare function createReleaseModel(): DynamicModel<ReleaseState>;
23
24
  export {};
@@ -9,6 +9,9 @@ function createReleaseModel() {
9
9
  static initialize(sequelize) {
10
10
  this.init({
11
11
  ...this.GENESIS_ATTRIBUTES,
12
+ publishedStoreIds: {
13
+ type: sequelize_1.DataTypes.JSON,
14
+ },
12
15
  }, {
13
16
  sequelize,
14
17
  modelName: 'Release',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/models",
3
- "version": "1.16.25",
3
+ "version": "1.16.26-beta-e0056285",
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.25",
37
- "@abtnode/types": "1.16.25",
36
+ "@abtnode/logger": "1.16.26-beta-e0056285",
37
+ "@abtnode/types": "1.16.26-beta-e0056285",
38
38
  "lodash.clonedeep": "^4.5.0",
39
39
  "lodash.isempty": "^4.4.0",
40
40
  "sequelize": "^6.35.0",
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@arcblock/eslint-config-ts": "^0.3.0",
47
47
  "@types/jest": "^29.5.11",
48
- "@types/node": "^18.11.0",
48
+ "@types/node": "^20.12.2",
49
49
  "@typescript-eslint/eslint-plugin": "^5.40.1",
50
50
  "@typescript-eslint/parser": "^5.40.1",
51
51
  "jest": "^29.7.0",
@@ -53,5 +53,5 @@
53
53
  "typescript": "^5.0.4"
54
54
  },
55
55
  "resolutions": {},
56
- "gitHead": "8752b9a0caa8745e16e1de8db4ef696b713ffb4d"
56
+ "gitHead": "a79b8637ad50d136e7c5d91bfb41dc7a7c337485"
57
57
  }