--
BEGIN;

--
ALTER TABLE messages ENABLE ROW LEVEL SECURITY;
CREATE POLICY "public can read messages" ON public.messages
  FOR SELECT TO anon
    USING (TRUE);
CREATE POLICY "public can write messages" ON "public"."messages" AS PERMISSIVE
  FOR INSERT TO public
    WITH CHECK (TRUE);
CREATE POLICY "public can update messages" ON "public"."messages" AS PERMISSIVE
  FOR UPDATE TO public
    USING (TRUE);
CREATE POLICY "public can delete messages" ON "public"."messages" AS PERMISSIVE
  FOR DELETE TO public
    USING (TRUE);
--

-- TODO: insert sample records
-- INSERT INTO visit_user_profile(title)
--   VALUES 
--   ('UNREAD'),
--   ('READ');

--
COMMIT;

--