@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.
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -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,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.343",
3
+ "version": "1.1.345",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",