commit 1ff7c67955cd318ae9556beddfc665e216e9cb5d
parent 3cd768e8ed9a51d7c6eda4789e94a6873d219d45
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Fri, 20 Sep 2024 23:08:33 +0200
feat(schema): add missing athletes table
Diffstat:
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/schema/00-athletes.sql b/schema/00-athletes.sql
@@ -0,0 +1,22 @@
+CREATE TABLE public.athletes (
+ id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now(),
+ nr bigint,
+ firstname text NOT NULL,
+ lastname text,
+ birthday date,
+ school text,
+ CONSTRAINT athletes_firstname_check CHECK ((length(firstname) > 0))
+);
+
+ALTER TABLE public.athletes ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME public.athletes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
+
+ALTER TABLE ONLY public.athletes
+ ADD CONSTRAINT athletes_pkey PRIMARY KEY (id);