From 3ca1744c27ce0bc2ed2eb64a5f41ebcb2c591f6a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 18 Feb 2014 13:40:13 +0000 Subject: [PATCH] * VRFS-1135 make plays and recordings and sessions unique for user/model combo --- db/up/plays_likes_counters.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/up/plays_likes_counters.sql b/db/up/plays_likes_counters.sql index 8ec9dc9dc..05c636bd7 100644 --- a/db/up/plays_likes_counters.sql +++ b/db/up/plays_likes_counters.sql @@ -1,4 +1,8 @@ ALTER TABLE recordings ADD COLUMN play_count INTEGER NOT NULL DEFAULT 0; ALTER TABLE music_sessions_history ADD COLUMN play_count INTEGER NOT NULL DEFAULT 0; ALTER TABLE recordings ADD COLUMN like_count INTEGER NOT NULL DEFAULT 0; -ALTER TABLE music_sessions_history ADD COLUMN like_count INTEGER NOT NULL DEFAULT 0; \ No newline at end of file +ALTER TABLE music_sessions_history ADD COLUMN like_count INTEGER NOT NULL DEFAULT 0; + +CREATE INDEX music_sessions_plays_uniqkey ON music_sessions_plays (player_id, music_session_id); +CREATE INDEX recordings_plays_uniqkey ON recordings_plays (player_id, recording_id); +