34 lines
848 B
JavaScript
34 lines
848 B
JavaScript
import { sequelize } from '../../utils/sequelize.js';
|
|
import { DataTypes } from 'sequelize';
|
|
import User from './user.js';
|
|
|
|
const GuestbookEntry = sequelize.define('guestbook_entry', {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
autoIncrement: true,
|
|
primaryKey: true,
|
|
allowNull: false},
|
|
recipientId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false
|
|
},
|
|
senderId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true
|
|
},
|
|
senderUsername: {
|
|
type: DataTypes.STRING,
|
|
allowNull: true},
|
|
contentHtml: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false},
|
|
imageUrl: {
|
|
type: DataTypes.STRING,
|
|
allowNull: true}}, {
|
|
tableName: 'guestbook_entry',
|
|
schema: 'community',
|
|
timestamps: true,
|
|
underscored: true});
|
|
|
|
export default GuestbookEntry;
|