Finished guestbook and gallery. started diary
This commit is contained in:
31
backend/models/community/diary.js
Normal file
31
backend/models/community/diary.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../utils/sequelize.js';
|
||||
|
||||
class Diary extends Model { }
|
||||
|
||||
Diary.init({
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
text: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: false,
|
||||
},
|
||||
createdAt: {
|
||||
type: DataTypes.DATE,
|
||||
defaultValue: DataTypes.NOW,
|
||||
},
|
||||
updatedAt: {
|
||||
type: DataTypes.DATE,
|
||||
defaultValue: DataTypes.NOW,
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'Diary',
|
||||
tableName: 'diary',
|
||||
schema: 'community',
|
||||
timestamps: true,
|
||||
});
|
||||
|
||||
export default Diary;
|
||||
Reference in New Issue
Block a user