@abtnode/models 1.16.29 → 1.16.30-beta-958ae719

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,20 @@
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 models_1 = require("../../models");
6
+ const up = async ({ context }) => {
7
+ if (!(await (0, models_1.existsColumn)(context, 'users', 'phone'))) {
8
+ await context.addColumn('users', 'phone', {
9
+ type: sequelize_1.DataTypes.STRING(36),
10
+ allowNull: true,
11
+ });
12
+ }
13
+ };
14
+ exports.up = up;
15
+ const down = async ({ context }) => {
16
+ if (await (0, models_1.existsColumn)(context, 'users', 'phone')) {
17
+ await context.removeColumn('users', 'phone');
18
+ }
19
+ };
20
+ exports.down = down;
@@ -0,0 +1,20 @@
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 models_1 = require("../../models");
6
+ const up = async ({ context }) => {
7
+ if (!(await (0, models_1.existsColumn)(context, 'users', 'phone'))) {
8
+ await context.addColumn('users', 'phone', {
9
+ type: sequelize_1.DataTypes.STRING(36),
10
+ allowNull: true,
11
+ });
12
+ }
13
+ };
14
+ exports.up = up;
15
+ const down = async ({ context }) => {
16
+ if (await (0, models_1.existsColumn)(context, 'users', 'phone')) {
17
+ await context.removeColumn('users', 'phone');
18
+ }
19
+ };
20
+ exports.down = down;
@@ -21,6 +21,10 @@ function createUserModel() {
21
21
  allowNull: true,
22
22
  defaultValue: '',
23
23
  },
24
+ phone: {
25
+ type: sequelize_1.DataTypes.STRING(36),
26
+ allowNull: true,
27
+ },
24
28
  }, {
25
29
  sequelize,
26
30
  modelName: 'User',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/models",
3
- "version": "1.16.29",
3
+ "version": "1.16.30-beta-958ae719",
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",
37
- "@abtnode/types": "1.16.29",
36
+ "@abtnode/logger": "1.16.30-beta-958ae719",
37
+ "@abtnode/types": "1.16.30-beta-958ae719",
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": "6c49cffcab4fd0dffc6bed261a5eddf733280ae7"
57
+ "gitHead": "75590ff3be51e7fe2a070124541aebc203ed16dc"
58
58
  }