@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.
@@ -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,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
+ };
@@ -23,4 +23,5 @@ export interface IStudentFeeHistoryModelAttributes extends IDefaultAttributes {
23
23
  upiId?: string;
24
24
  bankName?: string;
25
25
  chequeNo?: string;
26
+ isCreditAmountUsed?: string;
26
27
  }
@@ -25,6 +25,7 @@ export declare class StudentFeeHistoryModel extends Model<IStudentFeeHistoryMode
25
25
  batchId: string;
26
26
  subjectId: string;
27
27
  history?: string;
28
+ isCreditAmountUsed: string;
28
29
  createdBy: string;
29
30
  updatedBy: string;
30
31
  deletedBy: string;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.231",
3
+ "version": "1.1.232",
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",