]> git.ipfire.org Git - pbs.git/commitdiff
db: Import any schema changes
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Jan 2025 11:00:21 +0000 (11:00 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Jan 2025 11:00:21 +0000 (11:00 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.sql

index 87a6791d7ce221b9b5f9cdc05da57e74b0877a26..0186a24bc3cd99d72912d105b338ad32c38538ab 100644 (file)
@@ -2,8 +2,8 @@
 -- PostgreSQL database dump
 --
 
--- Dumped from database version 15.3 (Debian 15.3-0+deb12u1)
--- Dumped by pg_dump version 15.3 (Debian 15.3-0+deb12u1)
+-- Dumped from database version 15.10 (Debian 15.10-0+deb12u1)
+-- Dumped by pg_dump version 15.10 (Debian 15.10-0+deb12u1)
 
 SET statement_timeout = 0;
 SET lock_timeout = 0;
@@ -36,9 +36,9 @@ CREATE TABLE public.build_bugs (
     build_id integer NOT NULL,
     bug_id integer NOT NULL,
     added_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    added_by integer,
+    added_by_id integer,
     removed_at timestamp without time zone,
-    removed_by integer
+    removed_by_id integer
 );
 
 
@@ -72,7 +72,7 @@ CREATE TABLE public.build_comments (
     user_id integer NOT NULL,
     text text DEFAULT ''::text NOT NULL,
     created_at timestamp without time zone DEFAULT now() NOT NULL,
-    deleted boolean DEFAULT false NOT NULL
+    deleted_at timestamp without time zone
 );
 
 
@@ -207,9 +207,9 @@ CREATE TABLE public.builders (
     instance_type text,
     mem_total bigint,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer,
+    created_by_id integer,
     deleted_at timestamp without time zone,
-    deleted_by integer
+    deleted_by_id integer
 );
 
 
@@ -249,11 +249,11 @@ CREATE TABLE public.builds (
     finished_at timestamp without time zone,
     failed boolean DEFAULT false NOT NULL,
     deleted_at timestamp without time zone,
-    deleted_by integer,
+    deleted_by_id integer,
     build_group_id integer,
     deprecating_build_id integer,
     deprecated_at timestamp without time zone,
-    deprecated_by integer,
+    deprecated_by_id integer,
     test_group_id integer,
     test boolean DEFAULT false NOT NULL,
     disable_test_builds boolean DEFAULT false NOT NULL,
@@ -318,7 +318,8 @@ CREATE TABLE public.distributions (
     custom_config text DEFAULT ''::text NOT NULL,
     codename text DEFAULT ''::text NOT NULL,
     bugzilla_product text DEFAULT ''::text NOT NULL,
-    bugzilla_version text DEFAULT ''::text NOT NULL
+    bugzilla_version text DEFAULT ''::text NOT NULL,
+    deleted_at timestamp without time zone
 );
 
 
@@ -394,7 +395,7 @@ CREATE TABLE public.jobs (
     finished_at timestamp without time zone,
     builder_id integer,
     message text,
-    superseeded_by integer,
+    superseeded_by_id integer,
     installcheck_succeeded boolean,
     installcheck_performed_at timestamp without time zone,
     failed boolean DEFAULT false NOT NULL,
@@ -404,7 +405,7 @@ CREATE TABLE public.jobs (
     deleted_at timestamp without time zone,
     deleted_by integer,
     aborted boolean DEFAULT false NOT NULL,
-    aborted_by integer,
+    aborted_by_id integer,
     timeout interval
 );
 
@@ -435,9 +436,9 @@ ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;
 CREATE TABLE public.keys (
     id integer NOT NULL,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer,
+    created_by_id integer,
     deleted_at timestamp without time zone,
-    deleted_by integer,
+    deleted_by_id integer,
     public_key text NOT NULL,
     secret_key text NOT NULL,
     key_id numeric NOT NULL,
@@ -524,9 +525,9 @@ CREATE TABLE public.mirrors (
     owner text,
     contact text,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer NOT NULL,
+    created_by_id integer NOT NULL,
     deleted_at timestamp without time zone,
-    deleted_by integer,
+    deleted_by_id integer,
     last_check_success boolean,
     last_check_at timestamp without time zone,
     last_sync_at timestamp without time zone,
@@ -596,7 +597,7 @@ CREATE TABLE public.packages (
     url text NOT NULL,
     summary text NOT NULL,
     description text NOT NULL,
-    size bigint NOT NULL,
+    size numeric NOT NULL,
     build_arches text[],
     uuid uuid NOT NULL,
     commit_id integer,
@@ -604,7 +605,7 @@ CREATE TABLE public.packages (
     build_host text NOT NULL,
     build_time timestamp without time zone NOT NULL,
     path text,
-    filesize bigint NOT NULL,
+    filesize numeric NOT NULL,
     prerequires text[] DEFAULT ARRAY[]::text[] NOT NULL,
     requires text[] DEFAULT ARRAY[]::text[] NOT NULL,
     provides text[] DEFAULT ARRAY[]::text[] NOT NULL,
@@ -618,7 +619,7 @@ CREATE TABLE public.packages (
     deleted_at timestamp without time zone,
     deleted_by integer,
     distro_id integer NOT NULL,
-    _search tsvector GENERATED ALWAYS AS (((setweight(to_tsvector('simple'::regconfig, name), 'A'::"char") || setweight(to_tsvector('english'::regconfig, summary), 'B'::"char")) || setweight(to_tsvector('english'::regconfig, description), 'C'::"char"))) STORED
+    search tsvector GENERATED ALWAYS AS (((setweight(to_tsvector('simple'::regconfig, name), 'A'::"char") || setweight(to_tsvector('english'::regconfig, summary), 'B'::"char")) || setweight(to_tsvector('english'::regconfig, description), 'C'::"char"))) STORED
 );
 
 
@@ -734,9 +735,9 @@ CREATE TABLE public.release_monitorings (
     distro_id integer NOT NULL,
     name text NOT NULL,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer NOT NULL,
+    created_by_id integer NOT NULL,
     deleted_at timestamp without time zone,
-    deleted_by integer,
+    deleted_by_id integer,
     project_id integer NOT NULL,
     follow text NOT NULL,
     last_check_at timestamp without time zone,
@@ -774,9 +775,9 @@ CREATE TABLE public.releases (
     name text NOT NULL,
     slug text NOT NULL,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer NOT NULL,
+    created_by_id integer NOT NULL,
     deleted_at timestamp without time zone,
-    deleted_by integer,
+    deleted_by_id integer,
     published_at timestamp without time zone,
     stable boolean DEFAULT false NOT NULL,
     announcement text
@@ -853,9 +854,9 @@ CREATE TABLE public.repository_builds (
     repo_id integer NOT NULL,
     build_id bigint NOT NULL,
     added_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    added_by integer,
+    added_by_id integer,
     removed_at timestamp without time zone,
-    removed_by integer
+    removed_by_id integer
 );
 
 
@@ -1012,9 +1013,9 @@ CREATE TABLE public.sources (
     last_fetched_at timestamp without time zone,
     repo_id integer NOT NULL,
     created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by integer NOT NULL,
+    created_by_id integer NOT NULL,
     deleted_at timestamp without time zone,
-    deleted_by integer
+    deleted_by_id integer
 );
 
 
@@ -1539,27 +1540,6 @@ ALTER TABLE ONLY public.users
 CREATE UNIQUE INDEX build_bugs_unique ON public.build_bugs USING btree (build_id, bug_id) WHERE (removed_at IS NULL);
 
 
---
--- Name: build_comments_build_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX build_comments_build_id ON public.build_comments USING btree (build_id) WHERE (deleted IS FALSE);
-
-
---
--- Name: build_comments_created_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX build_comments_created_at ON public.build_comments USING btree (created_at) WHERE (deleted IS FALSE);
-
-
---
--- Name: build_comments_user_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX build_comments_user_id ON public.build_comments USING btree (user_id) WHERE (deleted IS FALSE);
-
-
 --
 -- Name: build_groups_uuid; Type: INDEX; Schema: public; Owner: -
 --
@@ -1711,7 +1691,7 @@ CREATE INDEX jobs_running ON public.jobs USING btree (started_at) WHERE ((delete
 -- Name: jobs_superseeded_by; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX jobs_superseeded_by ON public.jobs USING btree (superseeded_by);
+CREATE INDEX jobs_superseeded_by ON public.jobs USING btree (superseeded_by_id);
 
 
 --
@@ -1767,7 +1747,7 @@ CREATE INDEX packages_name ON public.packages USING btree (name);
 -- Name: packages_search; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX packages_search ON public.packages USING gin (_search) WHERE (deleted_at IS NULL);
+CREATE INDEX packages_search ON public.packages USING gin (search) WHERE (deleted_at IS NULL);
 
 
 --
@@ -1915,7 +1895,7 @@ CREATE UNIQUE INDEX users_name ON public.users USING btree (name) WHERE (deleted
 --
 
 ALTER TABLE ONLY public.build_bugs
-    ADD CONSTRAINT build_bugs_added_by FOREIGN KEY (added_by) REFERENCES public.users(id);
+    ADD CONSTRAINT build_bugs_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
 
 
 --
@@ -1931,7 +1911,7 @@ ALTER TABLE ONLY public.build_bugs
 --
 
 ALTER TABLE ONLY public.build_bugs
-    ADD CONSTRAINT build_bugs_removed_by FOREIGN KEY (removed_by) REFERENCES public.users(id);
+    ADD CONSTRAINT build_bugs_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2027,7 +2007,7 @@ ALTER TABLE ONLY public.builder_stats
 --
 
 ALTER TABLE ONLY public.builders
-    ADD CONSTRAINT builders_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT builders_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2035,7 +2015,7 @@ ALTER TABLE ONLY public.builders
 --
 
 ALTER TABLE ONLY public.builders
-    ADD CONSTRAINT builders_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT builders_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2075,7 +2055,7 @@ ALTER TABLE ONLY public.build_comments
 --
 
 ALTER TABLE ONLY public.builds
-    ADD CONSTRAINT builds_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT builds_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2083,7 +2063,7 @@ ALTER TABLE ONLY public.builds
 --
 
 ALTER TABLE ONLY public.builds
-    ADD CONSTRAINT builds_deprecated_by FOREIGN KEY (deprecated_by) REFERENCES public.users(id);
+    ADD CONSTRAINT builds_deprecated_by FOREIGN KEY (deprecated_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2139,7 +2119,7 @@ ALTER TABLE ONLY public.job_packages
 --
 
 ALTER TABLE ONLY public.jobs
-    ADD CONSTRAINT jobs_aborted_by FOREIGN KEY (aborted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT jobs_aborted_by FOREIGN KEY (aborted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2171,7 +2151,7 @@ ALTER TABLE ONLY public.jobs
 --
 
 ALTER TABLE ONLY public.jobs
-    ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by) REFERENCES public.jobs(id);
+    ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by_id) REFERENCES public.jobs(id);
 
 
 --
@@ -2179,7 +2159,7 @@ ALTER TABLE ONLY public.jobs
 --
 
 ALTER TABLE ONLY public.keys
-    ADD CONSTRAINT keys_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT keys_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2187,7 +2167,7 @@ ALTER TABLE ONLY public.keys
 --
 
 ALTER TABLE ONLY public.keys
-    ADD CONSTRAINT keys_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT keys_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2203,7 +2183,7 @@ ALTER TABLE ONLY public.mirror_checks
 --
 
 ALTER TABLE ONLY public.mirrors
-    ADD CONSTRAINT mirrors_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT mirrors_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2211,7 +2191,7 @@ ALTER TABLE ONLY public.mirrors
 --
 
 ALTER TABLE ONLY public.mirrors
-    ADD CONSTRAINT mirrors_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT mirrors_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2291,7 +2271,7 @@ ALTER TABLE ONLY public.release_monitoring_releases
 --
 
 ALTER TABLE ONLY public.release_monitorings
-    ADD CONSTRAINT release_monitorings_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT release_monitorings_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2299,7 +2279,7 @@ ALTER TABLE ONLY public.release_monitorings
 --
 
 ALTER TABLE ONLY public.release_monitorings
-    ADD CONSTRAINT release_monitorings_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT release_monitorings_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2315,7 +2295,7 @@ ALTER TABLE ONLY public.release_monitorings
 --
 
 ALTER TABLE ONLY public.releases
-    ADD CONSTRAINT releases_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT releases_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2323,7 +2303,7 @@ ALTER TABLE ONLY public.releases
 --
 
 ALTER TABLE ONLY public.releases
-    ADD CONSTRAINT releases_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT releases_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2371,7 +2351,7 @@ ALTER TABLE ONLY public.repositories
 --
 
 ALTER TABLE ONLY public.repository_builds
-    ADD CONSTRAINT repository_builds_added_by FOREIGN KEY (added_by) REFERENCES public.users(id);
+    ADD CONSTRAINT repository_builds_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2387,7 +2367,7 @@ ALTER TABLE ONLY public.repository_builds
 --
 
 ALTER TABLE ONLY public.repository_builds
-    ADD CONSTRAINT repository_builds_removed_by FOREIGN KEY (removed_by) REFERENCES public.users(id);
+    ADD CONSTRAINT repository_builds_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2435,7 +2415,7 @@ ALTER TABLE ONLY public.source_commits
 --
 
 ALTER TABLE ONLY public.sources
-    ADD CONSTRAINT sources_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
+    ADD CONSTRAINT sources_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
 
 
 --
@@ -2443,7 +2423,7 @@ ALTER TABLE ONLY public.sources
 --
 
 ALTER TABLE ONLY public.sources
-    ADD CONSTRAINT sources_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
+    ADD CONSTRAINT sources_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
 
 
 --