From f36b6efb073ab08bdd22478af9dded6d0e781497 Mon Sep 17 00:00:00 2001 From: David Sevilla Martin <6401250+dsevillamartin@users.noreply.github.com> Date: Sun, 3 Mar 2024 13:53:19 -0500 Subject: [PATCH] db: migrations > remove discord 'name' column from guilds & channels --- .../2024_03_03_000000_remove_discord_names.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 db/migrations/2024_03_03_000000_remove_discord_names.js diff --git a/db/migrations/2024_03_03_000000_remove_discord_names.js b/db/migrations/2024_03_03_000000_remove_discord_names.js new file mode 100644 index 0000000..c8cdd0d --- /dev/null +++ b/db/migrations/2024_03_03_000000_remove_discord_names.js @@ -0,0 +1,10 @@ +exports.up = async (knex) => + knex.transaction(async (trx) => { + await trx.raw('ALTER TABLE channels DROP COLUMN name'); + await trx.raw('ALTER TABLE guilds DROP COLUMN name'); + }); + +exports.down = async (knex) => { + await knex.schema.table('channels', (table) => table.string('name')); + await knex.schema.table('guilds', (table) => table.string('name')); +};