File: //usr/local/share/hostingplatform/schema.sql
CREATE TABLE domain_aliases (
domain text REFERENCES hosting_domains (domainname)
ON DELETE CASCADE ON UPDATE CASCADE NOT NULL,
alias text NOT NULL UNIQUE,
operationmode text NOT NULL DEFAULT 'http',
platform text DEFAULT '8.2'
);
CREATE TABLE hosting (
packagename varchar(64) PRIMARY KEY NOT NULL,
storage integer not null,
bandwidth integer not null,
suspended boolean not null default 'true',
emailaddress text);
CREATE TABLE hosting_domains (
packagename varchar(64) REFERENCES hosting (packagename)
ON DELETE CASCADE ON UPDATE CASCADE,
domainname text primary key not null,
operationmode text NOT NULL DEFAULT 'http',
ipv4 text,
ipv6 text,
stats boolean default false,
platform text DEFAUlT '8.2');
CREATE TABLE hosting_ftpusers (
packagename varchar(64) not null REFERENCES hosting (packagename)
ON DELETE CASCADE ON UPDATE CASCADE,
username varchar(128) UNIQUE not null,
password text not null,
chroot text
);
CREATE TABLE server_settings (setting text primary key, value text not null);
INSERT INTO server_settings VALUES('phpmyadmin_redirect','1');
CREATE TABLE backup_schedule (hour int2 NOT NULL UNIQUE);
INSERT INTO backup_schedule VALUES(0);
INSERT INTO backup_schedule VALUES(4);
INSERT INTO backup_schedule VALUES(8);
INSERT INTO backup_schedule VALUES(12);
INSERT INTO backup_schedule VALUES(16);
INSERT INTO backup_schedule VALUES(20);