DiscordTickets/src/database/models/survey.model.js
Isaac db94bf6969
Fixes and improvements for database and other things
Also continued to add to ticket creation stuff - now includes opening questions
2021-04-25 15:40:07 +01:00

26 lines
530 B
JavaScript

const { DataTypes } = require('sequelize');
module.exports = (client, sequelize) => {
const { DB_TABLE_PREFIX } = process.env;
sequelize.define('Survey', {
guild: {
type: DataTypes.CHAR(19),
allowNull: false,
references: {
model: DB_TABLE_PREFIX + 'guilds',
key: 'id'
},
unique: 'name-guild'
},
name: {
type: DataTypes.STRING,
allowNull: false,
unique: 'name-guild'
},
questions: {
type: DataTypes.JSON,
allowNull: true,
},
}, {
tableName: DB_TABLE_PREFIX + 'surveys'
});
};