From 2c96aa5aafa7cc7650ed91e6d00729b44603767e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 12 Nov 2025 05:46:15 +0000 Subject: [PATCH] Add rating column to ethos_tracks table cgen-3560d4cfc90a45ed8bd4d672140e9895 --- .../20250216_add_rating_to_ethos_tracks.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 supabase/migrations/20250216_add_rating_to_ethos_tracks.sql diff --git a/supabase/migrations/20250216_add_rating_to_ethos_tracks.sql b/supabase/migrations/20250216_add_rating_to_ethos_tracks.sql new file mode 100644 index 00000000..cd4c9698 --- /dev/null +++ b/supabase/migrations/20250216_add_rating_to_ethos_tracks.sql @@ -0,0 +1,16 @@ +-- Add rating column to ethos_tracks table +-- Allows artists and users to rate tracks on a scale of 1-5 + +ALTER TABLE public.ethos_tracks +ADD COLUMN IF NOT EXISTS rating numeric(2, 1) DEFAULT 5.0; + +-- Add price column for commercial tracks +ALTER TABLE public.ethos_tracks +ADD COLUMN IF NOT EXISTS price numeric(10, 2); + +-- Create index on rating for efficient sorting +CREATE INDEX IF NOT EXISTS idx_ethos_tracks_rating ON public.ethos_tracks(rating DESC); + +-- Add comment +COMMENT ON COLUMN public.ethos_tracks.rating IS 'Track rating from 1.0 to 5.0 based on user reviews. Defaults to 5.0 for new tracks.'; +COMMENT ON COLUMN public.ethos_tracks.price IS 'Price in USD for commercial licensing of the track. NULL if not for sale.';