@kipicore/dbcore 1.1.343 → 1.1.345
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.
- package/dist/db/psql/migrations/20260324121350-add-file-path-file-storage-model.d.ts +2 -0
- package/dist/db/psql/migrations/20260324121350-add-file-path-file-storage-model.js +21 -0
- package/dist/db/psql/migrations/20260324121845-add-file-path-file-storage-model.d.ts +2 -0
- package/dist/db/psql/migrations/20260324121845-add-file-path-file-storage-model.js +25 -0
- package/dist/models/psql/fileStorageModel.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('file_storage');
|
|
4
|
+
if (!table.file_path) {
|
|
5
|
+
await queryInterface.addColumn('file_storage', 'file_path', {
|
|
6
|
+
type: Sequelize.STRING,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'file_path',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const down = async (queryInterface) => {
|
|
13
|
+
const table = await queryInterface.describeTable('file_storage');
|
|
14
|
+
if (table.file_path) {
|
|
15
|
+
await queryInterface.removeColumn('file_storage', 'file_path');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
module.exports = {
|
|
19
|
+
up,
|
|
20
|
+
down,
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('file_storage');
|
|
4
|
+
if (table.file_path) {
|
|
5
|
+
await queryInterface.changeColumn('file_storage', 'file_path', {
|
|
6
|
+
type: Sequelize.TEXT,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'file_path',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const down = async (queryInterface, Sequelize) => {
|
|
13
|
+
const table = await queryInterface.describeTable('file_storage');
|
|
14
|
+
if (table.file_path) {
|
|
15
|
+
await queryInterface.changeColumn('file_storage', 'file_path', {
|
|
16
|
+
type: Sequelize.STRING,
|
|
17
|
+
allowNull: true,
|
|
18
|
+
field: 'file_path',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
module.exports = {
|
|
23
|
+
up,
|
|
24
|
+
down,
|
|
25
|
+
};
|
|
@@ -101,6 +101,11 @@ FileStorageModel.init({
|
|
|
101
101
|
field: 'expired_at',
|
|
102
102
|
allowNull: true,
|
|
103
103
|
},
|
|
104
|
+
filePath: {
|
|
105
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
106
|
+
field: 'file_path',
|
|
107
|
+
allowNull: true,
|
|
108
|
+
},
|
|
104
109
|
}, {
|
|
105
110
|
modelName: 'FileStorageModel',
|
|
106
111
|
tableName: 'file_storage',
|
package/package.json
CHANGED