@kipicore/dbcore 1.1.199 → 1.1.200

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,39 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('user_fee_types');
4
+ // grNumber → allow null
5
+ if (table.gr_number && table.gr_number.allowNull === false) {
6
+ await queryInterface.changeColumn('user_fee_types', 'gr_number', {
7
+ type: Sequelize.STRING,
8
+ allowNull: true,
9
+ });
10
+ }
11
+ // rollNumber → allow null
12
+ if (table.roll_number && table.roll_number.allowNull === false) {
13
+ await queryInterface.changeColumn('user_fee_types', 'roll_number', {
14
+ type: Sequelize.STRING,
15
+ allowNull: true,
16
+ });
17
+ }
18
+ };
19
+ const down = async (queryInterface, Sequelize) => {
20
+ const table = await queryInterface.describeTable('user_fee_types');
21
+ // rollback grNumber
22
+ if (table.gr_number) {
23
+ await queryInterface.changeColumn('user_fee_types', 'gr_number', {
24
+ type: Sequelize.STRING,
25
+ allowNull: false,
26
+ });
27
+ }
28
+ // rollback rollNumber
29
+ if (table.roll_number) {
30
+ await queryInterface.changeColumn('user_fee_types', 'roll_number', {
31
+ type: Sequelize.STRING,
32
+ allowNull: false,
33
+ });
34
+ }
35
+ };
36
+ module.exports = {
37
+ up,
38
+ down,
39
+ };
@@ -155,11 +155,11 @@ UserFeeTypeModel.init({
155
155
  },
156
156
  grNumber: {
157
157
  type: sequelize_1.DataTypes.STRING,
158
- allowNull: false,
158
+ allowNull: true,
159
159
  },
160
160
  rollNumber: {
161
161
  type: sequelize_1.DataTypes.STRING,
162
- allowNull: false,
162
+ allowNull: true,
163
163
  },
164
164
  feeCollectionAccountId: {
165
165
  type: sequelize_1.DataTypes.UUID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.199",
3
+ "version": "1.1.200",
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",