2003-11-23 13:04:03 +01:00
|
|
|
--
|
|
|
|
-- PostgreSQL database dump
|
|
|
|
--
|
|
|
|
|
|
|
|
SET search_path = public, pg_catalog;
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 2 (OID 17132)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: country; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE country (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
name character varying(40) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 3 (OID 17137)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: client; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE client (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
firstname character varying(40) NOT NULL,
|
|
|
|
lastname character varying(40) NOT NULL,
|
|
|
|
address1 character varying(40) NOT NULL,
|
|
|
|
address2 character varying(40),
|
|
|
|
country integer NOT NULL,
|
|
|
|
town character varying(50) NOT NULL,
|
|
|
|
zipcode character(5) NOT NULL,
|
|
|
|
state character varying(40),
|
|
|
|
active boolean DEFAULT false NOT NULL,
|
|
|
|
phone character varying(20),
|
|
|
|
mobile character varying(20),
|
|
|
|
reseller_id integer
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 4 (OID 17143)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: reseller; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE reseller (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
name character varying(40) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 5 (OID 17148)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: email; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE email (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
email character varying(128) NOT NULL,
|
|
|
|
client integer,
|
|
|
|
verified boolean DEFAULT false NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 6 (OID 17154)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: sysuser; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE sysuser (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
name character varying(12) NOT NULL,
|
|
|
|
"type" integer DEFAULT 0 NOT NULL,
|
|
|
|
home character varying(128),
|
|
|
|
shell boolean,
|
|
|
|
"password" character varying(64),
|
|
|
|
client integer NOT NULL,
|
2003-11-23 14:12:08 +01:00
|
|
|
toupdate boolean DEFAULT false NOT NULL,
|
2003-11-23 20:42:21 +01:00
|
|
|
md5pass character varying(32),
|
|
|
|
sysuid integer
|
2003-11-23 13:04:03 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 7 (OID 17161)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: domain; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE "domain" (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
domainname character varying(64) NOT NULL,
|
|
|
|
client integer NOT NULL,
|
|
|
|
status integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 8 (OID 17167)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: zone; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE "zone" (
|
2003-11-23 16:08:05 +01:00
|
|
|
id serial NOT NULL,
|
2003-11-23 13:04:03 +01:00
|
|
|
"domain" integer NOT NULL,
|
|
|
|
"type" character varying(5) NOT NULL,
|
|
|
|
ttl integer NOT NULL,
|
|
|
|
mxprio integer,
|
|
|
|
resource character varying(256),
|
|
|
|
toupdate boolean DEFAULT false NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 12 (OID 17171)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: reseller_name_idx; Type: INDEX; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX reseller_name_idx ON reseller USING btree (name);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 9 (OID 17172)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: country_name_idx; Type: INDEX; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX country_name_idx ON country USING btree (name);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 19 (OID 17173)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: sysuser_type_idx; Type: INDEX; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE INDEX sysuser_type_idx ON sysuser USING btree ("type");
|
|
|
|
|
|
|
|
|
2003-11-23 20:42:21 +01:00
|
|
|
--
|
|
|
|
-- TOC entry 18 (OID 17231)
|
|
|
|
-- Name: sysuser_sysuid_idx; Type: INDEX; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX sysuser_sysuid_idx ON sysuser USING btree (sysuid);
|
|
|
|
|
|
|
|
|
2003-11-23 13:04:03 +01:00
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 10 (OID 17174)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: country_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY country
|
|
|
|
ADD CONSTRAINT country_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 11 (OID 17176)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: client_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY client
|
|
|
|
ADD CONSTRAINT client_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 22 (OID 17178)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $1; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY client
|
|
|
|
ADD CONSTRAINT "$1" FOREIGN KEY (country) REFERENCES country(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 13 (OID 17182)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: reseller_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY reseller
|
|
|
|
ADD CONSTRAINT reseller_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 23 (OID 17184)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $2; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY client
|
|
|
|
ADD CONSTRAINT "$2" FOREIGN KEY (reseller_id) REFERENCES reseller(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 15 (OID 17188)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: email_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY email
|
|
|
|
ADD CONSTRAINT email_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 14 (OID 17190)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: email_email_key; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY email
|
|
|
|
ADD CONSTRAINT email_email_key UNIQUE (email);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 24 (OID 17192)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $1; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY email
|
|
|
|
ADD CONSTRAINT "$1" FOREIGN KEY (client) REFERENCES client(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 17 (OID 17196)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: sysuser_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY sysuser
|
|
|
|
ADD CONSTRAINT sysuser_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 16:08:05 +01:00
|
|
|
-- TOC entry 16 (OID 17198)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: sysuser_name_key; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY sysuser
|
|
|
|
ADD CONSTRAINT sysuser_name_key UNIQUE (name);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 25 (OID 17200)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $1; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY sysuser
|
|
|
|
ADD CONSTRAINT "$1" FOREIGN KEY (client) REFERENCES client(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 20 (OID 17204)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: domain_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY "domain"
|
|
|
|
ADD CONSTRAINT domain_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 26 (OID 17206)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $1; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY "domain"
|
|
|
|
ADD CONSTRAINT "$1" FOREIGN KEY (client) REFERENCES client(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 21 (OID 17210)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: zone_pkey; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY "zone"
|
|
|
|
ADD CONSTRAINT zone_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2003-11-23 20:42:21 +01:00
|
|
|
-- TOC entry 27 (OID 17212)
|
2003-11-23 13:04:03 +01:00
|
|
|
-- Name: $1; Type: CONSTRAINT; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY "zone"
|
|
|
|
ADD CONSTRAINT "$1" FOREIGN KEY ("domain") REFERENCES "domain"(id) ON UPDATE NO ACTION ON DELETE NO ACTION;
|
|
|
|
|
|
|
|
|