const { Model } = require('sequelize'); class Guestbook 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 } } const init = (sequelize, DataTypes) => { let model = Guestbook.init({ id: { type: DataTypes.BIGINT(11), primaryKey: true, autoIncrement: true, allowNull: false }, name: { type: DataTypes.TEXT, allowNull: false }, email: DataTypes.TEXT, text: { type: DataTypes.TEXT, allowNull: false }, hidemail: { type: DataTypes.BOOLEAN, allowNull: false }, ip: { type: DataTypes.TEXT, allowNull: false }, hidden: { type: DataTypes.BOOLEAN, allowNull: false }, time: { type: DataTypes.BIGINT } }, { sequelize, modelName: 'Guestbook', tableName: 'guestbook' }); return model; }; init.class = Guestbook; return init;