-- 129_playlist_editorial.sql
-- v0.10.4 F141/F136: Editorial playlists, Favoris flag

ALTER TABLE public.playlists ADD COLUMN IF NOT EXISTS is_editorial BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE public.playlists ADD COLUMN IF NOT EXISTS is_default_favorites BOOLEAN NOT NULL DEFAULT false;

CREATE INDEX IF NOT EXISTS idx_playlists_is_editorial ON public.playlists(is_editorial) WHERE is_editorial = true;
CREATE INDEX IF NOT EXISTS idx_playlists_is_default_favorites ON public.playlists(user_id, is_default_favorites) WHERE is_default_favorites = true;

COMMENT ON COLUMN public.playlists.is_editorial IS 'v0.10.4 F141: Curatorial playlist visible in Discover, editable by admin/mod only';
COMMENT ON COLUMN public.playlists.is_default_favorites IS 'v0.10.4 F136: Auto-created Favoris playlist per user';
