Spaces:
Sleeping
Sleeping
Download backend/sql/037_user_music.sql from stylevoice/talk: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/spaces/stylevoice/talk/resolve/main/backend/sql/037_user_music.sql
- Command line
-
hf download hf://spaces/stylevoice/talk/backend/sql/037_user_music.sql
-
curl -L -o 037_user_music.sql https://huggingface.co/spaces/stylevoice/talk/resolve/main/backend/sql/037_user_music.sql
1.95 kB
| -- μ¬μ©μ λμ μμ± μμ (2026-05-20, BGM Phase 4). | |
| -- | |
| -- μμ λν "μ¬μ¦ μ€νμΌ 3곑 λ§λ€μ΄μ€" β λΉλκΈ° Lyria μμ± β κ°μΈ λΌμ΄λΈλ¬λ¦¬. | |
| -- κΈλ‘λ² μΉ΄νλ‘κ·Έ(music_themes)μ λ³κ° β μ¬μ©μ μμ . μ¬μ κ²½λ‘λ λμΌνκ² | |
| -- 'music' λ²ν· signed URL μλΉ (GPU/API 0). | |
| -- | |
| -- abuse λ°©μ§: μ¬μ©μλ³ μΌμΌ μμ± cap (λ°±μλ user_music_service μμ created_at μΉ΄μ΄νΈ). | |
| -- status: generating(Lyria νΈμΆ μ€) β ready(νμΌ μμ) β failed(μ¬μλ λμ). | |
| -- | |
| -- νκ· 0: μ κ· ν μ΄λΈ. RLS owner read/write (λ°±μλ service_role + user_id νν° λ³ν). | |
| CREATE TABLE IF NOT EXISTS public.user_music ( | |
| id uuid PRIMARY KEY DEFAULT gen_random_uuid(), | |
| user_id uuid NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE, | |
| title text NOT NULL DEFAULT '', | |
| prompt text NOT NULL DEFAULT '', | |
| mood_tags text[] NOT NULL DEFAULT '{}', | |
| seed bigint, | |
| storage_path text, -- 'music' λ²ν· μλ κ²½λ‘ (ready μ) | |
| duration_sec real, | |
| bpm real, | |
| lufs real, | |
| status text NOT NULL DEFAULT 'generating' | |
| CHECK (status IN ('generating', 'ready', 'failed')), | |
| error_detail text, | |
| created_at timestamptz NOT NULL DEFAULT now() | |
| ); | |
| CREATE INDEX IF NOT EXISTS user_music_user_idx | |
| ON public.user_music (user_id, created_at DESC); | |
| CREATE INDEX IF NOT EXISTS user_music_mood_idx | |
| ON public.user_music USING gin (mood_tags); | |
| ALTER TABLE public.user_music ENABLE ROW LEVEL SECURITY; | |
| DROP POLICY IF EXISTS user_music_owner ON public.user_music; | |
| CREATE POLICY user_music_owner ON public.user_music | |
| FOR ALL USING (user_id = auth.uid()) WITH CHECK (user_id = auth.uid()); | |
| COMMENT ON TABLE public.user_music IS | |
| 'μ¬μ©μ λμ μμ± μμ (Lyria + auto-loop). κ°μΈ λΌμ΄λΈλ¬λ¦¬. μ¬μ=Storage signed URL.'; | |