From 739295b16252c7c28bc22a0c750b237a288dbc0f Mon Sep 17 00:00:00 2001 From: b1ek Date: Sat, 4 Mar 2023 10:34:42 +1000 Subject: [PATCH] create permission model --- models/permission.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 models/permission.js diff --git a/models/permission.js b/models/permission.js new file mode 100644 index 0000000..e8ff8d6 --- /dev/null +++ b/models/permission.js @@ -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; \ No newline at end of file