/** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function(knex) { return knex.schema .createTable('counters', table => { table.string('key').notNullable(); table.string('name').notNullable(); table.string('emoji').notNullable(); table.integer('value').defaultTo(0); table.string('channel').notNullable(); table.string('guild').notNullable(); table.string('message'); table.string('messageTemplate'); table.boolean('allowlistConsumer'); table.boolean('allowlistProducer'); }) .createTable('counterUserLink', table => { table.string('key').references('key').inTable('counters'); table.string('user').notNullable(); table.boolean('producer'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function(knex) { return knex.schema .dropTable('counters') .dropTable('counterUserLink'); };