Last active
January 3, 2021 11:13
-
-
Save kasir-barati/bd82f3cdd8f8254b56208adaf1aa07c3 to your computer and use it in GitHub Desktop.
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
const { DataTypes, Model } = require("sequelize"); | |
const sequelize = require("../sequelize"); | |
class Role extends Model { | |
static col = { | |
id: "id", | |
name: "name", | |
}; | |
static alias = { | |
user: "RoleHasUsers", | |
}; | |
} | |
Role.init( | |
{ | |
[Role.col.id]: { | |
type: DataTypes.UUID, | |
primaryKey: true, | |
defaultValue: DataTypes.UUIDV4, | |
}, | |
[Role.col.name]: DataTypes.STRING, | |
}, | |
{ | |
sequelize: sequelize.getSeq(), | |
} | |
); | |
module.exports = Role; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment