@abtnode/models 1.16.41 → 1.16.42-beta-20250403-230303-c167c6a1
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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.down = exports.up = void 0;
|
|
5
|
+
const sequelize_1 = require("sequelize");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const createNotificationMigration = () => ({
|
|
8
|
+
up: async ({ context }) => {
|
|
9
|
+
const transaction = await context.sequelize.transaction();
|
|
10
|
+
try {
|
|
11
|
+
if (!(await (0, models_1.existsColumn)(context, 'messages', 'expiredAt'))) {
|
|
12
|
+
await context.addColumn('messages', 'expiredAt', {
|
|
13
|
+
type: sequelize_1.DataTypes.DATE,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
}, { transaction });
|
|
16
|
+
await context.addIndex('messages', ['expiredAt'], {
|
|
17
|
+
name: 'messages_expiredAt_index',
|
|
18
|
+
transaction,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
await transaction.commit();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
await transaction.rollback();
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
down: async ({ context }) => {
|
|
29
|
+
const transaction = await context.sequelize.transaction();
|
|
30
|
+
try {
|
|
31
|
+
if (await (0, models_1.existsColumn)(context, 'messages', 'expiredAt')) {
|
|
32
|
+
await context.removeColumn('messages', 'expiredAt', { transaction });
|
|
33
|
+
await context.removeIndex('messages', 'messages_expiredAt_index', { transaction });
|
|
34
|
+
}
|
|
35
|
+
await transaction.commit();
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
await transaction.rollback();
|
|
39
|
+
console.error('Migration rollback failed:', error);
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
_a = createNotificationMigration(), exports.up = _a.up, exports.down = _a.down;
|
package/lib/models/message.d.ts
CHANGED
package/lib/models/message.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/models",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.42-beta-20250403-230303-c167c6a1",
|
|
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,9 +33,9 @@
|
|
|
33
33
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@abtnode/constant": "1.16.
|
|
37
|
-
"@abtnode/logger": "1.16.
|
|
38
|
-
"@abtnode/types": "1.16.
|
|
36
|
+
"@abtnode/constant": "1.16.42-beta-20250403-230303-c167c6a1",
|
|
37
|
+
"@abtnode/logger": "1.16.42-beta-20250403-230303-c167c6a1",
|
|
38
|
+
"@abtnode/types": "1.16.42-beta-20250403-230303-c167c6a1",
|
|
39
39
|
"lodash.clonedeep": "^4.5.0",
|
|
40
40
|
"lodash.isempty": "^4.4.0",
|
|
41
41
|
"sequelize": "^6.35.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"typescript": "^5.6.3"
|
|
56
56
|
},
|
|
57
57
|
"resolutions": {},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "34d6d981bb270af1d0ca59704715bfa82949a9fe"
|
|
59
59
|
}
|