@kipicore/dbcore 1.1.233 → 1.1.235
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/20260126094238-user_model_update.d.ts +2 -0
- package/dist/db/psql/migrations/20260126094238-user_model_update.js +24 -0
- package/dist/interfaces/userInstituteMetaInterface.d.ts +2 -1
- package/dist/models/mongodb/userInstituteMetaModel.js +4 -0
- package/dist/models/psql/userModel.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('users');
|
|
4
|
+
// Check if column already exists
|
|
5
|
+
if (table.email) {
|
|
6
|
+
await queryInterface.changeColumn('users', 'email', {
|
|
7
|
+
type: Sequelize.STRING,
|
|
8
|
+
allowNull: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const down = async (queryInterface, Sequelize) => {
|
|
13
|
+
const table = await queryInterface.describeTable('users');
|
|
14
|
+
if (table.email) {
|
|
15
|
+
await queryInterface.changeColumn('users', 'email', {
|
|
16
|
+
type: Sequelize.STRING(50),
|
|
17
|
+
allowNull: true,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
module.exports = {
|
|
22
|
+
up,
|
|
23
|
+
down,
|
|
24
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
-
import { ADMISSION_TYPE, BOOLEAN_STATUS, COMMAN_STATUS, EMPLOYMENT_TYPE, IS_PRINCIPAL, USER_INSTITUTE_META_STATUS, USER_TYPES } from '../constants/app';
|
|
3
|
+
import { ADMISSION_TYPE, BOOLEAN_STATUS, COMMAN_STATUS, EMPLOYMENT_TYPE, FEE_COLLECTION_TYPE, IS_PRINCIPAL, USER_INSTITUTE_META_STATUS, USER_TYPES } from '../constants/app';
|
|
4
4
|
export interface IUserInstituteMetaSlots {
|
|
5
5
|
slotId: string;
|
|
6
6
|
isPrimary: boolean;
|
|
@@ -54,4 +54,5 @@ export interface IUserInstituteMetaAttributes extends IDefaultAttributes, Docume
|
|
|
54
54
|
oldId?: string;
|
|
55
55
|
previousEntities?: string[];
|
|
56
56
|
studentFeeService?: IStudentFeeService[];
|
|
57
|
+
studentFeeType?: FEE_COLLECTION_TYPE;
|
|
57
58
|
}
|
|
@@ -150,7 +150,7 @@ UserModel.init({
|
|
|
150
150
|
firstName: { type: sequelize_1.DataTypes.STRING(25), allowNull: false, field: 'first_name' },
|
|
151
151
|
lastName: { type: sequelize_1.DataTypes.STRING(25), allowNull: false, field: 'last_name' },
|
|
152
152
|
middleName: { type: sequelize_1.DataTypes.STRING(25), allowNull: true, field: 'middle_name' },
|
|
153
|
-
email: { type: sequelize_1.DataTypes.STRING
|
|
153
|
+
email: { type: sequelize_1.DataTypes.STRING, allowNull: false },
|
|
154
154
|
mobile: { type: sequelize_1.DataTypes.STRING(10), allowNull: true },
|
|
155
155
|
password: { type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
156
156
|
emailVerification: { type: sequelize_1.DataTypes.STRING(30), allowNull: false, field: 'email_varification', defaultValue: app_1.EMAIL_VERIFICATION.PENDING },
|
package/package.json
CHANGED