@kipicore/dbcore 1.1.143 → 1.1.145

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,35 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const userTable = await queryInterface.describeTable('users');
4
+ const institutesTable = await queryInterface.describeTable('institutes');
5
+ if (!userTable.taluka) {
6
+ await queryInterface.addColumn('users', 'taluka', {
7
+ type: Sequelize.STRING,
8
+ defaultValue: null,
9
+ allowNull: true,
10
+ field: 'taluka',
11
+ });
12
+ }
13
+ if (!institutesTable.taluka) {
14
+ await queryInterface.addColumn('institutes', 'taluka', {
15
+ type: Sequelize.UUID,
16
+ defaultValue: null,
17
+ allowNull: true,
18
+ field: 'taluka',
19
+ });
20
+ }
21
+ };
22
+ const down = async (queryInterface, Sequelize) => {
23
+ const userTable = await queryInterface.describeTable('users');
24
+ const institutesTable = await queryInterface.describeTable('institutes');
25
+ if (!userTable.taluka) {
26
+ await queryInterface.removeColumn('users', 'taluka');
27
+ }
28
+ if (!institutesTable.taluka) {
29
+ await queryInterface.removeColumn('institutes', 'taluka');
30
+ }
31
+ };
32
+ module.exports = {
33
+ up,
34
+ down,
35
+ };
@@ -33,5 +33,6 @@ export interface IInstituteAttributes extends IDefaultAttributes {
33
33
  plannerSyncStatus?: PLANNER_SYNC_STATUS;
34
34
  pdfId?: string;
35
35
  campusId?: string;
36
+ taluka?: string;
36
37
  syncAcademicList?: string[];
37
38
  }
@@ -41,4 +41,5 @@ export interface IUserAttributes extends IDefaultAttributes {
41
41
  relation?: string;
42
42
  district?: string;
43
43
  area?: string;
44
+ taluka?: string;
44
45
  }
@@ -35,6 +35,7 @@ declare class InstituteModel extends Model<IInstituteAttributes, TInstituteCreat
35
35
  plannerSyncStatus: PLANNER_SYNC_STATUS;
36
36
  pdfId?: string;
37
37
  campusId?: string;
38
+ taluka?: string;
38
39
  syncAcademicList?: string[];
39
40
  createdBy: string;
40
41
  updatedBy: string;
@@ -81,6 +81,7 @@ InstituteModel.init({
81
81
  values: Object.values(app_1.SCHOOL_SUB_TYPE),
82
82
  },
83
83
  area: { type: sequelize_1.DataTypes.STRING, allowNull: true },
84
+ taluka: { type: sequelize_1.DataTypes.STRING, allowNull: true },
84
85
  defaultDataCreate: {
85
86
  type: sequelize_1.DataTypes.BOOLEAN,
86
87
  allowNull: true,
@@ -43,6 +43,7 @@ declare class UserModel extends Model<IUserAttributes, TUserCreationAttributes>
43
43
  knownAllergies?: string;
44
44
  district?: string;
45
45
  area?: string;
46
+ taluka?: string;
46
47
  readonly createdAt: Date;
47
48
  readonly deletedAt: string;
48
49
  readonly updatedAt: Date;
@@ -184,6 +184,7 @@ UserModel.init({
184
184
  knownAllergies: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'known_allergies' },
185
185
  medications: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'medications' },
186
186
  relation: { type: sequelize_1.DataTypes.STRING, allowNull: true },
187
+ taluka: { type: sequelize_1.DataTypes.STRING, allowNull: true },
187
188
  }, {
188
189
  modelName: 'UserModel',
189
190
  tableName: 'users',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.143",
3
+ "version": "1.1.145",
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",