Initial commit of akmon project

This commit is contained in:
2026-01-20 08:04:15 +08:00
commit 77a2bab985
1309 changed files with 343305 additions and 0 deletions

19
fix_downlink_policy.sql Normal file
View 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);