From bf7c96962945ec256122e0c0a676efe8803edb9a Mon Sep 17 00:00:00 2001 From: Esa Kataja Date: Mon, 5 May 2025 18:30:22 +0300 Subject: [PATCH] CHANGE sql schema --- src/lib/database.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/database.sql b/src/lib/database.sql index 081dcdf..2d50e08 100644 --- a/src/lib/database.sql +++ b/src/lib/database.sql @@ -91,7 +91,7 @@ CREATE TABLE Review ( song_id INTEGER NOT NULL, -- Foreign Key -> Song.id score_song INTEGER NOT NULL, -- Score (1-100) for song quality score_show INTEGER NOT NULL, -- Score (1-100) for the stage show - score_wardrobe INTEGER NOT NULL, -- Score (1-100) for wardrobe/costumes + score_costume INTEGER NOT NULL, -- Score (1-100) for wardrobe/costumes text_review VARCHAR, -- Optional textual comments (nullable) created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Timestamp when the review was created updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Timestamp when the review was last modified @@ -102,7 +102,7 @@ CREATE TABLE Review ( -- Ensure scores are within the valid range (1-100) CHECK (score_song >= 1 AND score_song <= 100), CHECK (score_show >= 1 AND score_show <= 100), - CHECK (score_wardrobe >= 1 AND score_wardrobe <= 100), + CHECK (score_costume >= 1 AND score_costume <= 100), -- Ensure each user can only submit one review per song UNIQUE (user_id, song_id)