mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
Migrate from moment to date-fns and some changes
This commit is contained in:
22
backend/src/models/Message.js
Normal file
22
backend/src/models/Message.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../database");
|
||||
|
||||
const Message = sequelize.define("message", {
|
||||
id: {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE(6),
|
||||
},
|
||||
userId: { type: Sequelize.INTEGER, defaultValue: 0 },
|
||||
ack: { type: Sequelize.INTEGER, defaultValue: 0 },
|
||||
messageBody: { type: Sequelize.TEXT, 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