2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- PostgreSQL database dump
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
|
|
|
|
2006-04-17 22:24:38 +02:00
|
|
|
SET client_encoding = 'UNICODE';
|
2006-02-20 00:32:53 +01:00
|
|
|
SET check_function_bodies = false;
|
|
|
|
|
2006-04-17 22:24:38 +02:00
|
|
|
SET SESSION AUTHORIZATION 'postgres';
|
|
|
|
|
|
|
|
BEGIN;
|
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: public; Type: ACL; Schema: -; Owner: postgres
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
|
|
|
|
2006-04-17 22:24:38 +02:00
|
|
|
REVOKE ALL ON SCHEMA public FROM PUBLIC;
|
|
|
|
GRANT ALL ON SCHEMA public TO PUBLIC;
|
|
|
|
|
|
|
|
SET SESSION AUTHORIZATION 'gnuviech';
|
|
|
|
|
|
|
|
SET search_path = public, pg_catalog;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: country; Type: TABLE; Schema: public; Owner: gnuviech
|
|
|
|
--
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE country (
|
2006-04-17 22:24:38 +02:00
|
|
|
countryid serial PRIMARY KEY,
|
|
|
|
name character varying(40) NOT NULL
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE country FROM PUBLIC;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: reseller; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
|
|
|
CREATE TABLE reseller (
|
|
|
|
resellerid serial PRIMARY KEY,
|
|
|
|
name character varying(40) NOT NULL
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
|
|
|
REVOKE ALL ON TABLE reseller FROM PUBLIC;
|
2006-02-20 00:32:53 +01:00
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: client; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE client (
|
2006-04-17 22:24:38 +02:00
|
|
|
clientid serial PRIMARY KEY,
|
|
|
|
firstname character varying(40) NOT NULL,
|
|
|
|
lastname character varying(40) NOT NULL,
|
|
|
|
address1 character varying(40) NOT NULL,
|
|
|
|
address2 character varying(40),
|
|
|
|
countryid integer NOT NULL REFERENCES country(countryid),
|
|
|
|
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 REFERENCES reseller(resellerid),
|
|
|
|
organisation character varying(200)
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE client FROM PUBLIC;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: email; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE email (
|
2006-04-17 22:24:38 +02:00
|
|
|
emailid serial PRIMARY KEY,
|
|
|
|
email character varying(128) NOT NULL,
|
|
|
|
clientid integer NOT NULL REFERENCES client(clientid),
|
|
|
|
verified boolean DEFAULT false NOT NULL
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE email FROM PUBLIC;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: sysuser; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE sysuser (
|
2006-04-17 22:24:38 +02:00
|
|
|
sysuserid serial PRIMARY KEY,
|
|
|
|
name character varying(12) NOT NULL,
|
|
|
|
"type" integer DEFAULT 0 NOT NULL,
|
|
|
|
home character varying(128),
|
|
|
|
shell boolean,
|
|
|
|
"password" character varying(64),
|
|
|
|
clientid integer NOT NULL REFERENCES client(clientid),
|
|
|
|
toupdate boolean DEFAULT false NOT NULL,
|
|
|
|
md5pass character varying(32),
|
|
|
|
sysuid integer UNIQUE
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE sysuser FROM PUBLIC;
|
|
|
|
GRANT SELECT ON TABLE sysuser TO GROUP services;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: domain; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE "domain" (
|
2006-04-17 22:24:38 +02:00
|
|
|
domainid serial PRIMARY KEY,
|
|
|
|
domainname character varying(64) NOT NULL,
|
|
|
|
clientid integer NOT NULL REFERENCES client(clientid),
|
|
|
|
status integer DEFAULT 0 NOT NULL,
|
|
|
|
sysuserid integer NOT NULL REFERENCES sysuser(sysuserid)
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE "domain" FROM PUBLIC;
|
|
|
|
GRANT SELECT ON TABLE "domain" TO GROUP services;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: zone; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE "zone" (
|
2006-04-17 22:24:38 +02:00
|
|
|
zoneid serial PRIMARY KEY,
|
|
|
|
"domain" integer NOT NULL REFERENCES domain(domainid),
|
|
|
|
"type" character varying(5) NOT NULL,
|
|
|
|
ttl integer NOT NULL,
|
|
|
|
mxprio integer,
|
|
|
|
resource character varying(256),
|
|
|
|
toupdate boolean DEFAULT false NOT NULL
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE "zone" FROM PUBLIC;
|
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: mailpasswd; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE mailpasswd (
|
2006-04-17 22:24:38 +02:00
|
|
|
id character varying(128) NOT NULL,
|
|
|
|
crypt character varying(128) DEFAULT '' NOT NULL,
|
|
|
|
clear character varying(128) DEFAULT '' NOT NULL,
|
|
|
|
name character varying(128) DEFAULT '' NOT NULL,
|
|
|
|
uid integer DEFAULT 65534 NOT NULL,
|
|
|
|
gid integer DEFAULT 65534 NOT NULL,
|
|
|
|
home character varying(255) DEFAULT '' NOT NULL,
|
|
|
|
maildir character varying(255) DEFAULT '' NOT NULL,
|
|
|
|
defaultdelivery character varying(255) DEFAULT '' NOT NULL,
|
|
|
|
quota character varying(255) DEFAULT '' NOT NULL,
|
|
|
|
spamcheck boolean DEFAULT false NOT NULL,
|
|
|
|
sajunkscore integer
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE mailpasswd FROM PUBLIC;
|
2006-04-17 22:24:38 +02:00
|
|
|
GRANT ALL ON TABLE mailpasswd TO GROUP services;
|
2006-02-20 00:32:53 +01:00
|
|
|
|
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
-- Name: mailalias; Type: TABLE; Schema: public; Owner: gnuviech
|
2006-02-20 00:32:53 +01:00
|
|
|
--
|
2006-04-17 22:24:38 +02:00
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
CREATE TABLE mailalias (
|
2006-04-17 22:24:38 +02:00
|
|
|
email character varying(255) NOT NULL,
|
|
|
|
"domain" character varying(255) NOT NULL,
|
|
|
|
target character varying(255) NOT NULL
|
2006-02-20 00:32:53 +01:00
|
|
|
);
|
2006-04-17 22:24:38 +02:00
|
|
|
|
|
|
|
|
2006-02-20 00:32:53 +01:00
|
|
|
REVOKE ALL ON TABLE mailalias FROM PUBLIC;
|
2006-04-17 22:24:38 +02:00
|
|
|
GRANT ALL ON TABLE mailalias TO GROUP services;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: country; Type: TABLE DATA; Schema: public; Owner: gnuviech
|
|
|
|
--
|
|
|
|
|
|
|
|
INSERT INTO country (countryid, name) VALUES (1, 'Deutschland');
|
|
|
|
INSERT INTO country (countryid, name) VALUES (2, 'Schweiz');
|
|
|
|
INSERT INTO country (countryid, name) VALUES (3, 'Österreich');
|
|
|
|
|
|
|
|
SET SESSION AUTHORIZATION 'postgres';
|
|
|
|
|
|
|
|
COMMIT;
|