create permission model

This commit is contained in:
b1ek 2023-03-04 10:34:42 +10:00
parent 0d5b27dac6
commit 739295b162
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 38 additions and 0 deletions

38
models/permission.js Normal file
View File

@ -0,0 +1,38 @@
const { Model, DataTypes } = require('sequelize');
const { sequelize } = require('.');
class Permission extends Model {
}
Permission.structure = {
// id: {
// type: DataTypes.BIGINT,
// primaryKey: true,
// autoIncrement: true,
// allowNull: false
// },
user: {
type: DataTypes.BIGINT,
allowNull: false
},
permission: {
type: DataTypes.TEXT,
allowNull: false
},
value: {
type: DataTypes.BIGINT,
allowNull: false
}
};
let init = (sequelize, DataTypes) => {
let perm = Permission.init(Permission.structure, {
sequelize,
modelName: 'Permission',
tableName: 'permissions'
})
};
init.class = Permission;
module.exports = init;