diff --git a/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/down.sql b/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/down.sql new file mode 100644 index 0000000000..176e9529d6 --- /dev/null +++ b/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/down.sql @@ -0,0 +1,7 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE tts_models DROP COLUMN user_ratings_total_count; +ALTER TABLE tts_models DROP COLUMN user_ratings_positive_count; +ALTER TABLE tts_models DROP COLUMN user_ratings_negative_count; diff --git a/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/up.sql b/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/up.sql new file mode 100644 index 0000000000..744f35db9f --- /dev/null +++ b/_migrations/2023-01-26-050626_alter_tts_models_add_user_ratings/up.sql @@ -0,0 +1,16 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +-- Total count only includes "positive" and "negative" votes, not neutral ones. +ALTER TABLE tts_models + ADD COLUMN user_ratings_total_count INT(10) UNSIGNED NOT NULL DEFAULT 0 + AFTER private_bucket_object_is_archive; + +ALTER TABLE tts_models + ADD COLUMN user_ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0 + AFTER user_ratings_total_count; + +ALTER TABLE tts_models + ADD COLUMN user_ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0 + AFTER user_ratings_positive_count; diff --git a/_migrations_squashed/tts_tables/tts_models.sql b/_migrations_squashed/tts_tables/tts_models.sql index acaaa5f122..add0c2c4d9 100644 --- a/_migrations_squashed/tts_tables/tts_models.sql +++ b/_migrations_squashed/tts_tables/tts_models.sql @@ -162,6 +162,11 @@ CREATE TABLE tts_models ( -- calculated_total_ratings_submitted_count INT(10) NOT NULL DEFAULT 0, -- calculated_total_uses_count BIGINT(10) NOT NULL DEFAULT 0, + -- Total count only includes "positive" and "negative" votes, not neutral ones. + user_ratings_total_count INT(10) UNSIGNED NOT NULL DEFAULT 0, + user_ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0, + user_ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0, + -- ========== MODERATION DETAILS ========== -- Mods have to approve of tts models for them to show up in a public index.