62 lines
No EOL
1.2 KiB
JavaScript
62 lines
No EOL
1.2 KiB
JavaScript
module.exports = async db => {
|
|
// Create tickets table if it doesn't exist
|
|
db.query(`
|
|
CREATE TABLE IF NOT EXISTS tickets (
|
|
id TEXT,
|
|
status TEXT,
|
|
userID TEXT,
|
|
guildID TEXT,
|
|
channelID TEXT
|
|
)
|
|
`, function (error, results) {
|
|
if (error) {
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
// Create questions table if it doesn't exist
|
|
db.query(`
|
|
CREATE TABLE IF NOT EXISTS questions (
|
|
id TEXT,
|
|
guildID TEXT,
|
|
optionID TEXT,
|
|
question TEXT,
|
|
answer_type TEXT,
|
|
place_holder TEXT,
|
|
answer_required BOOLEAN
|
|
)
|
|
`, function (error, results) {
|
|
if (error) {
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
// Create settings table if it doesn't exist
|
|
db.query(`
|
|
CREATE TABLE IF NOT EXISTS settings (
|
|
ticket_counter INT,
|
|
support_roleID TEXT,
|
|
log_channelID TEXT,
|
|
guildID VARCHAR(255) PRIMARY KEY
|
|
)
|
|
`, function (error, results) {
|
|
if (error) {
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
// Create options table if it doesn't exist
|
|
db.query(`
|
|
CREATE TABLE IF NOT EXISTS options (
|
|
id TEXT,
|
|
guildID TEXT,
|
|
categoryID TEXT,
|
|
name TEXT,
|
|
description TEXT
|
|
)
|
|
`, function (error, results) {
|
|
if (error) {
|
|
throw error;
|
|
}
|
|
});
|
|
}; |