From: Christian Hofstaedtler Date: Mon, 24 Feb 2014 15:01:48 +0000 (+0100) Subject: Default 'disabled' to 0/f (vs. NULL) in gsql backends X-Git-Tag: rec-3.6.0-rc1~167^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=635459b9d66709c03e183df819bb44e1fcd3fea3;p=thirdparty%2Fpdns.git Default 'disabled' to 0/f (vs. NULL) in gsql backends Otherwise, records would effectively be disabled when the user wasn't explicitly inserting 0. --- diff --git a/modules/gmysqlbackend/no-dnssec.schema.mysql.sql b/modules/gmysqlbackend/no-dnssec.schema.mysql.sql index c58283c248..88c9679a94 100644 --- a/modules/gmysqlbackend/no-dnssec.schema.mysql.sql +++ b/modules/gmysqlbackend/no-dnssec.schema.mysql.sql @@ -20,7 +20,7 @@ CREATE TABLE records ( ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, - disabled INT DEFAULT NULL, + disabled INT DEFAULT 0, primary key(id) ) Engine=InnoDB; diff --git a/modules/goraclebackend/goracle-schema.sql b/modules/goraclebackend/goracle-schema.sql index 31796f3001..bb902e8669 100644 --- a/modules/goraclebackend/goracle-schema.sql +++ b/modules/goraclebackend/goracle-schema.sql @@ -22,7 +22,7 @@ CREATE TABLE records ( ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, - disabled INT DEFAULT NULL, + disabled INT DEFAULT 0, ordername VARCHAR(255) DEFAULT NULL, auth INT DEFAULT NULL, primary key (id) diff --git a/modules/gpgsqlbackend/no-dnssec.schema.pgsql.sql b/modules/gpgsqlbackend/no-dnssec.schema.pgsql.sql index 53d9ec56a1..9f9560cbed 100644 --- a/modules/gpgsqlbackend/no-dnssec.schema.pgsql.sql +++ b/modules/gpgsqlbackend/no-dnssec.schema.pgsql.sql @@ -19,7 +19,7 @@ CREATE TABLE records ( ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, - disabled BOOL DEFAULT NULL, + disabled BOOL DEFAULT 'f', CONSTRAINT domain_exists FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE, diff --git a/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql b/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql index 81aed15bc5..0abcccb32b 100644 --- a/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql +++ b/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql @@ -19,7 +19,7 @@ CREATE TABLE records ( ttl INTEGER DEFAULT NULL, prio INTEGER DEFAULT NULL, change_date INTEGER DEFAULT NULL, - disabled BOOLEAN DEFAULT NULL + disabled BOOLEAN DEFAULT 0 ); CREATE INDEX rec_name_index ON records(name); diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index bf62b4485e..743c261086 100644 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -12477,23 +12477,19 @@ create index recordorder on records (domain_id, ordername text_pattern_ops); An GSQL Backend schema change is necessary for new features. For MySQL: -ALTER TABLE records ADD disabled BOOLEAN; -UPDATE records SET disabled=0; +ALTER TABLE records ADD disabled BOOLEAN DEFAULT 0; For PostgreSQL: -ALTER TABLE records ADD disabled BOOLEAN; -UPDATE records SET disabled=false; +ALTER TABLE records ADD disabled BOOLEAN DEFAULT 'f'; For SQLite 3: -ALTER TABLE records ADD disabled BOOLEAN; -UPDATE records SET disabled=0; +ALTER TABLE records ADD disabled BOOLEAN DEFAULT 0; For Oracle: -ALTER TABLE records ADD disabled INT; -UPDATE records SET disabled=0; +ALTER TABLE records ADD disabled INT DEFAULT 0;