startlist.sql (3313B)
1 -- 2 -- PostgreSQL database dump 3 -- 4 5 -- Dumped from database version 15.1 6 -- Dumped by pg_dump version 15.3 7 8 SET statement_timeout = 0; 9 SET lock_timeout = 0; 10 SET idle_in_transaction_session_timeout = 0; 11 SET client_encoding = 'UTF8'; 12 SET standard_conforming_strings = on; 13 SELECT pg_catalog.set_config('search_path', '', false); 14 SET check_function_bodies = false; 15 SET xmloption = content; 16 SET client_min_messages = warning; 17 SET row_security = off; 18 19 SET default_tablespace = ''; 20 21 SET default_table_access_method = heap; 22 23 -- 24 -- Name: startlist; Type: TABLE; Schema: public; Owner: postgres 25 -- 26 27 CREATE TABLE public.startlist ( 28 id bigint NOT NULL, 29 created_at timestamp with time zone DEFAULT now(), 30 heat bigint NOT NULL, 31 athlete bigint NOT NULL 32 ); 33 34 35 ALTER TABLE public.startlist OWNER TO postgres; 36 37 -- 38 -- Name: TABLE startlist; Type: COMMENT; Schema: public; Owner: postgres 39 -- 40 41 COMMENT ON TABLE public.startlist IS 'List of athletes for a given heat or run'; 42 43 44 -- 45 -- Name: startlist_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres 46 -- 47 48 ALTER TABLE public.startlist ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( 49 SEQUENCE NAME public.startlist_id_seq 50 START WITH 1 51 INCREMENT BY 1 52 NO MINVALUE 53 NO MAXVALUE 54 CACHE 1 55 ); 56 57 58 -- 59 -- Name: startlist startlist_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres 60 -- 61 62 ALTER TABLE ONLY public.startlist 63 ADD CONSTRAINT startlist_pkey PRIMARY KEY (heat, athlete); 64 65 66 -- 67 -- Name: startlist startlist_athlete_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres 68 -- 69 70 ALTER TABLE ONLY public.startlist 71 ADD CONSTRAINT startlist_athlete_fkey FOREIGN KEY (athlete) REFERENCES public.athletes(id) ON DELETE CASCADE; 72 73 74 -- 75 -- Name: startlist startlist_heat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres 76 -- 77 78 ALTER TABLE ONLY public.startlist 79 ADD CONSTRAINT startlist_heat_fkey FOREIGN KEY (heat) REFERENCES public.heats(id) ON DELETE CASCADE; 80 81 82 -- 83 -- Name: startlist Enable delete for authenticated users only; Type: POLICY; Schema: public; Owner: postgres 84 -- 85 86 CREATE POLICY "Enable delete for authenticated users only" ON public.startlist FOR DELETE TO authenticated USING (true); 87 88 89 -- 90 -- Name: startlist Enable insert for authenticated users only; Type: POLICY; Schema: public; Owner: postgres 91 -- 92 93 CREATE POLICY "Enable insert for authenticated users only" ON public.startlist FOR INSERT TO authenticated WITH CHECK (true); 94 95 96 -- 97 -- Name: startlist Enable read access for all users; Type: POLICY; Schema: public; Owner: postgres 98 -- 99 100 CREATE POLICY "Enable read access for all users" ON public.startlist FOR SELECT USING (true); 101 102 103 -- 104 -- Name: startlist; Type: ROW SECURITY; Schema: public; Owner: postgres 105 -- 106 107 ALTER TABLE public.startlist ENABLE ROW LEVEL SECURITY; 108 109 -- 110 -- Name: TABLE startlist; Type: ACL; Schema: public; Owner: postgres 111 -- 112 113 GRANT ALL ON TABLE public.startlist TO anon; 114 GRANT ALL ON TABLE public.startlist TO authenticated; 115 GRANT ALL ON TABLE public.startlist TO service_role; 116 117 118 -- 119 -- Name: SEQUENCE startlist_id_seq; Type: ACL; Schema: public; Owner: postgres 120 -- 121 122 GRANT ALL ON SEQUENCE public.startlist_id_seq TO anon; 123 GRANT ALL ON SEQUENCE public.startlist_id_seq TO authenticated; 124 GRANT ALL ON SEQUENCE public.startlist_id_seq TO service_role; 125 126 127 -- 128 -- PostgreSQL database dump complete 129 -- 130