diff --git a/migrations/3 - TTS.sql b/migrations/3 - TTS.sql index c66a8f7..6528d36 100644 --- a/migrations/3 - TTS.sql +++ b/migrations/3 - TTS.sql @@ -1,4 +1,9 @@ -- Add ttsOverride column to the accounts table -ALTER TABLE 'accounts' ADD COLUMN IF NOT EXISTS 'ttsOverride' INTEGER NOT NULL DEFAULT 0; +SELECT COUNT(*) +FROM pragma_table_info('accounts') +WHERE name = 'ttsOverride'; + +-- Step 2: If the count is 0, add the 'cooldown' column +ALTER TABLE accounts ADD COLUMN ttsOverride TEXT INTEGER NOT NULL DEFAULT 0; -- Retroactively set ttsOverride to 0 for all accounts that dont have it set at all UPDATE 'accounts' SET 'ttsOverride' = 0 WHERE 'ttsOverride' IS NULL; \ No newline at end of file diff --git a/migrations/4 - Add Cooldown.sql b/migrations/4 - Add Cooldown.sql index 5ee2637..85de514 100644 --- a/migrations/4 - Add Cooldown.sql +++ b/migrations/4 - Add Cooldown.sql @@ -1,2 +1,9 @@ -- Add ttsOverride column to the accounts table -ALTER TABLE 'accounts' ADD COLUMN IF NOT EXISTS 'cooldown' TEXT; \ No newline at end of file +--ALTER TABLE 'accounts' ADD COLUMN 'cooldown' TEXT; +-- Step 1: Check if 'cooldown' column exists in 'accounts' table +SELECT COUNT(*) +FROM pragma_table_info('accounts') +WHERE name = 'cooldown'; + +-- Step 2: If the count is 0, add the 'cooldown' column +ALTER TABLE accounts ADD COLUMN cooldown TEXT;