diff --git a/_migrations/2022-02-09-041205_alter_tts_add_twitch/down.sql b/_migrations/2022-02-09-041205_alter_tts_add_twitch/down.sql index 79756b537e..6f51d20bd7 100644 --- a/_migrations/2022-02-09-041205_alter_tts_add_twitch/down.sql +++ b/_migrations/2022-02-09-041205_alter_tts_add_twitch/down.sql @@ -2,8 +2,9 @@ -- noinspection SqlNoDataSourceInspectionForFile -- noinspection SqlResolveForFile -ALTER TABLE tts_inference_jobs DROP COLUMN is_from_api; ALTER TABLE tts_inference_jobs DROP COLUMN is_for_twitch; +ALTER TABLE tts_inference_jobs DROP COLUMN is_from_api; +ALTER TABLE tts_inference_jobs DROP COLUMN priority_level; ALTER TABLE tts_results DROP COLUMN is_from_api; ALTER TABLE tts_results DROP COLUMN is_for_twitch; diff --git a/_migrations/2022-02-09-041205_alter_tts_add_twitch/up.sql b/_migrations/2022-02-09-041205_alter_tts_add_twitch/up.sql index 9b11252a06..efda373105 100644 --- a/_migrations/2022-02-09-041205_alter_tts_add_twitch/up.sql +++ b/_migrations/2022-02-09-041205_alter_tts_add_twitch/up.sql @@ -5,8 +5,16 @@ ALTER TABLE tts_inference_jobs ADD COLUMN is_from_api BOOLEAN NOT NULL DEFAULT FALSE AFTER creator_set_visibility, + ADD COLUMN is_for_twitch BOOLEAN NOT NULL DEFAULT FALSE - AFTER is_from_api; + AFTER is_from_api, + + -- Priority *increases*, so a level of 2 will be higher than 1. + -- By default, all jobs from FakeYou have level 0. + -- Twitch TTS has level 1. + -- Paid Twitch and Paid API have level 2. + ADD COLUMN priority_level TINYINT UNSIGNED NOT NULL DEFAULT 0 + AFTER status; ALTER TABLE tts_results ADD COLUMN is_from_api BOOLEAN NOT NULL DEFAULT FALSE diff --git a/_migrations_squashed/tts_tables/tts_inference_jobs.sql b/_migrations_squashed/tts_tables/tts_inference_jobs.sql index fa3658dac3..395790dc3c 100644 --- a/_migrations_squashed/tts_tables/tts_inference_jobs.sql +++ b/_migrations_squashed/tts_tables/tts_inference_jobs.sql @@ -84,7 +84,13 @@ CREATE TABLE tts_inference_jobs ( 'attempt_failed', 'dead') NOT NULL DEFAULT 'pending', - -- We can track this against a "max_attempt_count" + -- Priority *increases*, so a level of 2 will be higher than 1. + -- By default, all jobs from FakeYou have level 0. + -- Twitch TTS has level 1. + -- Paid Twitch and Paid API have level 2. + priority_level TINYINT UNSIGNED NOT NULL DEFAULT 0, + + -- We can track this against a "max_attempt_count" attempt_count INT(3) NOT NULL DEFAULT 0, -- If there is a failure, tell the user why.