Models and migration for sequelize
This commit is contained in:
parent
50aecd546a
commit
c52b19a678
43 changed files with 932 additions and 0 deletions
38
migrations/20190707001840-create-tag.js
Normal file
38
migrations/20190707001840-create-tag.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
35
migrations/20190708171608-create-autoresponse.js
Normal file
35
migrations/20190708171608-create-autoresponse.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
32
migrations/20190708171617-create-autoresponse-stat.js
Normal file
32
migrations/20190708171617-create-autoresponse-stat.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20190728145741-create-guess-leaderboard.js
Normal file
33
migrations/20190728145741-create-guess-leaderboard.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20190821164402-create-banned-words.js
Normal file
30
migrations/20190821164402-create-banned-words.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20191006180114-create-twitter-blacklist.js
Normal file
30
migrations/20191006180114-create-twitter-blacklist.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
27
migrations/20191006181945-create-guild-blacklist.js
Normal file
27
migrations/20191006181945-create-guild-blacklist.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
27
migrations/20191006181953-create-user-blacklist.js
Normal file
27
migrations/20191006181953-create-user-blacklist.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20191008230533-create-borgar.js
Normal file
33
migrations/20191008230533-create-borgar.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20191026223359-create-donator.js
Normal file
30
migrations/20191026223359-create-donator.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20191127105740-create-join-channel.js
Normal file
33
migrations/20191127105740-create-join-channel.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20191127105810-create-leave-channel.js
Normal file
33
migrations/20191127105810-create-leave-channel.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20200224133009-create-whitelist-word.js
Normal file
30
migrations/20200224133009-create-whitelist-word.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20200305204757-create-quotation-stat.js
Normal file
30
migrations/20200305204757-create-quotation-stat.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20200318011556-create-command-block.js
Normal file
30
migrations/20200318011556-create-command-block.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20200430005935-create-log-stats.js
Normal file
30
migrations/20200430005935-create-log-stats.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20200513062350-create-ytp-hash.js
Normal file
33
migrations/20200513062350-create-ytp-hash.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
30
migrations/20210116075646-create-ytpblacklist.js
Normal file
30
migrations/20210116075646-create-ytpblacklist.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20210313154536-create-blacklists.js
Normal file
33
migrations/20210313154536-create-blacklists.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
33
migrations/20210313170727-create-commandblockuser.js
Normal file
33
migrations/20210313170727-create-commandblockuser.js
Normal file
|
@ -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');
|
||||
}
|
||||
};
|
3
migrations/package.json
Normal file
3
migrations/package.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
14
models/autoresponse.js
Normal file
14
models/autoresponse.js
Normal file
|
@ -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;
|
||||
};
|
13
models/autoresponsestat.js
Normal file
13
models/autoresponsestat.js
Normal file
|
@ -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;
|
||||
};
|
11
models/bannedwords.js
Normal file
11
models/bannedwords.js
Normal file
|
@ -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;
|
||||
};
|
25
models/blacklists.js
Normal file
25
models/blacklists.js
Normal file
|
@ -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;
|
||||
};
|
12
models/borgar.js
Normal file
12
models/borgar.js
Normal file
|
@ -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;
|
||||
};
|
11
models/commandblock.js
Normal file
11
models/commandblock.js
Normal file
|
@ -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;
|
||||
};
|
25
models/commandblockuser.js
Normal file
25
models/commandblockuser.js
Normal file
|
@ -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;
|
||||
};
|
11
models/donator.js
Normal file
11
models/donator.js
Normal file
|
@ -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;
|
||||
};
|
12
models/guessleaderboard.js
Normal file
12
models/guessleaderboard.js
Normal file
|
@ -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;
|
||||
};
|
10
models/guildblacklist.js
Normal file
10
models/guildblacklist.js
Normal file
|
@ -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;
|
||||
};
|
37
models/index.js
Normal file
37
models/index.js
Normal file
|
@ -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;
|
12
models/joinchannel.js
Normal file
12
models/joinchannel.js
Normal file
|
@ -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;
|
||||
};
|
12
models/leavechannel.js
Normal file
12
models/leavechannel.js
Normal file
|
@ -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;
|
||||
};
|
11
models/logstats.js
Normal file
11
models/logstats.js
Normal file
|
@ -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;
|
||||
};
|
3
models/package.json
Normal file
3
models/package.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
11
models/quotationstat.js
Normal file
11
models/quotationstat.js
Normal file
|
@ -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;
|
||||
};
|
15
models/tag.js
Normal file
15
models/tag.js
Normal file
|
@ -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;
|
||||
};
|
11
models/twitterblacklist.js
Normal file
11
models/twitterblacklist.js
Normal file
|
@ -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;
|
||||
};
|
10
models/userblacklist.js
Normal file
10
models/userblacklist.js
Normal file
|
@ -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;
|
||||
};
|
11
models/whitelistword.js
Normal file
11
models/whitelistword.js
Normal file
|
@ -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;
|
||||
};
|
11
models/ytpblacklist.js
Normal file
11
models/ytpblacklist.js
Normal file
|
@ -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;
|
||||
};
|
11
models/ytphash.js
Normal file
11
models/ytphash.js
Normal file
|
@ -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;
|
||||
};
|
Loading…
Reference in a new issue