diff --git a/migrations/20190707001840-create-tag.js b/migrations/20190707001840-create-tag.js new file mode 100644 index 00000000..a8d803ce --- /dev/null +++ b/migrations/20190707001840-create-tag.js @@ -0,0 +1,38 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('Tags', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER, + }, + trigger: { + type: Sequelize.TEXT, + }, + response: { + type: Sequelize.TEXT, + }, + ownerID: { + type: Sequelize.BIGINT, + }, + serverID: { + type: Sequelize.BIGINT, + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('Tags'); + } +}; \ No newline at end of file diff --git a/migrations/20190708171608-create-autoresponse.js b/migrations/20190708171608-create-autoresponse.js new file mode 100644 index 00000000..e8fdefb2 --- /dev/null +++ b/migrations/20190708171608-create-autoresponse.js @@ -0,0 +1,35 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('autoresponses', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + trigger: { + type: Sequelize.TEXT + }, + response: { + type: Sequelize.TEXT + }, + type: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('autoresponses'); + } +}; \ No newline at end of file diff --git a/migrations/20190708171617-create-autoresponse-stat.js b/migrations/20190708171617-create-autoresponse-stat.js new file mode 100644 index 00000000..9b615906 --- /dev/null +++ b/migrations/20190708171617-create-autoresponse-stat.js @@ -0,0 +1,32 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('autoresponseStats', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + serverID: { + type: Sequelize.BIGINT + }, + stat: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('autoresponseStats'); + } +}; \ No newline at end of file diff --git a/migrations/20190728145741-create-guess-leaderboard.js b/migrations/20190728145741-create-guess-leaderboard.js new file mode 100644 index 00000000..4d0c334c --- /dev/null +++ b/migrations/20190728145741-create-guess-leaderboard.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('guessLeaderboards', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + memberID: { + type: Sequelize.BIGINT + }, + try: { + type: Sequelize.INTEGER + }, + difficulty: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('guessLeaderboards'); + } +}; \ No newline at end of file diff --git a/migrations/20190821164402-create-banned-words.js b/migrations/20190821164402-create-banned-words.js new file mode 100644 index 00000000..83a7a7ec --- /dev/null +++ b/migrations/20190821164402-create-banned-words.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('bannedWords', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + word: { + type: Sequelize.STRING + }, + serverID: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('bannedWords'); + } +}; \ No newline at end of file diff --git a/migrations/20191006180114-create-twitter-blacklist.js b/migrations/20191006180114-create-twitter-blacklist.js new file mode 100644 index 00000000..642e83cc --- /dev/null +++ b/migrations/20191006180114-create-twitter-blacklist.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('TwitterBlacklists', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + userID: { + type: Sequelize.BIGINT + }, + reason: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('TwitterBlacklists'); + } +}; \ No newline at end of file diff --git a/migrations/20191006181945-create-guild-blacklist.js b/migrations/20191006181945-create-guild-blacklist.js new file mode 100644 index 00000000..cbe51fb2 --- /dev/null +++ b/migrations/20191006181945-create-guild-blacklist.js @@ -0,0 +1,27 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('guildBlacklists', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + guildID: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('guildBlacklists'); + } +}; \ No newline at end of file diff --git a/migrations/20191006181953-create-user-blacklist.js b/migrations/20191006181953-create-user-blacklist.js new file mode 100644 index 00000000..778ee28e --- /dev/null +++ b/migrations/20191006181953-create-user-blacklist.js @@ -0,0 +1,27 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('userBlacklists', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + userID: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('userBlacklists'); + } +}; \ No newline at end of file diff --git a/migrations/20191008230533-create-borgar.js b/migrations/20191008230533-create-borgar.js new file mode 100644 index 00000000..0923b449 --- /dev/null +++ b/migrations/20191008230533-create-borgar.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('borgars', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + userID: { + type: Sequelize.BIGINT + }, + level: { + type: Sequelize.INTEGER + }, + xp: { + type: Sequelize.INTEGER + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('borgars'); + } +}; \ No newline at end of file diff --git a/migrations/20191026223359-create-donator.js b/migrations/20191026223359-create-donator.js new file mode 100644 index 00000000..91a0d6f1 --- /dev/null +++ b/migrations/20191026223359-create-donator.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('donators', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + userID: { + type: Sequelize.BIGINT + }, + comment: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('donators'); + } +}; \ No newline at end of file diff --git a/migrations/20191127105740-create-join-channel.js b/migrations/20191127105740-create-join-channel.js new file mode 100644 index 00000000..5f7be951 --- /dev/null +++ b/migrations/20191127105740-create-join-channel.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('joinChannels', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + channelID: { + type: Sequelize.BIGINT + }, + guildID: { + type: Sequelize.BIGINT + }, + message: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('joinChannels'); + } +}; \ No newline at end of file diff --git a/migrations/20191127105810-create-leave-channel.js b/migrations/20191127105810-create-leave-channel.js new file mode 100644 index 00000000..6fb606ea --- /dev/null +++ b/migrations/20191127105810-create-leave-channel.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('leaveChannels', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + channelID: { + type: Sequelize.BIGINT + }, + guildID: { + type: Sequelize.BIGINT + }, + message: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('leaveChannels'); + } +}; \ No newline at end of file diff --git a/migrations/20200224133009-create-whitelist-word.js b/migrations/20200224133009-create-whitelist-word.js new file mode 100644 index 00000000..eac7351c --- /dev/null +++ b/migrations/20200224133009-create-whitelist-word.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('whitelistWords', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + word: { + type: Sequelize.STRING + }, + serverID: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('whitelistWords'); + } +}; \ No newline at end of file diff --git a/migrations/20200305204757-create-quotation-stat.js b/migrations/20200305204757-create-quotation-stat.js new file mode 100644 index 00000000..761e9add --- /dev/null +++ b/migrations/20200305204757-create-quotation-stat.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('quotationStats', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + serverID: { + type: Sequelize.BIGINT + }, + stat: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('quotationStats'); + } +}; \ No newline at end of file diff --git a/migrations/20200318011556-create-command-block.js b/migrations/20200318011556-create-command-block.js new file mode 100644 index 00000000..6c487f4d --- /dev/null +++ b/migrations/20200318011556-create-command-block.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('commandBlocks', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + serverID: { + type: Sequelize.BIGINT + }, + command: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('commandBlocks'); + } +}; \ No newline at end of file diff --git a/migrations/20200430005935-create-log-stats.js b/migrations/20200430005935-create-log-stats.js new file mode 100644 index 00000000..69bfacb5 --- /dev/null +++ b/migrations/20200430005935-create-log-stats.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('LogStats', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + guild: { + type: Sequelize.BIGINT + }, + channel: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('LogStats'); + } +}; \ No newline at end of file diff --git a/migrations/20200513062350-create-ytp-hash.js b/migrations/20200513062350-create-ytp-hash.js new file mode 100644 index 00000000..4a214066 --- /dev/null +++ b/migrations/20200513062350-create-ytp-hash.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('ytpHashes', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + hash: { + type: Sequelize.STRING + }, + link: { + type: Sequelize.STRING + }, + messageID: { + type: Sequelize.BIGINT + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('ytpHashes'); + } +}; \ No newline at end of file diff --git a/migrations/20210116075646-create-ytpblacklist.js b/migrations/20210116075646-create-ytpblacklist.js new file mode 100644 index 00000000..017905c4 --- /dev/null +++ b/migrations/20210116075646-create-ytpblacklist.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('ytpblacklists', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + userID: { + type: Sequelize.BIGINT + }, + reason: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('ytpblacklists'); + } +}; \ No newline at end of file diff --git a/migrations/20210313154536-create-blacklists.js b/migrations/20210313154536-create-blacklists.js new file mode 100644 index 00000000..2c4282fe --- /dev/null +++ b/migrations/20210313154536-create-blacklists.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.createTable('Blacklists', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + type: { + type: Sequelize.STRING + }, + uid: { + type: Sequelize.STRING + }, + reason: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: async (queryInterface, Sequelize) => { + await queryInterface.dropTable('Blacklists'); + } +}; \ No newline at end of file diff --git a/migrations/20210313170727-create-commandblockuser.js b/migrations/20210313170727-create-commandblockuser.js new file mode 100644 index 00000000..da039e4b --- /dev/null +++ b/migrations/20210313170727-create-commandblockuser.js @@ -0,0 +1,33 @@ +'use strict'; +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.createTable('commandblockusers', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + serverID: { + type: Sequelize.BIGINT + }, + userID: { + type: Sequelize.BIGINT + }, + command: { + type: Sequelize.STRING + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: async (queryInterface, Sequelize) => { + await queryInterface.dropTable('commandblockusers'); + } +}; \ No newline at end of file diff --git a/migrations/package.json b/migrations/package.json new file mode 100644 index 00000000..6a0d2ef2 --- /dev/null +++ b/migrations/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/models/autoresponse.js b/models/autoresponse.js new file mode 100644 index 00000000..b102d144 --- /dev/null +++ b/models/autoresponse.js @@ -0,0 +1,14 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const autoresponse = sequelize.define('autoresponse', { + trigger: DataTypes.STRING, + response: DataTypes.STRING, + type: DataTypes.STRING + }, {}); + autoresponse.associate = function(models) { + // associations can be defined here + }; + return autoresponse; +}; \ No newline at end of file diff --git a/models/autoresponsestat.js b/models/autoresponsestat.js new file mode 100644 index 00000000..cdd072dd --- /dev/null +++ b/models/autoresponsestat.js @@ -0,0 +1,13 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const autoresponseStat = sequelize.define('autoresponseStat', { + serverID: DataTypes.STRING, + stat: DataTypes.STRING + }, {}); + autoresponseStat.associate = function(models) { + // associations can be defined here + }; + return autoresponseStat; +}; \ No newline at end of file diff --git a/models/bannedwords.js b/models/bannedwords.js new file mode 100644 index 00000000..0e75c48f --- /dev/null +++ b/models/bannedwords.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const bannedWords = sequelize.define('bannedWords', { + word: DataTypes.STRING, + serverID: DataTypes.BIGINT + }, {}); + bannedWords.associate = function(models) { + // associations can be defined here + }; + return bannedWords; +}; \ No newline at end of file diff --git a/models/blacklists.js b/models/blacklists.js new file mode 100644 index 00000000..b26ff8ae --- /dev/null +++ b/models/blacklists.js @@ -0,0 +1,25 @@ +'use strict'; +const { + Model +} = require('sequelize'); +module.exports = (sequelize, DataTypes) => { + class Blacklists extends Model { + /** + * Helper method for defining associations. + * This method is not a part of Sequelize lifecycle. + * The `models/index` file will call this method automatically. + */ + static associate(models) { + // define association here + } + }; + Blacklists.init({ + type: DataTypes.STRING, + uid: DataTypes.STRING, + reason: DataTypes.STRING + }, { + sequelize, + modelName: 'Blacklists', + }); + return Blacklists; +}; \ No newline at end of file diff --git a/models/borgar.js b/models/borgar.js new file mode 100644 index 00000000..4ee8c193 --- /dev/null +++ b/models/borgar.js @@ -0,0 +1,12 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const borgar = sequelize.define('borgar', { + userID: DataTypes.BIGINT, + level: DataTypes.INTEGER, + xp: DataTypes.INTEGER + }, {}); + borgar.associate = function(models) { + // associations can be defined here + }; + return borgar; +}; \ No newline at end of file diff --git a/models/commandblock.js b/models/commandblock.js new file mode 100644 index 00000000..81cae7df --- /dev/null +++ b/models/commandblock.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const commandBlock = sequelize.define('commandBlock', { + serverID: DataTypes.BIGINT, + command: DataTypes.STRING + }, {}); + commandBlock.associate = function(models) { + // associations can be defined here + }; + return commandBlock; +}; \ No newline at end of file diff --git a/models/commandblockuser.js b/models/commandblockuser.js new file mode 100644 index 00000000..f600a792 --- /dev/null +++ b/models/commandblockuser.js @@ -0,0 +1,25 @@ +'use strict'; +const { + Model +} = require('sequelize'); +module.exports = (sequelize, DataTypes) => { + class commandblockuser extends Model { + /** + * Helper method for defining associations. + * This method is not a part of Sequelize lifecycle. + * The `models/index` file will call this method automatically. + */ + static associate(models) { + // define association here + } + }; + commandblockuser.init({ + serverID: DataTypes.BIGINT, + userID: DataTypes.BIGINT, + command: DataTypes.STRING + }, { + sequelize, + modelName: 'commandblockuser', + }); + return commandblockuser; +}; \ No newline at end of file diff --git a/models/donator.js b/models/donator.js new file mode 100644 index 00000000..a543ff94 --- /dev/null +++ b/models/donator.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const donator = sequelize.define('donator', { + userID: DataTypes.BIGINT, + comment: DataTypes.STRING + }, {}); + donator.associate = function(models) { + // associations can be defined here + }; + return donator; +}; \ No newline at end of file diff --git a/models/guessleaderboard.js b/models/guessleaderboard.js new file mode 100644 index 00000000..220b3af7 --- /dev/null +++ b/models/guessleaderboard.js @@ -0,0 +1,12 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const guessLeaderboard = sequelize.define('guessLeaderboard', { + memberID: DataTypes.INTEGER, + try: DataTypes.INTEGER, + difficulty: DataTypes.STRING + }, {}); + guessLeaderboard.associate = function(models) { + // associations can be defined here + }; + return guessLeaderboard; +}; \ No newline at end of file diff --git a/models/guildblacklist.js b/models/guildblacklist.js new file mode 100644 index 00000000..1498bd93 --- /dev/null +++ b/models/guildblacklist.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const guildBlacklist = sequelize.define('guildBlacklist', { + guildID: DataTypes.BIGINT + }, {}); + guildBlacklist.associate = function(models) { + // associations can be defined here + }; + return guildBlacklist; +}; \ No newline at end of file diff --git a/models/index.js b/models/index.js new file mode 100644 index 00000000..33f09e77 --- /dev/null +++ b/models/index.js @@ -0,0 +1,37 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const Sequelize = require('sequelize'); +const basename = path.basename(__filename); +const env = process.env.NODE_ENV || 'development'; +const config = require(__dirname + '/../config/config.json')[env]; +const db = {}; + +let sequelize; +if (config.use_env_variable) { + sequelize = new Sequelize(process.env[config.use_env_variable], config); +} else { + sequelize = new Sequelize(config.database, config.username, config.password, config); +} + +fs + .readdirSync(__dirname) + .filter(file => { + return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js'); + }) + .forEach(file => { + const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes); + db[model.name] = model; + }); + +Object.keys(db).forEach(modelName => { + if (db[modelName].associate) { + db[modelName].associate(db); + } +}); + +db.sequelize = sequelize; +db.Sequelize = Sequelize; + +module.exports = db; diff --git a/models/joinchannel.js b/models/joinchannel.js new file mode 100644 index 00000000..d5735e70 --- /dev/null +++ b/models/joinchannel.js @@ -0,0 +1,12 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const joinChannel = sequelize.define('joinChannel', { + channelID: DataTypes.BIGINT, + guildID: DataTypes.BIGINT, + message: DataTypes.STRING + }, {}); + joinChannel.associate = function(models) { + // associations can be defined here + }; + return joinChannel; +}; \ No newline at end of file diff --git a/models/leavechannel.js b/models/leavechannel.js new file mode 100644 index 00000000..d284f87f --- /dev/null +++ b/models/leavechannel.js @@ -0,0 +1,12 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const leaveChannel = sequelize.define('leaveChannel', { + channelID: DataTypes.BIGINT, + guildID: DataTypes.BIGINT, + message: DataTypes.STRING + }, {}); + leaveChannel.associate = function(models) { + // associations can be defined here + }; + return leaveChannel; +}; \ No newline at end of file diff --git a/models/logstats.js b/models/logstats.js new file mode 100644 index 00000000..eba9ca85 --- /dev/null +++ b/models/logstats.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const LogStats = sequelize.define('LogStats', { + guild: DataTypes.BIGINT, + channel: DataTypes.BIGINT + }, {}); + LogStats.associate = function(models) { + // associations can be defined here + }; + return LogStats; +}; \ No newline at end of file diff --git a/models/package.json b/models/package.json new file mode 100644 index 00000000..6a0d2ef2 --- /dev/null +++ b/models/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/models/quotationstat.js b/models/quotationstat.js new file mode 100644 index 00000000..a5545c6a --- /dev/null +++ b/models/quotationstat.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const quotationStat = sequelize.define('quotationStat', { + serverID: DataTypes.BIGINT, + stat: DataTypes.STRING + }, {}); + quotationStat.associate = function(models) { + // associations can be defined here + }; + return quotationStat; +}; \ No newline at end of file diff --git a/models/tag.js b/models/tag.js new file mode 100644 index 00000000..86d1c2ab --- /dev/null +++ b/models/tag.js @@ -0,0 +1,15 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable indent */ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const Tag = sequelize.define('Tag', { + trigger: DataTypes.STRING, + response: DataTypes.STRING, + ownerID: DataTypes.BIGINT, + serverID: DataTypes.BIGINT + }, {}); + Tag.associate = function(models) { + // associations can be defined here + }; + return Tag; +}; \ No newline at end of file diff --git a/models/twitterblacklist.js b/models/twitterblacklist.js new file mode 100644 index 00000000..56c0882b --- /dev/null +++ b/models/twitterblacklist.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const TwitterBlacklist = sequelize.define('TwitterBlacklist', { + userID: DataTypes.BIGINT, + reason: DataTypes.STRING + }, {}); + TwitterBlacklist.associate = function(models) { + // associations can be defined here + }; + return TwitterBlacklist; +}; \ No newline at end of file diff --git a/models/userblacklist.js b/models/userblacklist.js new file mode 100644 index 00000000..fd714771 --- /dev/null +++ b/models/userblacklist.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const userBlacklist = sequelize.define('userBlacklist', { + userID: DataTypes.BIGINT + }, {}); + userBlacklist.associate = function(models) { + // associations can be defined here + }; + return userBlacklist; +}; \ No newline at end of file diff --git a/models/whitelistword.js b/models/whitelistword.js new file mode 100644 index 00000000..d34fb62a --- /dev/null +++ b/models/whitelistword.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const whitelistWord = sequelize.define('whitelistWord', { + word: DataTypes.STRING, + serverID: DataTypes.BIGINT + }, {}); + whitelistWord.associate = function(models) { + // associations can be defined here + }; + return whitelistWord; +}; \ No newline at end of file diff --git a/models/ytpblacklist.js b/models/ytpblacklist.js new file mode 100644 index 00000000..921f359b --- /dev/null +++ b/models/ytpblacklist.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const ytpblacklist = sequelize.define('ytpblacklist', { + userID: DataTypes.BIGINT, + reason: DataTypes.STRING + }, {}); + ytpblacklist.associate = function(models) { + // associations can be defined here + }; + return ytpblacklist; +}; \ No newline at end of file diff --git a/models/ytphash.js b/models/ytphash.js new file mode 100644 index 00000000..f89aaadc --- /dev/null +++ b/models/ytphash.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = (sequelize, DataTypes) => { + const ytpHash = sequelize.define('ytpHash', { + hash: DataTypes.STRING, + messageID: DataTypes.BIGINT + }, {}); + ytpHash.associate = function(models) { + // associations can be defined here + }; + return ytpHash; +}; \ No newline at end of file