@kipicore/dbcore 1.1.144 → 1.1.146
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/20251213105516-add_taluka_in_user.d.ts +2 -0
- package/dist/db/psql/migrations/20251213105516-add_taluka_in_user.js +35 -0
- package/dist/interfaces/instituteInterface.d.ts +1 -0
- package/dist/interfaces/userInterface.d.ts +1 -0
- package/dist/models/psql/instituteModel.d.ts +1 -0
- package/dist/models/psql/instituteModel.js +1 -0
- package/dist/models/psql/userModel.d.ts +1 -0
- package/dist/models/psql/userModel.js +1 -0
- package/package.json +1 -1
|
@@ -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
|
+
};
|
|
@@ -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,
|
|
@@ -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