athletes.sql (577B)
1 CREATE TABLE public.athletes ( 2 id bigint NOT NULL, 3 created_at timestamp with time zone DEFAULT now(), 4 nr bigint, 5 firstname text NOT NULL, 6 lastname text, 7 birthday date, 8 school text, 9 CONSTRAINT athletes_firstname_check CHECK ((length(firstname) > 0)) 10 ); 11 12 ALTER TABLE public.athletes ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( 13 SEQUENCE NAME public.athletes_id_seq 14 START WITH 1 15 INCREMENT BY 1 16 NO MINVALUE 17 NO MAXVALUE 18 CACHE 1 19 ); 20 21 ALTER TABLE ONLY public.athletes 22 ADD CONSTRAINT athletes_pkey PRIMARY KEY (id);