Files
yourpart3/backend/models/falukant/log/notification.js

36 lines
862 B
JavaScript

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
class Notification extends Model { }
Notification.init({
userId: {
type: DataTypes.INTEGER,
allowNull: false},
tr: {
type: DataTypes.STRING,
allowNull: false},
character_name: {
type: DataTypes.STRING,
allowNull: true,
field: 'character_name'
},
characterName: {
type: DataTypes.VIRTUAL,
get() {
return this.getDataValue('character_name') || null;
}
},
shown: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false}}, {
sequelize,
modelName: 'Notification',
tableName: 'notification',
schema: 'falukant_log',
timestamps: true,
underscored: true});
export default Notification;