-- REQ0041-home_discover_event_tab
--
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);
--
INSERT INTO messages(content, sender_user_id, receiver_user_id)
  VALUES 
  ('test message 1', 0 , 1),
  ('test message 2', 0 , 1),
  ('test message 3', 0 , 1),
  ('test message 4', 0 , 1),
  ('test message 5', 0 , 1),
  ('test message 6', 0 , 1),
  ('test message 7', 0 , 1),
  ('test message 8', 0 , 1),
  ('test message 9', 0 , 1),
  ('test message 10', 0 , 1);

--
COMMIT;

--