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

Add Tags plugin

This commit is contained in:
Dragory 2018-08-05 01:32:59 +03:00
parent 54b79ca51f
commit 4a1a14be59
6 changed files with 158 additions and 5 deletions

View file

@ -0,0 +1,17 @@
exports.up = async function(knex) {
if (! await knex.schema.hasTable('tags')) {
await knex.schema.createTable('tags', table => {
table.bigInteger('guild_id').unsigned().notNullable();
table.string('tag', 64).notNullable();
table.bigInteger('user_id').unsigned().notNullable();
table.text('body').notNullable();
table.dateTime('created_at').defaultTo(knex.raw('NOW()'));
table.primary(['guild_id', 'tag']);
});
}
};
exports.down = async function(knex) {
await knex.schema.dropTableIfExists('tags');
};