Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models one by one, modify import in passport.js #33

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/core/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

import passport from 'passport';
import { Strategy as FacebookStrategy } from 'passport-facebook';
import { User, UserLogin, UserClaim, UserProfile } from '../data/models';
// import { User, UserLogin, UserClaim, UserProfile } from '../data/models';
import User from '../data/models/User.js';
import UserLogin from '../data/models/UserLogin.js';
import UserClaim from '../data/models/UserClaim.js';
import UserProfile from '../data/models/UserProfile.js';
import { auth as config } from '../config';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/data/models/bonafide.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ const Bonafide = Model.define('bonafide', {
allowNull: false,
primaryKey: true,
autoIncrement: true,
unique: true,
},
req_date: {
type: DataTypes.BIGINT,
type: DataTypes.BIGINT(20),
allowNull: false,
},
other_reason: {
Expand Down
1 change: 1 addition & 0 deletions src/data/models/cgpa_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const CGPA_View = Model.define('cgpa_view', {
cgpa: {
type: DataTypes.INTEGER(10),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'cgpa_view',
Expand Down
4 changes: 2 additions & 2 deletions src/data/models/daypass.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const DayPass = Model.define('daypass', {
allowNull: false,
},
Date: {
type: DataTypes.BIGINT,
type: DataTypes.BIGINT(20),
allowNull: false,
},
Phone: {
Expand All @@ -35,7 +35,7 @@ const DayPass = Model.define('daypass', {
allowNull: false,
},
Approved: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: false,
},
Comment: {
Expand Down
6 changes: 5 additions & 1 deletion src/data/models/daypasstablegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ const DayPassTableGate = Model.define('daypasstablegate', {
ID: {
type: DataTypes.STRING(12),
allowNull: true,
defaultValue: null,
},
Name: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
DayPassDate: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
DayPassApproved: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'daypasstablegate',
Expand Down
2 changes: 1 addition & 1 deletion src/data/models/discp.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Discp = Model.define('discp', {
allowNull: false,
},
severe: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: '0',
},
Expand Down
4 changes: 3 additions & 1 deletion src/data/models/discp_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ const DiscpView = Model.define('discp_view', {
allowNull: false,
},
severe: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
},
date: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'discp_view',
Expand Down
2 changes: 2 additions & 0 deletions src/data/models/faculty_incharge.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ const Faculty_Incharge = Model.define('faculty_incharge', {
chamber: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
office: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'faculty_incharge',
Expand Down
2 changes: 2 additions & 0 deletions src/data/models/info_update.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Info_Update = Model.define('info_update', {
phone: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
address: {
type: DataTypes.TEXT,
Expand All @@ -31,6 +32,7 @@ const Info_Update = Model.define('info_update', {
email: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'info_update',
Expand Down
8 changes: 8 additions & 0 deletions src/data/models/inoutdetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ const InOutDetails = Model.define('inoutdetails', {
Name: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
Hostel: {
type: DataTypes.STRING(4),
allowNull: true,
defaultValue: null,
},
Room: {
type: DataTypes.STRING(3),
allowNull: true,
defaultValue: null,
},
Phone: {
type: DataTypes.STRING(10),
allowNull: true,
defaultValue: null,
},
Place: {
type: DataTypes.STRING(20),
Expand All @@ -31,6 +35,7 @@ const InOutDetails = Model.define('inoutdetails', {
OutDate: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
OutTime: {
type: DataTypes.TIME,
Expand All @@ -39,14 +44,17 @@ const InOutDetails = Model.define('inoutdetails', {
InDate: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
InTime: {
type: DataTypes.TIME,
allowNull: true,
defaultValue: null,
},
OnCampus: {
type: DataTypes.INTEGER(1),
allowNull: true,
defaultValue: null,
},
exit_id: {
type: DataTypes.INTEGER(11),
Expand Down
2 changes: 1 addition & 1 deletion src/data/models/institure_holidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Institure_Holidays = Model.define('institure_holidays', {
primaryKey: true,
},
date: {
type: DataTypes.BIGINT,
type: DataTypes.DATE,
allowNull: false,
},
}, {
Expand Down
4 changes: 3 additions & 1 deletion src/data/models/leave_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ const Leave_Requests = Model.define('leave_requests', {
approved_by: {
type: DataTypes.STRING(50),
allowNull: true,
defaultValue: null,
},
approved: {
type: DataTypes.INTEGER(1).UNSIGNED,
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
},
comment: {
type: DataTypes.TEXT,
Expand Down
2 changes: 1 addition & 1 deletion src/data/models/leave_requests_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const Leave_Requests_View = Model.define('leave_requests_view', {
id: {
type: DataTypes.STRING(12),
allowNull: false,
primaryKey: true,
},
student_name: {
type: DataTypes.TEXT,
Expand All @@ -16,6 +15,7 @@ const Leave_Requests_View = Model.define('leave_requests_view', {
leave_id: {
type: DataTypes.INTEGER(20),
allowNull: false,
primaryKey: true,
},
login_id: {
type: DataTypes.STRING(20),
Expand Down
7 changes: 6 additions & 1 deletion src/data/models/leavetablegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ const LeaveTableGate = Model.define('leavetablegate', {
ID: {
type: DataTypes.STRING(12),
allowNull: true,
defaultValue: null,
},
Name: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
LeaveStart: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
LeaveEnd: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
LeaveApproved: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'leavetablegate',
Expand Down
1 change: 1 addition & 0 deletions src/data/models/login_ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Login_IDs = Model.define('login_ids', {
allowNull: false,
defaultValue: '',
primaryKey: true,
unique: true,
},
type: {
type: DataTypes.STRING(11),
Expand Down
2 changes: 1 addition & 1 deletion src/data/models/mess_option_open.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Model from '../sequelize';

const Mess_Option_Open = Model.define('mess_option_open', {
open: {
type: DataTypes.INTEGER(1),
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: '0',
primaryKey: true,
Expand Down
6 changes: 3 additions & 3 deletions src/data/models/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Notices = Model.define('notices', {
autoIncrement: true,
},
archived: {
type: DataTypes.INTEGER(1).UNSIGNED,
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: '0',
},
Expand All @@ -26,11 +26,11 @@ const Notices = Model.define('notices', {
defaultValue: '',
},
published: {
type: DataTypes.BIGINT,
type: DataTypes.BIGINT(20),
allowNull: false,
},
updated: {
type: DataTypes.BIGINT,
type: DataTypes.BIGINT(20),
allowNull: false,
},
category: {
Expand Down
2 changes: 2 additions & 0 deletions src/data/models/nucleus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const Nucleus = Model.define('nucleus', {
chamber: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
office: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'nucleus',
Expand Down
2 changes: 1 addition & 1 deletion src/data/models/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Model from '../sequelize';

const Products = Model.define('products', {
id: {
type: DataTypes.BIGINT,
type: DataTypes.BIGINT(20),
allowNull: false,
primaryKey: true,
autoIncrement: true,
Expand Down
2 changes: 2 additions & 0 deletions src/data/models/staff.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const Staff = Model.define('staff', {
chamber: {
type: DataTypes.STRING(10),
allowNull: true,
defaultValue: null,
},
office: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'staff',
Expand Down
12 changes: 12 additions & 0 deletions src/data/models/student_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ const Student = Model.define('student_info', {
allowNull: true,
unique: true,
primaryKey: true,
defaultValue: null,
},
hostel: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
hostel_room: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
id: {
type: DataTypes.STRING(20),
Expand All @@ -31,14 +34,17 @@ const Student = Model.define('student_info', {
bday: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
phone: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
email: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
address: {
type: DataTypes.TEXT,
Expand All @@ -47,26 +53,32 @@ const Student = Model.define('student_info', {
father_name: {
type: DataTypes.STRING(200),
allowNull: true,
defaultValue: null,
},
father_phone: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
father_email: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
admit: {
type: DataTypes.STRING(50),
allowNull: true,
defaultValue: null,
},
gender: {
type: DataTypes.CHAR(5),
allowNull: true,
defaultValue: null,
},
bloodgroup: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: null,
},
}, {
tableName: 'student_info',
Expand Down
1 change: 1 addition & 0 deletions src/data/models/students_basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Students_Basic = Model.define('students_basic', {
allowNull: false,
defaultValue: '',
primaryKey: true,
unique: true,
},
student_name: {
type: DataTypes.STRING(200),
Expand Down
Loading