lms-sync 1.0.31 → 1.0.33
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.
@@ -35,9 +35,16 @@ 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 ${maxIdUsers + 1}`);
|
41
48
|
|
42
49
|
await db.sequelize.query(`CREATE SEQUENCE IF NOT EXISTS ${db_schema}."Campuses__id_seq"`);
|
43
50
|
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
|
);
|