-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathschema_part3.sql
More file actions
602 lines (394 loc) · 22 KB
/
Copy pathschema_part3.sql
File metadata and controls
602 lines (394 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
-- Name: options Options are viewable by authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Options are viewable by authenticated users" ON public.options FOR SELECT TO authenticated USING (true);
--
-- Name: profiles Profiles are viewable by all authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Profiles are viewable by all authenticated users" ON public.profiles FOR SELECT TO authenticated USING (true);
--
-- Name: question_tags Question tags are viewable by authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Question tags are viewable by authenticated users" ON public.question_tags FOR SELECT TO authenticated USING (true);
--
-- Name: questions Questions are viewable by authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Questions are viewable by authenticated users" ON public.questions FOR SELECT TO authenticated USING (true);
--
-- Name: attempt_answers Students can insert their own attempt answers; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Students can insert their own attempt answers" ON public.attempt_answers FOR INSERT TO authenticated WITH CHECK ((EXISTS ( SELECT 1
FROM public.test_attempts
WHERE ((test_attempts.id = attempt_answers.attempt_id) AND (test_attempts.student_id = ( SELECT auth.uid() AS uid))))));
--
-- Name: test_attempts Students can insert their own test attempts; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Students can insert their own test attempts" ON public.test_attempts FOR INSERT TO authenticated WITH CHECK ((student_id = ( SELECT auth.uid() AS uid)));
--
-- Name: attempt_answers Students can update their own attempt answers; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Students can update their own attempt answers" ON public.attempt_answers FOR UPDATE TO authenticated USING ((EXISTS ( SELECT 1
FROM public.test_attempts
WHERE ((test_attempts.id = attempt_answers.attempt_id) AND (test_attempts.student_id = ( SELECT auth.uid() AS uid)))))) WITH CHECK ((EXISTS ( SELECT 1
FROM public.test_attempts
WHERE ((test_attempts.id = attempt_answers.attempt_id) AND (test_attempts.student_id = ( SELECT auth.uid() AS uid))))));
--
-- Name: test_attempts Students can update their own test attempts; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Students can update their own test attempts" ON public.test_attempts FOR UPDATE TO authenticated USING ((student_id = ( SELECT auth.uid() AS uid))) WITH CHECK ((student_id = ( SELECT auth.uid() AS uid)));
--
-- Name: tags Tags are viewable by authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Tags are viewable by authenticated users" ON public.tags FOR SELECT TO authenticated USING (true);
--
-- Name: test_attempts Test attempts are viewable by student and recruiter; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Test attempts are viewable by student and recruiter" ON public.test_attempts FOR SELECT TO authenticated USING (((student_id = ( SELECT auth.uid() AS uid)) OR (EXISTS ( SELECT 1
FROM public.tests
WHERE ((tests.id = test_attempts.test_id) AND (tests.recruiter_id = ( SELECT auth.uid() AS uid)))))));
--
-- Name: tests Tests are viewable by authenticated users; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Tests are viewable by authenticated users" ON public.tests FOR SELECT TO authenticated USING (true);
--
-- Name: candidate_profiles Users can delete their own candidate profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can delete their own candidate profile" ON public.candidate_profiles FOR DELETE TO authenticated USING ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: recruiter_profiles Users can delete their own recruiter profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can delete their own recruiter profile" ON public.recruiter_profiles FOR DELETE TO authenticated USING ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: profiles Users can delete their own profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can delete their own profile" ON public.profiles FOR DELETE TO authenticated USING ((id = ( SELECT auth.uid() AS uid)));
--
-- Name: user_sessions Users can delete their own sessions; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can delete their own sessions" ON public.user_sessions FOR DELETE USING ((( SELECT auth.uid() AS uid) = user_id));
--
-- Name: candidate_profiles Users can insert their own candidate profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can insert their own candidate profile" ON public.candidate_profiles FOR INSERT TO authenticated WITH CHECK ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: recruiter_profiles Users can insert their own recruiter profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can insert their own recruiter profile" ON public.recruiter_profiles FOR INSERT TO authenticated WITH CHECK ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: profiles Users can insert their own profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can insert their own profile" ON public.profiles FOR INSERT TO authenticated WITH CHECK ((id = ( SELECT auth.uid() AS uid)));
--
-- Name: candidate_profiles Users can update their own candidate profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can update their own candidate profile" ON public.candidate_profiles FOR UPDATE TO authenticated USING ((profile_id = ( SELECT auth.uid() AS uid))) WITH CHECK ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: recruiter_profiles Users can update their own recruiter profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can update their own recruiter profile" ON public.recruiter_profiles FOR UPDATE TO authenticated USING ((profile_id = ( SELECT auth.uid() AS uid))) WITH CHECK ((profile_id = ( SELECT auth.uid() AS uid)));
--
-- Name: profiles Users can update their own profile; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can update their own profile" ON public.profiles FOR UPDATE TO authenticated USING ((id = ( SELECT auth.uid() AS uid))) WITH CHECK ((id = ( SELECT auth.uid() AS uid)));
--
-- Name: user_sessions Users can view their own sessions; Type: POLICY; Schema: public; Owner: postgres
--
CREATE POLICY "Users can view their own sessions" ON public.user_sessions FOR SELECT USING ((( SELECT auth.uid() AS uid) = user_id));
--
-- Name: attempt_answers; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.attempt_answers ENABLE ROW LEVEL SECURITY;
--
-- Name: candidate_profiles; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.candidate_profiles ENABLE ROW LEVEL SECURITY;
--
-- Name: recruiter_profiles; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.recruiter_profiles ENABLE ROW LEVEL SECURITY;
--
-- Name: options; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.options ENABLE ROW LEVEL SECURITY;
--
-- Name: profiles; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY;
--
-- Name: question_tags; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.question_tags ENABLE ROW LEVEL SECURITY;
--
-- Name: questions; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.questions ENABLE ROW LEVEL SECURITY;
--
-- Name: tags; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.tags ENABLE ROW LEVEL SECURITY;
--
-- Name: test_attempts; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.test_attempts ENABLE ROW LEVEL SECURITY;
--
-- Name: tests; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.tests ENABLE ROW LEVEL SECURITY;
--
-- Name: user_sessions; Type: ROW SECURITY; Schema: public; Owner: postgres
--
ALTER TABLE public.user_sessions ENABLE ROW LEVEL SECURITY;
--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: pg_database_owner
--
GRANT USAGE ON SCHEMA public TO postgres;
GRANT USAGE ON SCHEMA public TO anon;
GRANT USAGE ON SCHEMA public TO authenticated;
GRANT USAGE ON SCHEMA public TO service_role;
--
-- Name: FUNCTION check_username_available(p_username text, p_user_id uuid); Type: ACL; Schema: public; Owner: postgres
--
REVOKE ALL ON FUNCTION public.check_username_available(p_username text, p_user_id uuid) FROM PUBLIC;
GRANT ALL ON FUNCTION public.check_username_available(p_username text, p_user_id uuid) TO anon;
GRANT ALL ON FUNCTION public.check_username_available(p_username text, p_user_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.check_username_available(p_username text, p_user_id uuid) TO service_role;
--
-- Name: FUNCTION get_candidate_home_stats(p_profile_id uuid); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.get_candidate_home_stats(p_profile_id uuid) TO postgres;
GRANT ALL ON FUNCTION public.get_candidate_home_stats(p_profile_id uuid) TO anon;
GRANT ALL ON FUNCTION public.get_candidate_home_stats(p_profile_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.get_candidate_home_stats(p_profile_id uuid) TO service_role;
--
-- Name: FUNCTION get_recruiter_home_stats(p_profile_id uuid); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.get_recruiter_home_stats(p_profile_id uuid) TO postgres;
GRANT ALL ON FUNCTION public.get_recruiter_home_stats(p_profile_id uuid) TO anon;
GRANT ALL ON FUNCTION public.get_recruiter_home_stats(p_profile_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.get_recruiter_home_stats(p_profile_id uuid) TO service_role;
--
-- Name: FUNCTION grade_attempt(p_attempt_id uuid); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.grade_attempt(p_attempt_id uuid) TO postgres;
GRANT ALL ON FUNCTION public.grade_attempt(p_attempt_id uuid) TO anon;
GRANT ALL ON FUNCTION public.grade_attempt(p_attempt_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.grade_attempt(p_attempt_id uuid) TO service_role;
--
-- Name: FUNCTION grade_attempt_v2(p_attempt_id uuid, p_final_time_spent integer); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.grade_attempt_v2(p_attempt_id uuid, p_final_time_spent integer) TO postgres;
GRANT ALL ON FUNCTION public.grade_attempt_v2(p_attempt_id uuid, p_final_time_spent integer) TO anon;
GRANT ALL ON FUNCTION public.grade_attempt_v2(p_attempt_id uuid, p_final_time_spent integer) TO authenticated;
GRANT ALL ON FUNCTION public.grade_attempt_v2(p_attempt_id uuid, p_final_time_spent integer) TO service_role;
--
-- Name: FUNCTION handle_new_user(); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.handle_new_user() TO anon;
GRANT ALL ON FUNCTION public.handle_new_user() TO authenticated;
GRANT ALL ON FUNCTION public.handle_new_user() TO service_role;
--
-- Name: FUNCTION handle_session_sync(); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.handle_session_sync() TO postgres;
GRANT ALL ON FUNCTION public.handle_session_sync() TO anon;
GRANT ALL ON FUNCTION public.handle_session_sync() TO authenticated;
GRANT ALL ON FUNCTION public.handle_session_sync() TO service_role;
--
-- Name: FUNCTION init_test_attempt(p_test_id uuid); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.init_test_attempt(p_test_id uuid) TO postgres;
GRANT ALL ON FUNCTION public.init_test_attempt(p_test_id uuid) TO anon;
GRANT ALL ON FUNCTION public.init_test_attempt(p_test_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.init_test_attempt(p_test_id uuid) TO service_role;
--
-- Name: FUNCTION revoke_session(p_session_id uuid); Type: ACL; Schema: public; Owner: postgres
--
REVOKE ALL ON FUNCTION public.revoke_session(p_session_id uuid) FROM PUBLIC;
GRANT ALL ON FUNCTION public.revoke_session(p_session_id uuid) TO anon;
GRANT ALL ON FUNCTION public.revoke_session(p_session_id uuid) TO authenticated;
GRANT ALL ON FUNCTION public.revoke_session(p_session_id uuid) TO service_role;
--
-- Name: FUNCTION revoke_sessions_batch(p_session_ids uuid[]); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.revoke_sessions_batch(p_session_ids uuid[]) TO postgres;
GRANT ALL ON FUNCTION public.revoke_sessions_batch(p_session_ids uuid[]) TO anon;
GRANT ALL ON FUNCTION public.revoke_sessions_batch(p_session_ids uuid[]) TO authenticated;
GRANT ALL ON FUNCTION public.revoke_sessions_batch(p_session_ids uuid[]) TO service_role;
--
-- Name: FUNCTION save_answer(p_attempt_id uuid, p_question_id uuid, p_selected_option_ids uuid[], p_time_spent_seconds integer); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.save_answer(p_attempt_id uuid, p_question_id uuid, p_selected_option_ids uuid[], p_time_spent_seconds integer) TO anon;
GRANT ALL ON FUNCTION public.save_answer(p_attempt_id uuid, p_question_id uuid, p_selected_option_ids uuid[], p_time_spent_seconds integer) TO authenticated;
GRANT ALL ON FUNCTION public.save_answer(p_attempt_id uuid, p_question_id uuid, p_selected_option_ids uuid[], p_time_spent_seconds integer) TO service_role;
--
-- Name: FUNCTION save_test_v2(p_test_id uuid, p_settings jsonb, p_questions jsonb[], p_status text); Type: ACL; Schema: public; Owner: supabase_admin
--
GRANT ALL ON FUNCTION public.save_test_v2(p_test_id uuid, p_settings jsonb, p_questions jsonb[], p_status text) TO postgres;
GRANT ALL ON FUNCTION public.save_test_v2(p_test_id uuid, p_settings jsonb, p_questions jsonb[], p_status text) TO anon;
GRANT ALL ON FUNCTION public.save_test_v2(p_test_id uuid, p_settings jsonb, p_questions jsonb[], p_status text) TO authenticated;
GRANT ALL ON FUNCTION public.save_test_v2(p_test_id uuid, p_settings jsonb, p_questions jsonb[], p_status text) TO service_role;
--
-- Name: FUNCTION set_updated_at(); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.set_updated_at() TO anon;
GRANT ALL ON FUNCTION public.set_updated_at() TO authenticated;
GRANT ALL ON FUNCTION public.set_updated_at() TO service_role;
--
-- Name: FUNCTION sync_candidate_profile(); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.sync_candidate_profile() TO anon;
GRANT ALL ON FUNCTION public.sync_candidate_profile() TO authenticated;
GRANT ALL ON FUNCTION public.sync_candidate_profile() TO service_role;
--
-- Name: FUNCTION sync_recruiter_profile(); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.sync_recruiter_profile() TO anon;
GRANT ALL ON FUNCTION public.sync_recruiter_profile() TO authenticated;
GRANT ALL ON FUNCTION public.sync_recruiter_profile() TO service_role;
--
-- Name: FUNCTION sync_user_session(); Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON FUNCTION public.sync_user_session() TO anon;
GRANT ALL ON FUNCTION public.sync_user_session() TO authenticated;
GRANT ALL ON FUNCTION public.sync_user_session() TO service_role;
--
-- Name: TABLE attempt_answers; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.attempt_answers TO anon;
GRANT ALL ON TABLE public.attempt_answers TO authenticated;
GRANT ALL ON TABLE public.attempt_answers TO service_role;
--
-- Name: TABLE profiles; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.profiles TO anon;
GRANT ALL ON TABLE public.profiles TO authenticated;
GRANT ALL ON TABLE public.profiles TO service_role;
--
-- Name: TABLE test_attempts; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.test_attempts TO anon;
GRANT ALL ON TABLE public.test_attempts TO authenticated;
GRANT ALL ON TABLE public.test_attempts TO service_role;
--
-- Name: TABLE attempt_details; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.attempt_details TO anon;
GRANT ALL ON TABLE public.attempt_details TO authenticated;
GRANT ALL ON TABLE public.attempt_details TO service_role;
--
-- Name: TABLE candidate_profiles; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.candidate_profiles TO anon;
GRANT ALL ON TABLE public.candidate_profiles TO authenticated;
GRANT ALL ON TABLE public.candidate_profiles TO service_role;
--
-- Name: TABLE recruiter_profiles; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.recruiter_profiles TO anon;
GRANT ALL ON TABLE public.recruiter_profiles TO authenticated;
GRANT ALL ON TABLE public.recruiter_profiles TO service_role;
--
-- Name: TABLE options; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.options TO anon;
GRANT ALL ON TABLE public.options TO authenticated;
GRANT ALL ON TABLE public.options TO service_role;
--
-- Name: TABLE question_tags; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.question_tags TO anon;
GRANT ALL ON TABLE public.question_tags TO authenticated;
GRANT ALL ON TABLE public.question_tags TO service_role;
--
-- Name: TABLE questions; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.questions TO anon;
GRANT ALL ON TABLE public.questions TO authenticated;
GRANT ALL ON TABLE public.questions TO service_role;
--
-- Name: TABLE tags; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.tags TO anon;
GRANT ALL ON TABLE public.tags TO authenticated;
GRANT ALL ON TABLE public.tags TO service_role;
--
-- Name: TABLE tag_performance; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.tag_performance TO anon;
GRANT ALL ON TABLE public.tag_performance TO authenticated;
GRANT ALL ON TABLE public.tag_performance TO service_role;
--
-- Name: TABLE tests; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.tests TO anon;
GRANT ALL ON TABLE public.tests TO authenticated;
GRANT ALL ON TABLE public.tests TO service_role;
--
-- Name: TABLE user_sessions; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.user_sessions TO anon;
GRANT ALL ON TABLE public.user_sessions TO authenticated;
GRANT ALL ON TABLE public.user_sessions TO service_role;
--
-- Name: TABLE view_question_analysis; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.view_question_analysis TO anon;
GRANT ALL ON TABLE public.view_question_analysis TO authenticated;
GRANT ALL ON TABLE public.view_question_analysis TO service_role;
--
-- Name: TABLE view_test_results_detailed; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.view_test_results_detailed TO anon;
GRANT ALL ON TABLE public.view_test_results_detailed TO authenticated;
GRANT ALL ON TABLE public.view_test_results_detailed TO service_role;
--
-- Name: TABLE view_test_summary; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.view_test_summary TO anon;
GRANT ALL ON TABLE public.view_test_summary TO authenticated;
GRANT ALL ON TABLE public.view_test_summary TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: postgres
--
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
--
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: postgres
--
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
--
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres
--
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO service_role;
--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
--
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO service_role;
--
-- PostgreSQL database dump complete
--
--