Added reporting feature

This commit is contained in:
2021-03-24 03:20:29 +11:00
parent 2dad56d17e
commit 0b5cc49e6e
4 changed files with 41 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
const Sequelize = require('sequelize');
const sequelize = require('..');
const chatlog = require('./chatlog');
const reports = sequelize.define('reports', {
id: {
type: Sequelize.INTEGER(11),
allowNull: false,
autoIncrement: true,
primaryKey: true,
unique: true
},
reporter: {
type: 'varchar(320)',
allowNull: false
},
});
chatlog.hasMany(reports, { foreignKey: 'chatlogId', foreignKeyConstraint: true });
module.exports = reports;