Commit defce540 authored by Hugo Hörnquist's avatar Hugo Hörnquist Committed by Andreas Kempe
Browse files

Changed subdomain class to reference foreign table

I changed the class option in [subdomain] to be a reference
to a new table. A minor addition, but it should make data
storage better.

Note that diagram pictures not updated because I don't know how.
parent 676fd306
DROP TABLE person;
DROP TABLE domain;
DROP TABLE mail;
DROP TABLE record_types;
CREATE TABLE person (
id INTEGER PRIMARY KEY AUTOINCREMENT,
......@@ -15,6 +16,15 @@ CREATE TABLE domain (
FOREIGN KEY(userid) REFERENCES person(id)
);
CREATE TABLE record_types (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT
);
INSERT INTO record_types (name),
("MX"),
("A"),
("AAAA");
CREATE TABLE subdomain (
id INTEGER PRIMARY KEY AUTOINCREMENT,
domainid INTEGER,
......@@ -22,8 +32,9 @@ CREATE TABLE subdomain (
ttl INTEGER,
rr TEXT,
dest BLOB,
class TEXT,
FOREIGN KEY(domainid) REFERENCES domain(id)
class INTEGER,
FOREIGN KEY(domainid) REFERENCES domain(id),
FOREIGN KEY(class) REFERENCES record_types(id);
);
CREATE TABLE keys (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment