@kipicore/dbcore 1.1.196 → 1.1.197
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/{20260105084623-penalty.js → 20260105084623-penalties.js} +2 -2
- package/dist/db/psql/migrations/{20260105092543-userHasPenalty.js → 20260105092543-userHasPenalties.js} +2 -2
- package/dist/models/psql/penaltyModel.js +2 -2
- package/dist/models/psql/userHasPenaltyModel.js +4 -4
- package/package.json +1 -1
- /package/dist/db/psql/migrations/{20260105084623-penalty.d.ts → 20260105084623-penalties.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260105092543-userHasPenalty.d.ts → 20260105092543-userHasPenalties.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const tableName = '
|
|
3
|
+
const tableName = 'penalties';
|
|
4
4
|
const tableExists = await queryInterface.describeTable(tableName)
|
|
5
5
|
.then(() => true)
|
|
6
6
|
.catch(() => false);
|
|
@@ -126,7 +126,7 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
const down = async (queryInterface) => {
|
|
129
|
-
const tableName = '
|
|
129
|
+
const tableName = 'penalties';
|
|
130
130
|
const tableExists = await queryInterface
|
|
131
131
|
.describeTable(tableName)
|
|
132
132
|
.then(() => true)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const tableName = '
|
|
3
|
+
const tableName = 'user_has_penalties';
|
|
4
4
|
const tableExists = await queryInterface
|
|
5
5
|
.describeTable(tableName)
|
|
6
6
|
.then(() => true)
|
|
@@ -193,7 +193,7 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
const down = async (queryInterface) => {
|
|
196
|
-
const tableName = '
|
|
196
|
+
const tableName = 'user_has_penalties';
|
|
197
197
|
const tableExists = await queryInterface
|
|
198
198
|
.describeTable(tableName)
|
|
199
199
|
.then(() => true)
|
|
@@ -4,7 +4,7 @@ const sequelize_1 = require("sequelize");
|
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
class UserHasPenaltyModel extends sequelize_1.Model {
|
|
6
6
|
static associate(models) {
|
|
7
|
-
const { UserModel, InstituteModel, AcademicCalendarModel,
|
|
7
|
+
const { UserModel, InstituteModel, AcademicCalendarModel, PenaltiesModel, StudentFeeCollectionModel } = models;
|
|
8
8
|
UserHasPenaltyModel.belongsTo(UserModel, {
|
|
9
9
|
foreignKey: {
|
|
10
10
|
name: 'createdBy',
|
|
@@ -85,14 +85,14 @@ class UserHasPenaltyModel extends sequelize_1.Model {
|
|
|
85
85
|
},
|
|
86
86
|
as: 'studentFeeUHPenalty',
|
|
87
87
|
});
|
|
88
|
-
UserHasPenaltyModel.belongsTo(
|
|
88
|
+
UserHasPenaltyModel.belongsTo(PenaltiesModel, {
|
|
89
89
|
foreignKey: {
|
|
90
90
|
name: 'penaltyId',
|
|
91
91
|
field: 'penalty_id',
|
|
92
92
|
},
|
|
93
93
|
as: 'penaltyUserHPenalty',
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
PenaltiesModel.hasMany(UserHasPenaltyModel, {
|
|
96
96
|
foreignKey: {
|
|
97
97
|
name: 'penaltyId',
|
|
98
98
|
field: 'penalty_id',
|
|
@@ -158,7 +158,7 @@ UserHasPenaltyModel.init({
|
|
|
158
158
|
},
|
|
159
159
|
}, {
|
|
160
160
|
modelName: 'UserHasPenaltyModel',
|
|
161
|
-
tableName: '
|
|
161
|
+
tableName: 'user_has_penalties',
|
|
162
162
|
timestamps: true,
|
|
163
163
|
sequelize: index_1.sequelize,
|
|
164
164
|
});
|
package/package.json
CHANGED
/package/dist/db/psql/migrations/{20260105084623-penalty.d.ts → 20260105084623-penalties.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|