3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add repository+model for mutes

This commit is contained in:
Dragory 2018-07-07 17:03:13 +03:00
parent 55215dc382
commit 2ac8984792
3 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,17 @@
exports.up = async function(knex) {
if (! await knex.schema.hasTable('mutes')) {
await knex.schema.createTable('mutes', table => {
table.bigInteger('guild_id').unsigned().notNullable();
table.bigInteger('user_id').unsigned().notNullable();
table.dateTime('created_at');
table.dateTime('expires_at');
table.primary(['guild_id', 'user_id']);
table.index(['expires_at']);
});
}
};
exports.down = async function(knex) {
await knex.schema.dropTableIfExists('mutes');
};