01-heats.sql (535B)
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 CONSTRAINT heats_name_check CHECK ((length(name) > 0)) 8 ); 9 10 ALTER TABLE public.heats ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( 11 SEQUENCE NAME public.heats_id_seq 12 START WITH 1 13 INCREMENT BY 1 14 NO MINVALUE 15 NO MAXVALUE 16 CACHE 1 17 ); 18 19 ALTER TABLE ONLY public.heats 20 ADD CONSTRAINT heats_pkey PRIMARY KEY (id);