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:
parent
54b79ca51f
commit
4a1a14be59
6 changed files with 158 additions and 5 deletions
17
migrations/20180805011100_create_tags_table.js
Normal file
17
migrations/20180805011100_create_tags_table.js
Normal 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');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue