commit 31d8f029733fd59e8b97ab069c04645f34f3cb0a
parent 267a70e94511acc91a4be87ce05a39cf031a5a4e
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Sun, 23 Jul 2023 09:53:46 +0200
fix(schema): use text instead varchar
https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_varchar.28n.29_by_default
Diffstat:
5 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/schema/athletes.sql b/schema/athletes.sql
@@ -28,11 +28,11 @@ CREATE TABLE public.athletes (
id bigint NOT NULL,
created_at timestamp with time zone DEFAULT now(),
nr bigint,
- firstname character varying NOT NULL,
- lastname character varying,
+ firstname text NOT NULL,
+ lastname text,
birthday date,
- school character varying,
- CONSTRAINT athletes_firstname_check CHECK ((length((firstname)::text) > 0))
+ school text,
+ CONSTRAINT athletes_firstname_check CHECK ((length(firstname) > 0))
);
diff --git a/schema/heats.sql b/schema/heats.sql
@@ -27,10 +27,10 @@ SET default_table_access_method = heap;
CREATE TABLE public.heats (
id bigint NOT NULL,
created_at timestamp with time zone DEFAULT now(),
- name character varying NOT NULL,
- location character varying,
+ name text NOT NULL,
+ location text,
planned_start time without time zone,
- CONSTRAINT heats_name_check CHECK ((length((name)::text) > 0))
+ CONSTRAINT heats_name_check CHECK ((length(name) > 0))
);
diff --git a/schema/judges.sql b/schema/judges.sql
@@ -3,7 +3,7 @@
--
-- Dumped from database version 15.1
--- Dumped by pg_dump version 15.2
+-- Dumped by pg_dump version 15.3
SET statement_timeout = 0;
SET lock_timeout = 0;
@@ -25,10 +25,10 @@ SET default_table_access_method = heap;
--
CREATE TABLE public.judges (
- id uuid not null references auth.users on delete cascade,
+ id uuid NOT NULL,
created_at timestamp with time zone DEFAULT now(),
- firstname character varying,
- lastname character varying
+ firstname text,
+ lastname text
);
@@ -50,6 +50,14 @@ ALTER TABLE ONLY public.judges
--
+-- Name: judges judges_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.judges
+ ADD CONSTRAINT judges_id_fkey FOREIGN KEY (id) REFERENCES auth.users(id) ON DELETE CASCADE;
+
+
+--
-- Name: judges; Type: ROW SECURITY; Schema: public; Owner: postgres
--
diff --git a/schema/scores.sql b/schema/scores.sql
@@ -3,7 +3,7 @@
--
-- Dumped from database version 15.1
--- Dumped by pg_dump version 15.2
+-- Dumped by pg_dump version 15.3
SET statement_timeout = 0;
SET lock_timeout = 0;
diff --git a/schema/startlist.sql b/schema/startlist.sql
@@ -3,7 +3,7 @@
--
-- Dumped from database version 15.1
--- Dumped by pg_dump version 15.2
+-- Dumped by pg_dump version 15.3
SET statement_timeout = 0;
SET lock_timeout = 0;