01-heats.sql (569B)
1 CREATE TABLE public.heats ( 2 id bigint NOT NULL, 3 created_at timestamp with time zone DEFAULT now(), 4 name text NOT NULL, 5 location text, 6 planned_start time without time zone, 7 private boolean default true, 8 CONSTRAINT heats_name_check CHECK ((length(name) > 0)) 9 ); 10 11 ALTER TABLE public.heats ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( 12 SEQUENCE NAME public.heats_id_seq 13 START WITH 1 14 INCREMENT BY 1 15 NO MINVALUE 16 NO MAXVALUE 17 CACHE 1 18 ); 19 20 ALTER TABLE ONLY public.heats 21 ADD CONSTRAINT heats_pkey PRIMARY KEY (id);