lms-sync 1.0.30 → 1.0.32
Sign up to get free protection for your applications and to get access to all the features.
@@ -35,9 +35,18 @@ const server = {
|
|
35
35
|
const db_schema = schema
|
36
36
|
let maxIds = await Campuses.max('_id'); //Fetch maximum _id directly from the campuses model
|
37
37
|
let maxIdsSem = await Semesters.max('_id'); //Fetch maximum _id directly from the campuses model
|
38
|
+
let maxIdsUser = await Users.max('_id'); //Fetch maximum _id directly from the campuses model
|
39
|
+
|
38
40
|
|
39
41
|
let maxId = maxIds|| 0;
|
40
42
|
let maxIdSems = maxIdsSem|| 0;
|
43
|
+
let maxIdUsers = maxIdsUser|| 0;
|
44
|
+
|
45
|
+
|
46
|
+
await db.sequelize.query(`CREATE SEQUENCE IF NOT EXISTS ${db_schema}."Users__id_seq"`);
|
47
|
+
await db.sequelize.query(`ALTER SEQUENCE ${db_schema}."Users__id_seq" RESTART WITH ${maxId + 1}`);
|
48
|
+
|
49
|
+
|
41
50
|
|
42
51
|
await db.sequelize.query(`CREATE SEQUENCE IF NOT EXISTS ${db_schema}."Campuses__id_seq"`);
|
43
52
|
await db.sequelize.query(`ALTER SEQUENCE ${db_schema}."Campuses__id_seq" RESTART WITH ${maxId + 1}`);
|
package/models/users.model.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
const bcrypt = require('sequelize-bcrypt')
|
4
4
|
|
5
|
-
module.exports = (sequelize, DataTypes) => {
|
5
|
+
module.exports = (sequelize, DataTypes,schema) => {
|
6
6
|
|
7
7
|
const Users = sequelize.define('Users',{
|
8
8
|
_id: {
|
@@ -178,7 +178,7 @@ module.exports = (sequelize, DataTypes) => {
|
|
178
178
|
// createdAt: 'createdDate',
|
179
179
|
// updatedAt: 'modifiedDate',
|
180
180
|
sequelize,
|
181
|
-
schema:
|
181
|
+
schema: schema,
|
182
182
|
modelName: "Users",
|
183
183
|
}
|
184
184
|
);
|