mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-05 09:41:27 +03:00
Fixes and improvements for database and other things
Also continued to add to ticket creation stuff - now includes opening questions
This commit is contained in:
@@ -3,12 +3,12 @@ module.exports = ({ config }, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('Category', {
|
||||
id: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
guild: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'guilds',
|
||||
|
@@ -3,13 +3,13 @@ module.exports = (client, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('ChannelEntity', {
|
||||
channel: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket'
|
||||
},
|
||||
name: DataTypes.TEXT,
|
||||
ticket: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket',
|
||||
references: {
|
||||
|
@@ -3,7 +3,7 @@ module.exports = ({ config }, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('Guild', {
|
||||
id: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
|
@@ -3,12 +3,12 @@ module.exports = (client, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('Message', {
|
||||
id: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
author: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
},
|
||||
data: {
|
||||
@@ -24,7 +24,7 @@ module.exports = (client, sequelize) => {
|
||||
defaultValue: false,
|
||||
},
|
||||
ticket: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'tickets',
|
||||
|
@@ -8,12 +8,12 @@ module.exports = (client, sequelize) => {
|
||||
},
|
||||
name: DataTypes.TEXT,
|
||||
role: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket'
|
||||
},
|
||||
ticket: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket',
|
||||
references: {
|
||||
|
@@ -3,7 +3,7 @@ module.exports = (client, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('Survey', {
|
||||
guild: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'guilds',
|
||||
|
@@ -7,17 +7,18 @@ module.exports = (client, sequelize) => {
|
||||
allowNull: true,
|
||||
},
|
||||
survey: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
unique: 'survey-ticket',
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'surveys',
|
||||
key: 'id'
|
||||
},
|
||||
},
|
||||
ticket: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket',
|
||||
unique: 'survey-ticket',
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'tickets',
|
||||
key: 'id'
|
||||
|
@@ -3,12 +3,12 @@ module.exports = (client, sequelize) => {
|
||||
const { DB_TABLE_PREFIX } = process.env;
|
||||
sequelize.define('Ticket', {
|
||||
id: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
category: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'categories',
|
||||
@@ -16,7 +16,7 @@ module.exports = (client, sequelize) => {
|
||||
},
|
||||
},
|
||||
closed_by: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: true,
|
||||
},
|
||||
closed_reason: {
|
||||
@@ -24,7 +24,7 @@ module.exports = (client, sequelize) => {
|
||||
allowNull: true,
|
||||
},
|
||||
creator: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
},
|
||||
first_response: {
|
||||
@@ -32,7 +32,7 @@ module.exports = (client, sequelize) => {
|
||||
allowNull: true,
|
||||
},
|
||||
guild: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: DB_TABLE_PREFIX + 'guilds',
|
||||
@@ -50,7 +50,7 @@ module.exports = (client, sequelize) => {
|
||||
defaultValue: true
|
||||
},
|
||||
opening_message: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: true,
|
||||
},
|
||||
topic: {
|
||||
|
@@ -8,7 +8,7 @@ module.exports = (client, sequelize) => {
|
||||
discriminator: DataTypes.STRING,
|
||||
display_name: DataTypes.TEXT,
|
||||
ticket: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket',
|
||||
references: {
|
||||
@@ -17,7 +17,7 @@ module.exports = (client, sequelize) => {
|
||||
},
|
||||
},
|
||||
user: {
|
||||
type: DataTypes.CHAR(18),
|
||||
type: DataTypes.CHAR(19),
|
||||
allowNull: false,
|
||||
unique: 'id-ticket'
|
||||
},
|
||||
|
Reference in New Issue
Block a user