@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.
- package/dist/db/psql/migrations/20260423113851-update_sr_number.d.ts +2 -0
- package/dist/db/psql/migrations/20260423113851-update_sr_number.js +22 -0
- package/dist/interfaces/permissionsInterface.d.ts +1 -0
- package/dist/models/psql/permissionsModel.d.ts +1 -0
- package/dist/models/psql/permissionsModel.js +3 -0
- package/package.json +1 -1
|
@@ -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[];
|
package/package.json
CHANGED