-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Implement access level change by superadmin
- Implement user delete feature
- Loading branch information
1 parent
bdcb0a5
commit 5314b8e
Showing
20 changed files
with
633 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.createTable('UserArchives', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
oldId: { | ||
type: Sequelize.INTEGER, | ||
required: true, | ||
}, | ||
firstName: { | ||
type: Sequelize.STRING, | ||
required: false, | ||
}, | ||
lastName: { | ||
type: Sequelize.STRING, | ||
required: false, | ||
}, | ||
userName: { | ||
type: Sequelize.STRING, | ||
required: true, | ||
unique: true, | ||
}, | ||
email: { | ||
type: Sequelize.STRING, | ||
required: true, | ||
unique: true, | ||
}, | ||
password: { | ||
type: Sequelize.STRING, | ||
required: true, | ||
}, | ||
isVerified: { | ||
type: Sequelize.BOOLEAN, | ||
required: false, | ||
defaultValue: false, | ||
}, | ||
role: { | ||
type: Sequelize.ENUM(['superAdmin', 'admin', 'user']), | ||
required: true, | ||
allowNull: false, | ||
defaultValue: 'user', | ||
}, | ||
imageUrl: { | ||
type: Sequelize.STRING, | ||
required: false, | ||
}, | ||
bio: { | ||
type: Sequelize.STRING, | ||
required: false, | ||
}, | ||
verificationToken: { | ||
type: Sequelize.STRING, | ||
required: false, | ||
}, | ||
oldCreatedAt: { | ||
type: Sequelize.DATE, | ||
required: true, | ||
}, | ||
oldUpdatedAt: { | ||
type: Sequelize.DATE, | ||
required: true, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), | ||
}, | ||
}); | ||
}, | ||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.dropTable('UserArchives'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,3 @@ module.exports = (sequelize, DataTypes) => { | |
}; | ||
return CommentHistory; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
module.exports = (sequelize, DataTypes) => { | ||
const UserArchive = sequelize.define('UserArchive', { | ||
oldId: { | ||
type: DataTypes.INTEGER, | ||
required: true, | ||
}, | ||
firstName: { | ||
type: DataTypes.STRING, | ||
required: false, | ||
}, | ||
lastName: { | ||
type: DataTypes.STRING, | ||
required: false, | ||
}, | ||
userName: { | ||
type: DataTypes.STRING, | ||
required: true, | ||
unique: true, | ||
}, | ||
email: { | ||
type: DataTypes.STRING, | ||
required: true, | ||
unique: true, | ||
}, | ||
password: { | ||
type: DataTypes.STRING, | ||
required: true, | ||
}, | ||
isVerified: { | ||
type: DataTypes.BOOLEAN, | ||
}, | ||
bio: { | ||
type: DataTypes.STRING, | ||
}, | ||
role: { | ||
type: DataTypes.ENUM(['superAdmin', 'admin', 'user']), | ||
}, | ||
imageUrl: { | ||
type: DataTypes.STRING, | ||
required: false, | ||
}, | ||
verificationToken: { | ||
type: DataTypes.STRING, | ||
required: false, | ||
}, | ||
oldCreatedAt: { | ||
type: DataTypes.DATE, | ||
required: true, | ||
}, | ||
oldUpdatedAt: { | ||
type: DataTypes.DATE, | ||
required: true, | ||
} | ||
}, {}); | ||
UserArchive.associate = function(models) { | ||
// associations can be defined here | ||
}; | ||
return UserArchive; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const roles = { | ||
allRoles: ['superAdmin', 'admin', 'user'], | ||
superAdmin: ['superAdmin'] | ||
}; | ||
|
||
export default roles; |
Oops, something went wrong.