You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b25014
Browse filesBrowse the repository at this point in the historyBrowse files
fix: commit the reconcile migration policy guards (#7)
The previous commit message claimed this but housekeeping reverted the file
before it was committed - caught by an independent trail audit. Staging is
unaffected (it applied the guarded file from disk during the release push);
this makes fresh database chains from the repo apply cleanly too.
DROP POLICY IF EXISTS "Authenticated users can read active curated sources"ON"public"."curated_sources";
38
39
CREATE POLICY "Authenticated users can read active curated sources"ON"public"."curated_sources" FOR SELECT TO authenticated USING (is_active = true);
40
+
DROP POLICY IF EXISTS "Admins can insert curated sources"ON"public"."curated_sources";
39
41
CREATE POLICY "Admins can insert curated sources"ON"public"."curated_sources" FOR INSERT TO authenticated
40
42
WITH CHECK (EXISTS (SELECT1FROMpublic.user_rolesWHEREuser_roles.user_id= (SELECTauth.uid()) ANDuser_roles.role='admin'::text));
43
+
DROP POLICY IF EXISTS "Admins can update curated sources"ON"public"."curated_sources";
41
44
CREATE POLICY "Admins can update curated sources"ON"public"."curated_sources" FOR UPDATE TO authenticated
42
45
USING (EXISTS (SELECT1FROMpublic.user_rolesWHEREuser_roles.user_id= (SELECTauth.uid()) ANDuser_roles.role='admin'::text));
46
+
DROP POLICY IF EXISTS "Admins can delete curated sources"ON"public"."curated_sources";
43
47
CREATE POLICY "Admins can delete curated sources"ON"public"."curated_sources" FOR DELETE TO authenticated
44
48
USING (EXISTS (SELECT1FROMpublic.user_rolesWHEREuser_roles.user_id= (SELECTauth.uid()) ANDuser_roles.role='admin'::text));
45
49
GRANT ALL ON TABLE "public"."curated_sources" TO anon, authenticated, service_role;
@@ -105,6 +109,7 @@ CREATE INDEX IF NOT EXISTS "idx_evidence_cards_tags" ON "public"."evidence_cards
105
109
CREATEINDEXIF NOT EXISTS "idx_evidence_cards_user_id"ON"public"."evidence_cards" USING btree (user_id);
106
110
CREATE OR REPLACETRIGGER "evidence_cards_set_updated_at" BEFORE UPDATEON"public"."evidence_cards" FOR EACH ROW EXECUTE FUNCTION "public"."set_updated_at"();
DROP POLICY IF EXISTS "keepalive_heartbeat_anon_insert"ON"public"."keepalive_heartbeat";
155
164
CREATE POLICY "keepalive_heartbeat_anon_insert"ON"public"."keepalive_heartbeat" FOR INSERT TO anon WITH CHECK (id = ANY (ARRAY['external-keepalive'::text, 'rpc-keepalive'::text]));
165
+
DROP POLICY IF EXISTS "keepalive_heartbeat_anon_select"ON"public"."keepalive_heartbeat";
156
166
CREATE POLICY "keepalive_heartbeat_anon_select"ON"public"."keepalive_heartbeat" FOR SELECT TO anon USING (id = ANY (ARRAY['external-keepalive'::text, 'rpc-keepalive'::text]));
167
+
DROP POLICY IF EXISTS "keepalive_heartbeat_anon_update"ON"public"."keepalive_heartbeat";
157
168
CREATE POLICY "keepalive_heartbeat_anon_update"ON"public"."keepalive_heartbeat" FOR UPDATE TO anon
158
169
USING (id = ANY (ARRAY['external-keepalive'::text, 'rpc-keepalive'::text])) WITH CHECK (id = ANY (ARRAY['external-keepalive'::text, 'rpc-keepalive'::text]));
159
170
GRANT ALL ON TABLE "public"."keepalive_heartbeat" TO anon, authenticated, service_role;
0 commit comments