@kipicore/dbcore 1.1.465 → 1.1.466

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,22 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('permissions');
4
+ if (!table.sequence_number) {
5
+ await queryInterface.addColumn('permissions', 'sequence_number', {
6
+ type: Sequelize.INTEGER,
7
+ allowNull: true,
8
+ field: 'sequence_number',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface) => {
13
+ const table = await queryInterface.describeTable('permissions');
14
+ // Remove only if column exists
15
+ if (table.sequence_number) {
16
+ await queryInterface.removeColumn('permissions', 'sequence_number');
17
+ }
18
+ };
19
+ module.exports = {
20
+ up,
21
+ down,
22
+ };
@@ -9,6 +9,7 @@ export interface IPermissionAttributes extends IDefaultAttributes {
9
9
  code: string;
10
10
  appType: APP_TYPE;
11
11
  userTypes: USER_TYPES[];
12
+ sequenceNumber: number;
12
13
  }
13
14
  export interface IPermissionTree extends IPermissionAttributes {
14
15
  features?: IPermissionTree[];
@@ -11,6 +11,7 @@ declare class PermissionModel extends Model<IPermissionAttributes, TPermissionCr
11
11
  code: string;
12
12
  appType: string;
13
13
  userTypes: USER_TYPES[];
14
+ sequenceNumber: number;
14
15
  createdBy: string;
15
16
  updatedBy: string;
16
17
  deletedBy: string;
@@ -66,6 +66,9 @@ PermissionModel.init({
66
66
  code: {
67
67
  type: sequelize_1.DataTypes.STRING,
68
68
  },
69
+ sequenceNumber: {
70
+ type: sequelize_1.DataTypes.INTEGER,
71
+ },
69
72
  userTypes: {
70
73
  type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
71
74
  defaultValue: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.465",
3
+ "version": "1.1.466",
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",