Created
June 2, 2012 18:45
-
-
Save marvin/2859565 to your computer and use it in GitHub Desktop.
MyDNS postgresql create-table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Table layouts for mydns 1.2.8.11 (Jun 2012) | |
-- Copyright (C) 2002-2005 Don Moore 2007-2008 Howard Wilkinson | |
-- | |
-- You might create these tables with a command like: | |
-- | |
-- $ mydns --create-tables | psql -h HOST -U USER DATABASE | |
-- | |
-- | |
-- | |
-- Table structure for table 'soa' (zones of authority) | |
-- | |
CREATE TABLE soa ( | |
id SERIAL NOT NULL PRIMARY KEY, | |
origin VARCHAR(255) NOT NULL, | |
ns VARCHAR(255) NOT NULL, | |
mbox VARCHAR(255) NOT NULL, | |
serial INTEGER NOT NULL default 1, | |
refresh INTEGER NOT NULL default 28800, | |
retry INTEGER NOT NULL default 7200, | |
expire INTEGER NOT NULL default 604800, | |
minimum INTEGER NOT NULL default 86400, | |
ttl INTEGER NOT NULL default 86400, | |
UNIQUE (origin) | |
); | |
-- | |
-- Table structure for table 'rr' (resource records) | |
-- | |
CREATE TABLE rr ( | |
id SERIAL NOT NULL PRIMARY KEY, | |
zone INTEGER NOT NULL, | |
name VARCHAR(64) NOT NULL, | |
data BYTEA NOT NULL, | |
aux INTEGER NOT NULL default 0, | |
ttl INTEGER NOT NULL default 86400, | |
type VARCHAR(5) NOT NULL CHECK (type='A' OR type='AAAA' OR type='CNAME' OR type='HINFO' OR type='MX' OR type='NAPTR' OR type='NS' OR type='PTR' OR type='RP' OR type='SRV' OR type='TXT'), | |
UNIQUE (zone,name,type,data), | |
FOREIGN KEY (zone) REFERENCES soa (id) ON DELETE CASCADE | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment