From 5461a6d8dc5b903cbc94613147353ffe196b8c68 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 10 Nov 2023 13:25:28 +0100 Subject: [PATCH] Added 0.3.1 migration scripts #428 --- bot/src/bot_data/scripts/0.3.0/AutoRoleFix_down.sql | 4 ++++ bot/src/bot_data/scripts/0.3.0/AutoRoleFix_up.sql | 4 ++++ .../scripts/0.3.1/UserMessageCountPerHour_down.sql | 2 ++ .../scripts/0.3.1/UserMessageCountPerHour_up.sql | 13 +++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 bot/src/bot_data/scripts/0.3.0/AutoRoleFix_down.sql create mode 100644 bot/src/bot_data/scripts/0.3.0/AutoRoleFix_up.sql create mode 100644 bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_down.sql create mode 100644 bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_up.sql diff --git a/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_down.sql b/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_down.sql new file mode 100644 index 00000000..60e77292 --- /dev/null +++ b/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_down.sql @@ -0,0 +1,4 @@ + +ALTER TABLE AutoRoles DROP COLUMN DiscordChannelId; + + diff --git a/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_up.sql b/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_up.sql new file mode 100644 index 00000000..f025af10 --- /dev/null +++ b/bot/src/bot_data/scripts/0.3.0/AutoRoleFix_up.sql @@ -0,0 +1,4 @@ + +ALTER TABLE AutoRoles ADD DiscordChannelId BIGINT NOT NULL AFTER ServerId; + + diff --git a/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_down.sql b/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_down.sql new file mode 100644 index 00000000..3de96768 --- /dev/null +++ b/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_down.sql @@ -0,0 +1,2 @@ +DROP TABLE `UserMessageCountPerHour`; + diff --git a/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_up.sql b/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_up.sql new file mode 100644 index 00000000..024bed4b --- /dev/null +++ b/bot/src/bot_data/scripts/0.3.1/UserMessageCountPerHour_up.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS `UserMessageCountPerHour` ( + `Id` BIGINT NOT NULL AUTO_INCREMENT, + `Date` DATETIME(6) NOT NULL, + `Hour` BIGINT, + `XPCount` BIGINT, + `UserId` BIGINT, + `CreatedAt` DATETIME(6), + `LastModifiedAt` DATETIME(6), + PRIMARY KEY(`Id`), + FOREIGN KEY (`UserId`) REFERENCES `Users`(`UserId`) +); + +