From b540821a326325951a89e5dbc128eaed7c41fb3c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 6 Nov 2023 20:25:10 +0100 Subject: [PATCH] Fixed migration scripts --- bot/src/bot_data/migration/fix_user_history_migration.py | 8 ++------ .../bot_data/migration/steam_special_offer_migration.py | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bot/src/bot_data/migration/fix_user_history_migration.py b/bot/src/bot_data/migration/fix_user_history_migration.py index b39ec429..1aec1fa0 100644 --- a/bot/src/bot_data/migration/fix_user_history_migration.py +++ b/bot/src/bot_data/migration/fix_user_history_migration.py @@ -17,14 +17,10 @@ class FixUserHistoryMigration(MigrationABC): # fix 1.1.0_AchievementsMigration self._cursor.execute( - str( - f"""ALTER TABLE UsersHistory ADD COLUMN IF NOT EXISTS ReactionCount BIGINT NOT NULL DEFAULT 0 AFTER XP;""" - ) + str(f"""ALTER TABLE UsersHistory ADD COLUMN ReactionCount BIGINT NOT NULL DEFAULT 0 AFTER XP;""") ) self._cursor.execute( - str( - f"""ALTER TABLE UsersHistory ADD COLUMN IF NOT EXISTS MessageCount BIGINT NOT NULL DEFAULT 0 AFTER ReactionCount;""" - ) + str(f"""ALTER TABLE UsersHistory ADD COLUMN MessageCount BIGINT NOT NULL DEFAULT 0 AFTER ReactionCount;""") ) self._exec(__file__, "users.sql") diff --git a/bot/src/bot_data/migration/steam_special_offer_migration.py b/bot/src/bot_data/migration/steam_special_offer_migration.py index 18813ae7..0a35e77d 100644 --- a/bot/src/bot_data/migration/steam_special_offer_migration.py +++ b/bot/src/bot_data/migration/steam_special_offer_migration.py @@ -36,7 +36,7 @@ class SteamSpecialOfferMigration(MigrationABC): str( f""" ALTER TABLE CFG_Server - ADD COLUMN IF NOT EXISTS GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest; + ADD COLUMN GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest; """ ) ) @@ -45,7 +45,7 @@ class SteamSpecialOfferMigration(MigrationABC): str( f""" ALTER TABLE CFG_ServerHistory - ADD COLUMN IF NOT EXISTS GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest; + ADD COLUMN GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest; """ ) )