@kipicore/dbcore 1.1.231 → 1.1.232
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/20260126063239-add_is_credit_amount_used_student_fee_history.d.ts +2 -0
- package/dist/db/psql/migrations/20260126063239-add_is_credit_amount_used_student_fee_history.js +23 -0
- package/dist/interfaces/studentFeeHistoryInterface.d.ts +1 -0
- package/dist/models/psql/studentFeeHistoryModel.d.ts +1 -0
- package/dist/models/psql/studentFeeHistoryModel.js +1 -0
- package/package.json +1 -1
package/dist/db/psql/migrations/20260126063239-add_is_credit_amount_used_student_fee_history.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('student_fee_history');
|
|
4
|
+
// Check if column already exists
|
|
5
|
+
if (!table.is_credit_amount_used) {
|
|
6
|
+
await queryInterface.addColumn('student_fee_history', 'is_credit_amount_used', {
|
|
7
|
+
type: Sequelize.BOOLEAN,
|
|
8
|
+
defaultValue: false,
|
|
9
|
+
field: 'is_credit_amount_used',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const down = async (queryInterface, Sequelize) => {
|
|
14
|
+
const table = await queryInterface.describeTable('student_fee_history');
|
|
15
|
+
// Remove only if column exists
|
|
16
|
+
if (table.is_credit_amount_used) {
|
|
17
|
+
await queryInterface.removeColumn('student_fee_history', 'is_credit_amount_used');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
module.exports = {
|
|
21
|
+
up,
|
|
22
|
+
down,
|
|
23
|
+
};
|
|
@@ -152,6 +152,7 @@ StudentFeeHistoryModel.init({
|
|
|
152
152
|
subjectId: { type: sequelize_1.DataTypes.UUID, field: 'subject_id', allowNull: true },
|
|
153
153
|
batchId: { type: sequelize_1.DataTypes.UUID, field: 'batch_id', allowNull: true },
|
|
154
154
|
history: { type: sequelize_1.DataTypes.TEXT, field: 'history', allowNull: true },
|
|
155
|
+
isCreditAmountUsed: { type: sequelize_1.DataTypes.BOOLEAN, field: 'is_credit_amount_used', defaultValue: false },
|
|
155
156
|
}, {
|
|
156
157
|
modelName: 'StudentFeeHistoryModel',
|
|
157
158
|
tableName: 'student_fee_history',
|
package/package.json
CHANGED