Finished guestbook and gallery. started diary

This commit is contained in:
Torsten Schulz
2024-09-27 07:40:06 +02:00
parent a2ee66c9de
commit c31be3f879
34 changed files with 2298 additions and 185 deletions

View File

@@ -0,0 +1,47 @@
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,
references: {
model: User,
key: 'id'
}
},
senderId: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: User,
key: 'id'
}
},
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;