Add rating column to ethos_tracks table
cgen-3560d4cfc90a45ed8bd4d672140e9895
This commit is contained in:
parent
82eaaf70d1
commit
2c96aa5aaf
1 changed files with 16 additions and 0 deletions
16
supabase/migrations/20250216_add_rating_to_ethos_tracks.sql
Normal file
16
supabase/migrations/20250216_add_rating_to_ethos_tracks.sql
Normal file
|
|
@ -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.';
|
||||
Loading…
Reference in a new issue