@kipicore/dbcore 1.1.250 → 1.1.252

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, Sequelize: any): Promise<void>;
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('clone_lists');
4
+ if (!table.data_clone_academic_calendar_id) {
5
+ await queryInterface.addColumn('clone_lists', 'data_clone_academic_calendar_id', {
6
+ type: Sequelize.UUID,
7
+ allowNull: true,
8
+ field: 'data_clone_academic_calendar_id',
9
+ });
10
+ }
11
+ if (!table.academic_calendar_id) {
12
+ await queryInterface.addColumn('clone_lists', 'academic_calendar_id', {
13
+ type: Sequelize.UUID,
14
+ allowNull: true,
15
+ field: 'academic_calendar_id',
16
+ });
17
+ }
18
+ };
19
+ const down = async (queryInterface, Sequelize) => {
20
+ const table = await queryInterface.describeTable('clone_lists');
21
+ if (table.data_clone_academic_calendar_id) {
22
+ await queryInterface.removeColumn('clone_lists', 'data_clone_academic_calendar_id');
23
+ }
24
+ if (table.academic_calendar_id) {
25
+ await queryInterface.removeColumn('clone_lists', 'academic_calendar_id');
26
+ }
27
+ };
28
+ module.exports = {
29
+ up,
30
+ down,
31
+ };
@@ -3,6 +3,8 @@ export interface ICloneListModelAttributes extends IDefaultAttributes {
3
3
  id: string;
4
4
  title: string;
5
5
  instituteId: string;
6
+ academicCalendarId: string;
7
+ dataCloneAcademicCalendarId: string;
6
8
  isClone: boolean;
7
9
  isDefault: boolean;
8
10
  }
@@ -6,6 +6,8 @@ export declare class CloneListModel extends Model<ICloneListModelAttributes, TCl
6
6
  title: string;
7
7
  isClone: boolean;
8
8
  isDefault: boolean;
9
+ dataCloneAcademicCalendarId: string;
10
+ academicCalendarId: string;
9
11
  instituteId: string;
10
12
  static associate(models: any): void;
11
13
  }
@@ -61,6 +61,16 @@ CloneListModel.init({
61
61
  allowNull: true,
62
62
  field: 'is_clone',
63
63
  },
64
+ dataCloneAcademicCalendarId: {
65
+ type: sequelize_1.DataTypes.UUID,
66
+ allowNull: true,
67
+ field: 'data_clone_academic_calendar_id'
68
+ },
69
+ academicCalendarId: {
70
+ type: sequelize_1.DataTypes.UUID,
71
+ allowNull: true,
72
+ field: 'academic_calendar_id'
73
+ },
64
74
  isDefault: {
65
75
  type: sequelize_1.DataTypes.BOOLEAN,
66
76
  allowNull: true,
@@ -62,14 +62,14 @@ class UserHasPenaltyModel extends sequelize_1.Model {
62
62
  name: 'userId',
63
63
  field: 'user_id',
64
64
  },
65
- as: 'userHPenaltyOfUser',
65
+ as: 'userHasPenaltyOfUser',
66
66
  });
67
67
  UserModel.hasMany(UserHasPenaltyModel, {
68
68
  foreignKey: {
69
69
  name: 'userId',
70
70
  field: 'user_id',
71
71
  },
72
- as: 'userHPenaltyUser',
72
+ as: 'userHasPenaltyUser',
73
73
  });
74
74
  UserHasPenaltyModel.belongsTo(StudentFeeCollectionModel, {
75
75
  foreignKey: {
@@ -83,7 +83,7 @@ class UserHasPenaltyModel extends sequelize_1.Model {
83
83
  name: 'studentFeeCollectionId',
84
84
  field: 'student_fee_collection_id',
85
85
  },
86
- as: 'studentFeeUHPenalty',
86
+ as: 'studentFeeHasPenalty',
87
87
  });
88
88
  UserHasPenaltyModel.belongsTo(PenaltiesModel, {
89
89
  foreignKey: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.250",
3
+ "version": "1.1.252",
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",