Initial commit of akmon project
This commit is contained in:
19
fix_downlink_policy.sql
Normal file
19
fix_downlink_policy.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Fix for "new row violates row-level security policy for table chat_mqtt_downlinks"
|
||||
-- Run this in Supabase SQL Editor
|
||||
|
||||
-- 1. Enable RLS (if not already)
|
||||
ALTER TABLE chat_mqtt_downlinks ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
-- 2. Allow authenticated users (logged in users) to INSERT
|
||||
CREATE POLICY "Allow insert for authenticated users"
|
||||
ON chat_mqtt_downlinks
|
||||
FOR INSERT
|
||||
TO authenticated
|
||||
WITH CHECK (true);
|
||||
|
||||
-- 3. Allow authenticated users to SELECT (to see their own inserts or all)
|
||||
CREATE POLICY "Allow select for authenticated users"
|
||||
ON chat_mqtt_downlinks
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (true);
|
||||
Reference in New Issue
Block a user