All new Models for PostgreSQL

This commit is contained in:
Blake 2017-10-11 01:42:56 +11:00
parent 0a599488e3
commit e91990467b
6 changed files with 188 additions and 0 deletions

34
models/Badges.js Normal file
View file

@ -0,0 +1,34 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const Badges = Database.db.define('badges', {
userID: Sequelize.STRING,
guildID: Sequelize.STRING,
developer: {
type: Sequelize.INTEGER,
defaultValue: 0
},
active: {
type: Sequelize.INTEGER,
defaultValue: 0
},
moderator: {
type: Sequelize.INTEGER,
defaultValue: 0
},
essaywriter: {
type: Sequelize.INTEGER,
defaultValue: 0
},
friendship: {
type: Sequelize.INTEGER,
defaultValue: 0
},
photographer: {
type: Sequelize.INTEGER,
defaultValue: 0
}
});
module.exports = Badges;

15
models/Moderation.js Normal file
View file

@ -0,0 +1,15 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const Moderation = Database.db.define('punishments', {
case: Sequelize.INTEGER,
guildID: Sequelize.STRING,
userID: Sequelize.STRING,
time: Sequelize.STRING,
type: Sequelize.STRING,
punishedBy: Sequelize.STRING,
reason: Sequelize.STRING,
});
module.exports = Moderation;

55
models/Settings.js Normal file
View file

@ -0,0 +1,55 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const SettingsModel = Database.db.define('settings', {
guildID: Sequelize.STRING,
expletiveFilter: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
spamFilter: {
type: Sequelize.BOOLEAN,
defaultValue: true
},
moderatorRole: {
type: Sequelize.STRING,
defaultValue: "null"
},
muteRole: {
type: Sequelize.STRING,
defaultValue: "null"
},
prefix: {
type: Sequelize.STRING,
defaultValue: "+"
},
experienceTracking: {
type: Sequelize.BOOLEAN,
defaultValue: true
},
musicDisplayNowPlaying: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
modLogsChannel: {
type: Sequelize.STRING,
defaultValue: "null"
},
memberLogsChannel: {
type: Sequelize.STRING,
defaultValue: "null"
},
joinMessageEnabled: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
joinMessage: {
type: Sequelize.STRING,
defaultValue: "Welcome!"
},
joinMessageChannel: {
type: Sequelize.STRING,
defaultValue: "null"
}
});
module.exports = SettingsModel;

34
models/Slots.js Normal file
View file

@ -0,0 +1,34 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const Slots = Database.db.define('slots', {
userID: Sequelize.STRING,
guildID: Sequelize.STRING,
slot1: {
type: Sequelize.STRING,
defaultValue: "empty"
},
slot2: {
type: Sequelize.STRING,
defaultValue: "empty"
},
slot3: {
type: Sequelize.STRING,
defaultValue: "empty"
},
slot4: {
type: Sequelize.STRING,
defaultValue: "empty"
},
slot5: {
type: Sequelize.STRING,
defaultValue: "empty"
},
slot6: {
type: Sequelize.STRING,
defaultValue: "empty"
}
});
module.exports = Slots;

17
models/Tags.js Normal file
View file

@ -0,0 +1,17 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const Tags = Database.db.define('tags', {
name: Sequelize.STRING,
description: Sequelize.STRING,
userID: Sequelize.STRING,
guildID: Sequelize.STRING,
usage_count: {
type: Sequelize.INTEGER,
defaultValue: 0,
allowNull: false,
},
});
module.exports = Tags;

33
models/User.js Normal file
View file

@ -0,0 +1,33 @@
const Sequelize = require('sequelize');
const Database = require('../structures/PostgreSQL.js');
const User = Database.db.define('user', {
userID: Sequelize.STRING,
guildID: Sequelize.STRING,
experience: {
type: Sequelize.BIGINT(), // eslint-disable-line new-cap
defaultValue: 0
},
g_experience: {
type: Sequelize.BIGINT(), // eslint-disable-line new-cap
defaultValue: 0
},
background: {
type: Sequelize.STRING,
defaultValue: 'default'
},
role: {
type: Sequelize.STRING,
defaultValue: 'default'
},
roleColor: {
type: Sequelize.STRING,
defaultValue: '000000'
},
weapon: {
type: Sequelize.STRING,
defaultValue: 'wooden'
}
});
module.exports = User;