$ pg_dump --section=pre-data -- -- PostgreSQL database dump -- -- Dumped from database version 13.11 -- Dumped by pg_dump version 13.11 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -- -- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public; -- -- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; -- -- Name: receiptstatus; Type: TYPE; Schema: public; Owner: postgres -- CREATE TYPE public.receiptstatus AS ENUM ( 'created', 'delivered', 'delivery_failed', 'deleted' ); ALTER TYPE public.receiptstatus OWNER TO postgres; -- -- Name: versionrange; Type: TYPE; Schema: public; Owner: postgres -- CREATE TYPE public.versionrange AS RANGE ( subtype = integer[] ); ALTER TYPE public.versionrange OWNER TO postgres; SET default_tablespace = ''; SET default_table_access_method = heap; -- -- Name: dist; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.dist ( id bigint NOT NULL, name text DEFAULT ''::text NOT NULL, did text DEFAULT ''::text NOT NULL, version text DEFAULT ''::text NOT NULL, version_code_name text DEFAULT ''::text NOT NULL, version_id text DEFAULT ''::text NOT NULL, arch text DEFAULT ''::text NOT NULL, cpe text DEFAULT ''::text NOT NULL, pretty_name text DEFAULT ''::text NOT NULL ); ALTER TABLE public.dist OWNER TO postgres; -- -- Name: dist_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.dist_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.dist_id_seq OWNER TO postgres; -- -- Name: dist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.dist_id_seq OWNED BY public.dist.id; -- -- Name: dist_scanartifact; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.dist_scanartifact ( dist_id bigint NOT NULL, scanner_id bigint NOT NULL, layer_id bigint NOT NULL ); ALTER TABLE public.dist_scanartifact OWNER TO postgres; -- -- Name: enrichment; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.enrichment ( id bigint NOT NULL, hash_kind text, hash bytea, updater text, tags text[], data jsonb ); ALTER TABLE public.enrichment OWNER TO postgres; -- -- Name: enrichment_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.enrichment_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.enrichment_id_seq OWNER TO postgres; -- -- Name: enrichment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.enrichment_id_seq OWNED BY public.enrichment.id; -- -- Name: file; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.file ( id bigint NOT NULL, path text NOT NULL, kind text NOT NULL ); ALTER TABLE public.file OWNER TO postgres; -- -- Name: file_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.file_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.file_id_seq OWNER TO postgres; -- -- Name: file_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.file_id_seq OWNED BY public.file.id; -- -- Name: file_scanartifact; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.file_scanartifact ( file_id bigint NOT NULL, scanner_id bigint NOT NULL, layer_id bigint NOT NULL ); ALTER TABLE public.file_scanartifact OWNER TO postgres; -- -- Name: indexreport; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.indexreport ( state text, scan_result jsonb, manifest_id bigint NOT NULL ); ALTER TABLE public.indexreport OWNER TO postgres; -- -- Name: key; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.key ( id uuid NOT NULL, expiration timestamp with time zone, pub_key bytea ); ALTER TABLE public.key OWNER TO postgres; -- -- Name: update_operation; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.update_operation ( id bigint NOT NULL, ref uuid DEFAULT public.uuid_generate_v4(), updater text NOT NULL, fingerprint text, date timestamp with time zone DEFAULT now(), kind text ); ALTER TABLE public.update_operation OWNER TO postgres; -- -- Name: latest_update_operations; Type: MATERIALIZED VIEW; Schema: public; Owner: postgres -- CREATE MATERIALIZED VIEW public.latest_update_operations AS SELECT DISTINCT ON (update_operation.updater) update_operation.id, update_operation.kind, update_operation.updater FROM public.update_operation ORDER BY update_operation.updater, update_operation.id DESC WITH NO DATA; ALTER TABLE public.latest_update_operations OWNER TO postgres; -- -- Name: uo_vuln; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.uo_vuln ( uo bigint NOT NULL, vuln bigint NOT NULL ); ALTER TABLE public.uo_vuln OWNER TO postgres; -- -- Name: vuln; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.vuln ( id bigint NOT NULL, hash_kind text NOT NULL, hash bytea NOT NULL, updater text, name text, description text, issued timestamp with time zone, links text, severity text, normalized_severity text, package_name text, package_version text, package_module text, package_arch text, package_kind text, dist_id text, dist_name text, dist_version text, dist_version_code_name text, dist_version_id text, dist_arch text, dist_cpe text, dist_pretty_name text, repo_name text, repo_key text, repo_uri text, fixed_in_version text, arch_operation text, vulnerable_range public.versionrange DEFAULT public.versionrange('{}'::integer[], '{}'::integer[], '()'::text) NOT NULL, version_kind text ); ALTER TABLE public.vuln OWNER TO postgres; -- -- Name: latest_vuln; Type: VIEW; Schema: public; Owner: postgres -- CREATE VIEW public.latest_vuln AS SELECT v.id, v.hash_kind, v.hash, v.updater, v.name, v.description, v.issued, v.links, v.severity, v.normalized_severity, v.package_name, v.package_version, v.package_module, v.package_arch, v.package_kind, v.dist_id, v.dist_name, v.dist_version, v.dist_version_code_name, v.dist_version_id, v.dist_arch, v.dist_cpe, v.dist_pretty_name, v.repo_name, v.repo_key, v.repo_uri, v.fixed_in_version, v.arch_operation, v.vulnerable_range, v.version_kind FROM ((( SELECT DISTINCT ON (update_operation.updater) update_operation.id FROM public.update_operation ORDER BY update_operation.updater, update_operation.id DESC) uo JOIN public.uo_vuln ON ((uo_vuln.uo = uo.id))) JOIN public.vuln v ON ((uo_vuln.vuln = v.id))); ALTER TABLE public.latest_vuln OWNER TO postgres; -- -- Name: layer; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.layer ( hash text NOT NULL, id bigint NOT NULL ); ALTER TABLE public.layer OWNER TO postgres; -- -- Name: layer_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.layer_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.layer_id_seq OWNER TO postgres; -- -- Name: layer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.layer_id_seq OWNED BY public.layer.id; -- -- Name: libindex_migrations; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.libindex_migrations ( version integer NOT NULL ); ALTER TABLE public.libindex_migrations OWNER TO postgres; -- -- Name: libvuln_migrations; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.libvuln_migrations ( version integer NOT NULL ); ALTER TABLE public.libvuln_migrations OWNER TO postgres; -- -- Name: manifest; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.manifest ( hash text NOT NULL, id bigint NOT NULL ); ALTER TABLE public.manifest OWNER TO postgres; -- -- Name: manifest_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.manifest_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.manifest_id_seq OWNER TO postgres; -- -- Name: manifest_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.manifest_id_seq OWNED BY public.manifest.id; -- -- Name: manifest_index; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.manifest_index ( id bigint NOT NULL, package_id bigint NOT NULL, dist_id bigint, repo_id bigint, manifest_id bigint ); ALTER TABLE public.manifest_index OWNER TO postgres; -- -- Name: manifest_index_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.manifest_index_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.manifest_index_id_seq OWNER TO postgres; -- -- Name: manifest_index_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.manifest_index_id_seq OWNED BY public.manifest_index.id; -- -- Name: manifest_layer; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.manifest_layer ( i bigint NOT NULL, manifest_id bigint NOT NULL, layer_id bigint NOT NULL ); ALTER TABLE public.manifest_layer OWNER TO postgres; -- -- Name: notification; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.notification ( id uuid NOT NULL ); ALTER TABLE public.notification OWNER TO postgres; -- -- Name: notification_body; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.notification_body ( id uuid NOT NULL, notification_id uuid, body jsonb NOT NULL ); ALTER TABLE public.notification_body OWNER TO postgres; -- -- Name: notifier_migrations; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.notifier_migrations ( version integer NOT NULL ); ALTER TABLE public.notifier_migrations OWNER TO postgres; -- -- Name: notifier_update_operation; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.notifier_update_operation ( uo_id uuid NOT NULL, updater text, ts timestamp with time zone ); ALTER TABLE public.notifier_update_operation OWNER TO postgres; -- -- Name: package; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.package ( id bigint NOT NULL, name text NOT NULL, kind text DEFAULT ''::text NOT NULL, version text DEFAULT ''::text NOT NULL, norm_kind text, norm_version integer[], module text DEFAULT ''::text NOT NULL, arch text DEFAULT ''::text NOT NULL ); ALTER TABLE public.package OWNER TO postgres; -- -- Name: package_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.package_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.package_id_seq OWNER TO postgres; -- -- Name: package_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.package_id_seq OWNED BY public.package.id; -- -- Name: package_scanartifact; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.package_scanartifact ( package_id bigint NOT NULL, source_id bigint NOT NULL, scanner_id bigint NOT NULL, package_db text NOT NULL, repository_hint text NOT NULL, layer_id bigint NOT NULL, filepath text ); ALTER TABLE public.package_scanartifact OWNER TO postgres; -- -- Name: receipt; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.receipt ( notification_id uuid NOT NULL, uo_id uuid, status public.receiptstatus NOT NULL, ts timestamp with time zone, details jsonb ); ALTER TABLE public.receipt OWNER TO postgres; -- -- Name: repo; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.repo ( id bigint NOT NULL, name text NOT NULL, key text DEFAULT ''::text, uri text DEFAULT ''::text, cpe text DEFAULT ''::text ); ALTER TABLE public.repo OWNER TO postgres; -- -- Name: repo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.repo_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.repo_id_seq OWNER TO postgres; -- -- Name: repo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.repo_id_seq OWNED BY public.repo.id; -- -- Name: repo_scanartifact; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.repo_scanartifact ( repo_id bigint NOT NULL, scanner_id bigint NOT NULL, layer_id bigint NOT NULL ); ALTER TABLE public.repo_scanartifact OWNER TO postgres; -- -- Name: scanned_layer; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.scanned_layer ( scanner_id bigint NOT NULL, layer_id bigint NOT NULL ); ALTER TABLE public.scanned_layer OWNER TO postgres; -- -- Name: scanned_manifest; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.scanned_manifest ( scanner_id bigint NOT NULL, manifest_id bigint NOT NULL ); ALTER TABLE public.scanned_manifest OWNER TO postgres; -- -- Name: scanner; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.scanner ( id bigint NOT NULL, name text NOT NULL, version text NOT NULL, kind text NOT NULL ); ALTER TABLE public.scanner OWNER TO postgres; -- -- Name: scanner_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.scanner_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.scanner_id_seq OWNER TO postgres; -- -- Name: scanner_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.scanner_id_seq OWNED BY public.scanner.id; -- -- Name: scannerlist; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.scannerlist ( id bigint NOT NULL, manifest_hash text, scanner_id bigint ); ALTER TABLE public.scannerlist OWNER TO postgres; -- -- Name: scannerlist_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.scannerlist_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.scannerlist_id_seq OWNER TO postgres; -- -- Name: scannerlist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.scannerlist_id_seq OWNED BY public.scannerlist.id; -- -- Name: uo_enrich; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.uo_enrich ( uo bigint NOT NULL, enrich bigint NOT NULL, updater text, fingerprint text, date timestamp with time zone ); ALTER TABLE public.uo_enrich OWNER TO postgres; -- -- Name: update_operation_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.update_operation_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.update_operation_id_seq OWNER TO postgres; -- -- Name: update_operation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.update_operation_id_seq OWNED BY public.update_operation.id; -- -- Name: updater_status; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.updater_status ( updater_name text NOT NULL, last_attempt timestamp with time zone DEFAULT now(), last_success timestamp with time zone, last_run_succeeded boolean, last_attempt_fingerprint text, last_error text ); ALTER TABLE public.updater_status OWNER TO postgres; -- -- Name: vuln_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.vuln_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.vuln_id_seq OWNER TO postgres; -- -- Name: vuln_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.vuln_id_seq OWNED BY public.vuln.id; -- -- Name: dist id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.dist ALTER COLUMN id SET DEFAULT nextval('public.dist_id_seq'::regclass); -- -- Name: enrichment id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.enrichment ALTER COLUMN id SET DEFAULT nextval('public.enrichment_id_seq'::regclass); -- -- Name: file id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.file ALTER COLUMN id SET DEFAULT nextval('public.file_id_seq'::regclass); -- -- Name: layer id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.layer ALTER COLUMN id SET DEFAULT nextval('public.layer_id_seq'::regclass); -- -- Name: manifest id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.manifest ALTER COLUMN id SET DEFAULT nextval('public.manifest_id_seq'::regclass); -- -- Name: manifest_index id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.manifest_index ALTER COLUMN id SET DEFAULT nextval('public.manifest_index_id_seq'::regclass); -- -- Name: package id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.package ALTER COLUMN id SET DEFAULT nextval('public.package_id_seq'::regclass); -- -- Name: repo id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.repo ALTER COLUMN id SET DEFAULT nextval('public.repo_id_seq'::regclass); -- -- Name: scanner id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.scanner ALTER COLUMN id SET DEFAULT nextval('public.scanner_id_seq'::regclass); -- -- Name: scannerlist id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.scannerlist ALTER COLUMN id SET DEFAULT nextval('public.scannerlist_id_seq'::regclass); -- -- Name: update_operation id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.update_operation ALTER COLUMN id SET DEFAULT nextval('public.update_operation_id_seq'::regclass); -- -- Name: vuln id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.vuln ALTER COLUMN id SET DEFAULT nextval('public.vuln_id_seq'::regclass); -- -- PostgreSQL database dump complete -- sh-4.4$