@kipicore/dbcore 1.1.241 → 1.1.242
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/20260202133702-academic-calenadr-and-entitwise-calendaer-remove-parent-id.d.ts +2 -0
- package/dist/db/psql/migrations/20260202133702-academic-calenadr-and-entitwise-calendaer-remove-parent-id.js +17 -0
- package/dist/interfaces/academicCalendarInterface.d.ts +0 -1
- package/dist/interfaces/entityWiseCalendarInterface.d.ts +0 -1
- package/dist/models/psql/academicCalendarModel.d.ts +0 -1
- package/dist/models/psql/academicCalendarModel.js +0 -14
- package/dist/models/psql/entityWiseCalendarModel.d.ts +0 -1
- package/dist/models/psql/entityWiseCalendarModel.js +0 -14
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/** @type {import('sequelize-cli').Migration} */
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface) {
|
|
5
|
+
const academic_calendars = await queryInterface.describeTable('academic_calendars');
|
|
6
|
+
if (academic_calendars.parent_id) {
|
|
7
|
+
await queryInterface.removeColumn('academic_calendars', 'parent_id');
|
|
8
|
+
}
|
|
9
|
+
const entity_wise_calendar = await queryInterface.describeTable('entity_wise_calendar');
|
|
10
|
+
if (entity_wise_calendar.parent_id) {
|
|
11
|
+
await queryInterface.removeColumn('entity_wise_calendar', 'parent_id');
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
async down() {
|
|
15
|
+
//
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -2,7 +2,6 @@ import { ACADEMIC_CALENDARS_STATUS } from '../constants/app';
|
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IEntityWiseCalendarModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
5
|
-
parentId?: string;
|
|
6
5
|
entityId: string;
|
|
7
6
|
status: ACADEMIC_CALENDARS_STATUS;
|
|
8
7
|
startDate: Date;
|
|
@@ -42,15 +42,6 @@ class AcademicCalendarModel extends sequelize_1.Model {
|
|
|
42
42
|
foreignKey: 'instituteId',
|
|
43
43
|
as: 'instituteHasAcademicCalendars',
|
|
44
44
|
});
|
|
45
|
-
// Self-referencing hierarchy
|
|
46
|
-
AcademicCalendarModel.belongsTo(AcademicCalendarModel, {
|
|
47
|
-
foreignKey: { name: 'parentId', field: 'parent_id' },
|
|
48
|
-
as: 'parentAcademicCalendar',
|
|
49
|
-
});
|
|
50
|
-
AcademicCalendarModel.hasMany(AcademicCalendarModel, {
|
|
51
|
-
foreignKey: { name: 'parentId', field: 'parent_id' },
|
|
52
|
-
as: 'subAcademicCalendarList',
|
|
53
|
-
});
|
|
54
45
|
// Entity relation
|
|
55
46
|
AcademicCalendarModel.belongsTo(InstituteEntityModel, {
|
|
56
47
|
foreignKey: { name: 'entityId', field: 'entity_id' },
|
|
@@ -101,11 +92,6 @@ AcademicCalendarModel.init({
|
|
|
101
92
|
field: 'end_year',
|
|
102
93
|
allowNull: true,
|
|
103
94
|
},
|
|
104
|
-
parentId: {
|
|
105
|
-
type: sequelize_1.DataTypes.UUID,
|
|
106
|
-
field: 'parent_id',
|
|
107
|
-
allowNull: true,
|
|
108
|
-
},
|
|
109
95
|
entityId: {
|
|
110
96
|
type: sequelize_1.DataTypes.UUID,
|
|
111
97
|
field: 'entity_id',
|
|
@@ -4,7 +4,6 @@ import { TEntityWiseCalendarModelCreationAttributes } from '../../types/entityWi
|
|
|
4
4
|
import { ACADEMIC_CALENDARS_STATUS } from '../../constants/app';
|
|
5
5
|
declare class EntityWiseCalendarModel extends Model<IEntityWiseCalendarModelAttributes, TEntityWiseCalendarModelCreationAttributes> {
|
|
6
6
|
id: string;
|
|
7
|
-
parentId?: string;
|
|
8
7
|
entityId: string;
|
|
9
8
|
status: ACADEMIC_CALENDARS_STATUS;
|
|
10
9
|
startDate: Date;
|
|
@@ -18,15 +18,6 @@ class EntityWiseCalendarModel extends sequelize_1.Model {
|
|
|
18
18
|
foreignKey: { name: 'deletedBy', field: 'deleted_by' },
|
|
19
19
|
as: 'deletedByUser',
|
|
20
20
|
});
|
|
21
|
-
// Self-referencing hierarchy
|
|
22
|
-
EntityWiseCalendarModel.belongsTo(EntityWiseCalendarModel, {
|
|
23
|
-
foreignKey: { name: 'parentId', field: 'parent_id' },
|
|
24
|
-
as: 'parentEntityWiseCalendar',
|
|
25
|
-
});
|
|
26
|
-
EntityWiseCalendarModel.hasMany(EntityWiseCalendarModel, {
|
|
27
|
-
foreignKey: { name: 'parentId', field: 'parent_id' },
|
|
28
|
-
as: 'subEntityWiseCalendarList',
|
|
29
|
-
});
|
|
30
21
|
// Entity relation
|
|
31
22
|
EntityWiseCalendarModel.belongsTo(InstituteEntityModel, {
|
|
32
23
|
foreignKey: { name: 'entityId', field: 'entity_id' },
|
|
@@ -45,11 +36,6 @@ EntityWiseCalendarModel.init({
|
|
|
45
36
|
allowNull: false,
|
|
46
37
|
primaryKey: true,
|
|
47
38
|
},
|
|
48
|
-
parentId: {
|
|
49
|
-
type: sequelize_1.DataTypes.UUID,
|
|
50
|
-
field: 'parent_id',
|
|
51
|
-
allowNull: true,
|
|
52
|
-
},
|
|
53
39
|
entityId: {
|
|
54
40
|
type: sequelize_1.DataTypes.UUID,
|
|
55
41
|
field: 'entity_id',
|
package/package.json
CHANGED