mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-04-04 20:31:42 +03:00
29 lines
604 B
JavaScript
29 lines
604 B
JavaScript
const { DataTypes } = require('sequelize');
|
|
module.exports = (client, sequelize) => {
|
|
const { DB_TABLE_PREFIX } = process.env;
|
|
sequelize.define('SurveyResponse', {
|
|
answers: {
|
|
type: DataTypes.JSON,
|
|
allowNull: true,
|
|
},
|
|
survey: {
|
|
type: DataTypes.CHAR(18),
|
|
allowNull: false,
|
|
references: {
|
|
model: DB_TABLE_PREFIX + 'surveys',
|
|
key: 'id'
|
|
},
|
|
},
|
|
ticket: {
|
|
type: DataTypes.CHAR(18),
|
|
allowNull: false,
|
|
unique: 'id-ticket',
|
|
references: {
|
|
model: DB_TABLE_PREFIX + 'tickets',
|
|
key: 'id'
|
|
},
|
|
},
|
|
}, {
|
|
tableName: DB_TABLE_PREFIX + 'survey_responses'
|
|
});
|
|
}; |