/
Jafar
/
CustomSocks
Обзор
Документация
Войти
/
Jafar
/
CustomSocks
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
db/models/chat.js
25 строк
611 B
jafarMagomedov
last commit
31 мар 2022, 17:26
31 мар 2022, 17:26
96e0d63
Код
Авторство
О чём код?
const { Model, } = require('sequelize'); module.exports = (sequelize, DataTypes) => { class Chat extends Model { /** * Helper method for defining associations. * This method is not a part of Sequelize lifecycle. * The `models/index` file will call this method automatically. */ static associate(models) { // define association here this.belongsTo(models.User, { foreignKey: 'user_id' }); } } Chat.init({ user_id: DataTypes.INTEGER, text: DataTypes.STRING, }, { sequelize, modelName: 'Chat', }); return Chat; };