SET search_path = public, pg_catalog;
---
--- Name: builders_history_action; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE builders_history_action AS ENUM (
- 'created',
- 'enabled',
- 'disabled',
- 'deleted'
-);
-
-
-ALTER TYPE builders_history_action OWNER TO pakfire;
-
---
--- Name: builds_history_action; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE builds_history_action AS ENUM (
- 'created',
- 'bug_added',
- 'bug_removed'
-);
-
-
-ALTER TYPE builds_history_action OWNER TO pakfire;
-
---
--- Name: builds_severity; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE builds_severity AS ENUM (
- 'security update',
- 'bugfix update',
- 'enhancement',
- 'new package'
-);
-
-
-ALTER TYPE builds_severity OWNER TO pakfire;
-
---
--- Name: builds_type; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE builds_type AS ENUM (
- 'release',
- 'scratch'
-);
-
-
-ALTER TYPE builds_type OWNER TO pakfire;
-
---
--- Name: jobs_history_action; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE jobs_history_action AS ENUM (
- 'created',
- 'state_change',
- 'reset',
- 'schedule_rebuild',
- 'schedule_test_job'
-);
-
-
-ALTER TYPE jobs_history_action OWNER TO pakfire;
-
---
--- Name: jobs_history_state; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE jobs_history_state AS ENUM (
- 'new',
- 'pending',
- 'running',
- 'finished',
- 'dispatching',
- 'uploading',
- 'failed',
- 'temporary_failed',
- 'dependency_error',
- 'aborted',
- 'download_error',
- 'deleted'
-);
-
-
-ALTER TYPE jobs_history_state OWNER TO pakfire;
-
---
--- Name: mirrors_history_action; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE mirrors_history_action AS ENUM (
- 'created',
- 'enabled',
- 'disabled',
- 'deleted'
-);
-
-
-ALTER TYPE mirrors_history_action OWNER TO pakfire;
-
---
--- Name: packages_deps_type; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE packages_deps_type AS ENUM (
- 'requires',
- 'prerequires',
- 'provides',
- 'conflicts',
- 'obsoletes',
- 'suggests',
- 'recommends'
-);
-
-
-ALTER TYPE packages_deps_type OWNER TO pakfire;
-
---
--- Name: packages_type; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE packages_type AS ENUM (
- 'source',
- 'binary'
-);
-
-
-ALTER TYPE packages_type OWNER TO pakfire;
-
---
--- Name: repositories_aux_status; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE repositories_aux_status AS ENUM (
- 'enabled',
- 'disabled'
-);
-
-
-ALTER TYPE repositories_aux_status OWNER TO pakfire;
-
---
--- Name: repositories_history_action; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE repositories_history_action AS ENUM (
- 'added',
- 'removed',
- 'moved'
-);
-
-
-ALTER TYPE repositories_history_action OWNER TO pakfire;
-
---
--- Name: repositories_type; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE repositories_type AS ENUM (
- 'testing',
- 'unstable',
- 'stable'
-);
-
-
-ALTER TYPE repositories_type OWNER TO pakfire;
-
---
--- Name: sources_commits_state; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE sources_commits_state AS ENUM (
- 'pending',
- 'running',
- 'finished',
- 'failed'
-);
-
-
-ALTER TYPE sources_commits_state OWNER TO pakfire;
-
---
--- Name: users_state; Type: TYPE; Schema: public; Owner: pakfire
---
-
-CREATE TYPE users_state AS ENUM (
- 'user',
- 'tester',
- 'admin'
-);
-
-
-ALTER TYPE users_state OWNER TO pakfire;
-
--
-- Name: on_update_current_timestamp_sources(); Type: FUNCTION; Schema: public; Owner: pakfire
--
CREATE TABLE builders_history (
id integer NOT NULL,
builder_id integer NOT NULL,
- action builders_history_action NOT NULL,
+ action text NOT NULL,
user_id integer,
"time" timestamp without time zone NOT NULL
);
id integer NOT NULL,
uuid text NOT NULL,
pkg_id integer NOT NULL,
- type builds_type DEFAULT 'release'::builds_type NOT NULL,
+ type text DEFAULT 'release'::text NOT NULL,
state text DEFAULT 'building'::text NOT NULL,
- severity builds_severity,
+ severity text,
message text,
time_created timestamp without time zone DEFAULT now() NOT NULL,
update_year integer,
CREATE TABLE builds_history (
id integer NOT NULL,
build_id integer NOT NULL,
- action builds_history_action NOT NULL,
+ action text NOT NULL,
user_id integer,
"time" timestamp without time zone NOT NULL,
bug_id integer
id integer NOT NULL,
uuid text NOT NULL,
build_id integer NOT NULL,
- state text DEFAULT 'new'::text NOT NULL,
+ state text DEFAULT 'pending'::text NOT NULL,
arch text NOT NULL,
time_created timestamp without time zone DEFAULT now() NOT NULL,
time_started timestamp without time zone,
aborted_state integer DEFAULT 0 NOT NULL,
message text,
test boolean DEFAULT true NOT NULL,
- superseeded_by integer
+ superseeded_by integer,
+ dependency_check_succeeded boolean,
+ dependency_check_at timestamp without time zone,
+ CONSTRAINT jobs_states CHECK ((state = ANY (ARRAY['pending'::text, 'dispatching'::text, 'running'::text, 'uploading'::text, 'finished'::text, 'aborted'::text, 'download_error'::text, 'failed'::text])))
);
CREATE TABLE jobs_history (
job_id integer NOT NULL,
- action jobs_history_action NOT NULL,
- state jobs_history_state,
+ action text NOT NULL,
+ state text,
user_id integer,
"time" timestamp without time zone NOT NULL,
builder_id integer,
rank() OVER (ORDER BY (NOT jobs.test), builds.priority DESC, jobs.time_created) AS rank
FROM (jobs
LEFT JOIN builds ON ((jobs.build_id = builds.id)))
- WHERE (jobs.state = 'pending'::text)
+ WHERE ((jobs.state = 'pending'::text) AND (jobs.dependency_check_succeeded IS TRUE))
)
SELECT queue.id AS job_id,
queue.rank
ALTER SEQUENCE logfiles_id_seq OWNED BY logfiles.id;
+--
+-- Name: messages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
+--
+
+CREATE TABLE messages (
+ id integer NOT NULL,
+ message text NOT NULL,
+ queued_at timestamp without time zone DEFAULT now() NOT NULL,
+ sent_at timestamp without time zone
+);
+
+
+ALTER TABLE messages OWNER TO pakfire;
+
+--
+-- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
+--
+
+CREATE SEQUENCE messages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE messages_id_seq OWNER TO pakfire;
+
+--
+-- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
+--
+
+ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
+
+
--
-- Name: mirrors; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
--
CREATE TABLE mirrors_history (
id integer NOT NULL,
mirror_id integer NOT NULL,
- action mirrors_history_action NOT NULL,
+ action text NOT NULL,
user_id integer,
"time" timestamp without time zone NOT NULL
);
epoch integer NOT NULL,
version text NOT NULL,
release text NOT NULL,
- type packages_type NOT NULL,
+ type text NOT NULL,
arch text NOT NULL,
groups text NOT NULL,
maintainer text NOT NULL,
CREATE TABLE packages_deps (
pkg_id integer NOT NULL,
- type packages_deps_type NOT NULL,
+ type text NOT NULL,
what text NOT NULL
);
CREATE TABLE repositories (
id integer NOT NULL,
name text NOT NULL,
- type repositories_type DEFAULT 'testing'::repositories_type NOT NULL,
+ type text DEFAULT 'testing'::text NOT NULL,
description text NOT NULL,
distro_id integer NOT NULL,
parent_id integer,
description text,
url text NOT NULL,
distro_id integer NOT NULL,
- status repositories_aux_status DEFAULT 'disabled'::repositories_aux_status NOT NULL
+ status text DEFAULT 'disabled'::text NOT NULL
);
CREATE TABLE repositories_history (
build_id bigint NOT NULL,
- action repositories_history_action NOT NULL,
+ action text NOT NULL,
from_repo_id integer,
to_repo_id integer,
user_id integer,
subject text NOT NULL,
body text NOT NULL,
date timestamp without time zone NOT NULL,
- state sources_commits_state DEFAULT 'pending'::sources_commits_state NOT NULL,
+ state text DEFAULT 'pending'::text NOT NULL,
imported_at timestamp without time zone DEFAULT now() NOT NULL
);
ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id;
---
--- Name: user_messages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
---
-
-CREATE TABLE user_messages (
- id integer NOT NULL,
- frm text NOT NULL,
- "to" text NOT NULL,
- subject text NOT NULL,
- text text NOT NULL,
- time_added timestamp without time zone DEFAULT now() NOT NULL
-);
-
-
-ALTER TABLE user_messages OWNER TO pakfire;
-
---
--- Name: user_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
---
-
-CREATE SEQUENCE user_messages_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
-ALTER TABLE user_messages_id_seq OWNER TO pakfire;
-
---
--- Name: user_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
---
-
-ALTER SEQUENCE user_messages_id_seq OWNED BY user_messages.id;
-
-
--
-- Name: users; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
--
name text NOT NULL,
realname text,
passphrase text,
- state users_state DEFAULT 'user'::users_state NOT NULL,
+ state text DEFAULT 'user'::text NOT NULL,
locale text,
timezone text,
activated boolean DEFAULT false NOT NULL,
deleted boolean DEFAULT false NOT NULL,
registered timestamp without time zone DEFAULT now() NOT NULL,
- ldap_dn text
+ ldap_dn text,
+ password_recovery_code text,
+ password_recovery_code_expires_at timestamp without time zone
);
ALTER TABLE ONLY logfiles ALTER COLUMN id SET DEFAULT nextval('logfiles_id_seq'::regclass);
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
+--
+
+ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
+
+
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
--
ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
---
--- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY user_messages ALTER COLUMN id SET DEFAULT nextval('user_messages_id_seq'::regclass);
-
-
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
--
-- Name: idx_2198274_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
--
-ALTER TABLE ONLY user_messages
+ALTER TABLE ONLY messages
ADD CONSTRAINT idx_2198274_primary PRIMARY KEY (id);
ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
+--
+-- Name: users_password_recovery_code; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
+--
+
+ALTER TABLE ONLY users
+ ADD CONSTRAINT users_password_recovery_code UNIQUE (password_recovery_code);
+
+
--
-- Name: arches_compat_native_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
CREATE INDEX jobs_arch ON jobs USING btree (arch);
+--
+-- Name: jobs_builders_active_jobs; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
+--
+
+CREATE INDEX jobs_builders_active_jobs ON jobs USING btree (builder_id) WHERE (state = ANY (ARRAY['dispatching'::text, 'running'::text]));
+
+
--
-- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
+--
+-- Name: jobs_queue_ready; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
+--
+
+CREATE INDEX jobs_queue_ready ON jobs USING btree (id) WHERE ((state = 'new'::text) AND (dependency_check_succeeded IS TRUE));
+
+
--
-- Name: jobs_time_finished; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
CREATE INDEX jobs_time_started ON jobs USING btree (time_started) WHERE ((time_started IS NOT NULL) AND (time_finished IS NULL));
+--
+-- Name: messages_order; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
+--
+
+CREATE INDEX messages_order ON messages USING btree (queued_at) WHERE (sent_at IS NULL);
+
+
--
-- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
ADD CONSTRAINT jobs_repos_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
+--
+-- Name: jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
+--
+
+ALTER TABLE ONLY jobs
+ ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by) REFERENCES jobs(id);
+
+
--
-- Name: keys_subkeys_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
--