Commit 6ddeded2 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

add sql {dirty,delete}-bit

parent b7916759
......@@ -22,8 +22,13 @@ CREATE TABLE domain
name varchar(191), -- hornquist.se
uid int(11), -- 2278
dirtybit bool NOT NULL DEFAULT 0,
deletebit bool NOT NULL DEFAULT 0,
CONSTRAINT pk_domain_id PRIMARY KEY (id),
CONSTRAINT uc_domain_name UNIQUE (name)
CONSTRAINT uc_domain_name UNIQUE (name),
INDEX idx_domain_dirtybit dirtybit,
INDEX idx_domain_deletebit deletebit
)ENGINE=InnoDB;//
......@@ -38,23 +43,28 @@ CREATE TABLE subdomain
domainid int(11),
dirtybit bool NOT NULL DEFAULT 0,
deletebit bool NOT NULL DEFAULT 0,
CONSTRAINT pk_subdomain_id PRIMARY KEY (id),
CONSTRAINT fk_subdomain_domid FOREIGN KEY (domainid) REFERENCES domain(id),
CONSTRAINT fk_subdomain_rr FOREIGN KEY (rr) REFERENCES record_types (id),
CONSTRAINT uc_subdomain_name_domainid UNIQUE (name, domainid)
CONSTRAINT uc_subdomain_name_domainid UNIQUE (name, domainid),
INDEX idx_subdomain_dirtybit dirtybit,
INDEX idx_subdomain_deletebit deletebit
)ENGINE=InnoDB;//
CREATE TABLE update_key
(
id int(11) NOT NULL AUTO_INCREMENT,
domainid int(11) NOT NULL,
subid int(11) NOT NULL,
update_key varchar(255) NOT NULL,
secret varchar(255) NOT NULL,
CONSTRAINT pk_update_key_id PRIMARY KEY (id),
CONSTRAINT fk_update_key_domid FOREIGN KEY (domainid) REFERENCES domain(id)
CONSTRAINT fk_update_key_subid FOREIGN KEY (subid) REFERENCES subdomain (id)
)ENGINE=InnoDB;//
......@@ -17,4 +17,4 @@ INSERT INTO subdomain (id, domainid, name, rr, ttl)
VALUES (1, 1, "@", 1, 300),
(2, 2, "www", 1, 300),
(3, 1, "blog", 1, 300),
(4, 3, "jeff", 1, 86400);
(4, 3, "jeff", 2, 86400);
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