mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Add repository+model for mutes
This commit is contained in:
parent
55215dc382
commit
2ac8984792
3 changed files with 103 additions and 0 deletions
17
migrations/20180707152000_create_mutes_table.js
Normal file
17
migrations/20180707152000_create_mutes_table.js
Normal 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');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue