--
-- Selected TOC Entries:
--

-- $Id: db-secadvisory.sql,v 1.1 2002/03/18 22:43:04 fpmip Exp $

-- Author : Alexandre Dulaunoy 
-- Copyright (C) 2001 Alexandre Dulaunoy <alex@thinkingsecure.com>
-- Copyright (C) 2001 Conostix S.A. Luxembourg - Alexandre Dulaunoy <alex@conostix.com>

-- This program is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2 of the License, or (at your
-- option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- for more details.

create table ipfc_schema
(
	component	text,
	version		text,
	id		text,
	date		timestamp default now()
);

insert into ipfc_schema (component,version,id) 
	values ('db-secadvisory',
		'20020128-01',
		'$Id: db-secadvisory.sql,v 1.1 2002/03/18 22:43:04 fpmip Exp $');

--
-- Selected TOC Entries:
--
--
-- TOC Entry ID 2 (OID 17973)
--
-- Name: advisory_id_seq Type: SEQUENCE Owner: alex
--

CREATE SEQUENCE "advisory_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;

--
-- TOC Entry ID 5 (OID 17975)
--
-- Name: advisory Type: TABLE Owner: alex
--

CREATE TABLE "advisory" (
	"advisory_id" integer DEFAULT nextval('"advisory_id_seq"'::text) NOT NULL,
	"source_id" integer NOT NULL,
	"advisory_text" text,
	"advisory_creation" timestamp(6) with time zone DEFAULT now(),
	"advisory_modified" timestamp(6) with time zone DEFAULT now(),
	"advisory_enable" boolean DEFAULT 't',
	"user_id" integer,
	"advisory_id_src" text,
	Constraint "advisory_pkey" Primary Key ("advisory_id")
);

--
-- TOC Entry ID 3 (OID 17981)
--
-- Name: source_id_seq Type: SEQUENCE Owner: alex
--

CREATE SEQUENCE "source_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;

--
-- TOC Entry ID 6 (OID 17983)
--
-- Name: source Type: TABLE Owner: alex
--

CREATE TABLE "source" (
	"source_id" integer DEFAULT nextval('"source_id_seq"'::text) NOT NULL,
	"source_url" text,
	"source_enable" boolean DEFAULT 't',
	"source_creation" timestamp(6) with time zone DEFAULT now(),
	"source_remark" text
);

--
-- TOC Entry ID 4 (OID 17988)
--
-- Name: tracking_id_seq Type: SEQUENCE Owner: alex
--

CREATE SEQUENCE "tracking_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;

--
-- TOC Entry ID 7 (OID 17990)
--
-- Name: tracking Type: TABLE Owner: alex
--

CREATE TABLE "tracking" (
	"tracking_id" integer DEFAULT nextval('"tracking_id_seq"'::text) NOT NULL,
	"advisory_id" integer,
	"external_inventory" text,
	"tracking_correct" boolean DEFAULT 't',
	"tracking_done" boolean DEFAULT 't',
	"tracking_creation" timestamp(6) with time zone DEFAULT now(),
	"tracking_remark" text
);


--
-- TOC Entry ID 20 (OID 318556)
--
-- Name: "advisory_advisory_id_src" Type: INDEX Owner: alex
--

CREATE UNIQUE INDEX advisory_advisory_id_src ON advisory USING btree (advisory_id_src);

