From c3beb9861cd662218eea10500f2f72d87d73cd0d Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Thu, 3 Aug 2023 01:41:21 +1000 Subject: [PATCH] Series improvements --- gatherling/admin/db-upgrade.php | 6 ++++++ gatherling/api_lib.php | 6 ++++-- gatherling/models/Series.php | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gatherling/admin/db-upgrade.php b/gatherling/admin/db-upgrade.php index 8c051626..92a1b5fd 100644 --- a/gatherling/admin/db-upgrade.php +++ b/gatherling/admin/db-upgrade.php @@ -813,6 +813,12 @@ function redirect_deck_update($latest_id = 0) do_query('ALTER TABLE `players` CHANGE COLUMN `discord_id` `discord_id` VARCHAR(20) NULL DEFAULT NULL AFTER `theme`;'); }); +upgrade_db(50, 'Fix series discord fields', function () { + do_query('ALTER TABLE `series` + CHANGE COLUMN `discord_guild_id` `discord_guild_id` VARCHAR(20) NULL DEFAULT NULL AFTER `mtgo_room`, + ADD COLUMN `discord_channel_id` VARCHAR(20) NULL DEFAULT NULL AFTER `discord_guild_id`, + CHANGE COLUMN `discord_require_membership` `discord_require_membership` INT NULL DEFAULT NULL AFTER `discord_guild_invite`;'); +}); $db->autocommit(true); info('DB is up to date!'); diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 58db7719..18b2e98f 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -1,5 +1,7 @@ prepare($sql); $stmt or exit($db->error); $stmt->bind_param('s', $name); @@ -58,6 +59,7 @@ public function __construct($name) $this->prereg_default, $this->mtgo_room, $this->discord_guild_id, + $this->discord_channel_id, $this->discord_channel_name, $this->discord_guild_name, $this->discord_guild_invite,