mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
maintenance commit
This commit is contained in:
@@ -5,17 +5,15 @@ const sequelize = require("../util/database");
|
||||
const Message = require("./Message");
|
||||
|
||||
const Contact = sequelize.define("contact", {
|
||||
id: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
name: { type: Sequelize.STRING(100), allowNull: false },
|
||||
number: { type: Sequelize.STRING(15), allowNull: false },
|
||||
imageURL: { type: Sequelize.STRING(200) },
|
||||
ateraId: Sequelize.INTEGER(),
|
||||
});
|
||||
|
||||
Contact.hasMany(Message);
|
||||
Contact.hasMany(Message, {
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
});
|
||||
|
||||
module.exports = Contact;
|
||||
|
||||
@@ -5,6 +5,8 @@ const Message = sequelize.define("message", {
|
||||
userId: { type: Sequelize.INTEGER, defaultValue: 0 },
|
||||
messageBody: { type: Sequelize.STRING(250), allowNull: false },
|
||||
read: { type: Sequelize.BOOLEAN, defaultValue: false },
|
||||
mediaUrl: { type: Sequelize.STRING(250) },
|
||||
mediaType: { type: Sequelize.STRING(250) },
|
||||
});
|
||||
|
||||
module.exports = Message;
|
||||
|
||||
Reference in New Issue
Block a user