]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#93,!63] Added logical servers to dhcp4_server and dhcp6_server MySQL.
authorMarcin Siodelski <marcin@isc.org>
Mon, 8 Oct 2018 11:13:10 +0000 (13:13 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 18 Oct 2018 11:35:08 +0000 (13:35 +0200)
src/bin/admin/tests/mysql_tests.sh.in
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in

index a54d1346ceecb68194a2090291eb7d36ab0aa59e..e5370b8801d2377e0503bff2727efead0ddc5b71 100644 (file)
@@ -482,6 +482,10 @@ EOF
     qry="select id, tag, description, modification_ts from dhcp4_server"
     run_statement "dhcp4_server" "$qry"
 
+    # table: dhcp4_server - check if it contains default entries
+    qry="select count(*) from dhcp4_server"
+    run_statement "dhcp4_server" "$qry" 2
+
     # table: dhcp4_audit
     qry="select id, object_type, object_id, modification_type, modification_ts, log_message from dhcp4_audit"
     run_statement "dhcp4_audit" "$qry"
@@ -534,6 +538,10 @@ EOF
     qry="select id, tag, description, modification_ts from dhcp6_server"
     run_statement "dhcp6_server" "$qry"
 
+    # table: dhcp6_server - check if it contains default entries
+    qry="select count(*) from dhcp6_server"
+    run_statement "dhcp6_server" "$qry" 2
+
     # table: dhcp6_audit
     qry="select id, object_type, object_id, modification_type, modification_ts, log_message from dhcp6_audit"
     run_statement "dhcp6_audit" "$qry"
index cf09f993325bab364966d714d3e49ab821a84516..cd7692b409e811176856a59bbb3ae3b5f16a995c 100644 (file)
@@ -812,6 +812,18 @@ CREATE TABLE IF NOT EXISTS dhcp4_server (
     KEY key_dhcp4_server_modification_ts (modification_ts)
 ) ENGINE=InnoDB;
 
+# Special server entry meaning "unassigned server". This refers
+# to configuration entries that shouldn't be used by any of the
+# servers, e.g. when configuration entry is created but an
+# administrator doesn't want the servers to start using it yet.
+INSERT INTO dhcp4_server(id, tag, description, modification_ts)
+    VALUES(1, "unassigned", "special type: unassigned server", NOW());
+
+# Special server entry meaning "all servers". This refers to
+# the configuration entries owned by all servers.
+INSERT INTO dhcp4_server(id, tag, description, modification_ts)
+    VALUES(2, "all", "special type: all servers", NOW());
+
 -- -----------------------------------------------------
 -- Table `dhcp4_audit`
 -- -----------------------------------------------------
@@ -1065,6 +1077,18 @@ CREATE TABLE IF NOT EXISTS dhcp6_server (
     KEY key_dhcp6_server_modification_ts (modification_ts)
 ) ENGINE=InnoDB;
 
+# Special server entry meaning "unassigned server". This refers
+# to configuration entries that shouldn't be used by any of the
+# servers, e.g. when configuration entry is created but an
+# administrator doesn't want the servers to start using it yet.
+INSERT INTO dhcp6_server(id, tag, description, modification_ts)
+    VALUES(1, "unassigned", "special type: unassigned server", NOW());
+
+# Special server entry meaning "all servers". This refers to
+# the configuration entries owned by all servers.
+INSERT INTO dhcp6_server(id, tag, description, modification_ts)
+    VALUES(2, "all", "special type: all servers", NOW());
+
 -- -----------------------------------------------------
 -- Table `dhcp6_audit`
 -- -----------------------------------------------------
index fb8beff7ccc6c484cb5c0a8daa241759cb20f5e4..de9ea68df3a065b2445bc725d017202dc9581e5e 100644 (file)
@@ -152,6 +152,18 @@ CREATE TABLE IF NOT EXISTS dhcp4_server (
     KEY key_dhcp4_server_modification_ts (modification_ts)
 ) ENGINE=InnoDB;
 
+# Special server entry meaning "unassigned server". This refers
+# to configuration entries that shouldn't be used by any of the
+# servers, e.g. when configuration entry is created but an
+# administrator doesn't want the servers to start using it yet.
+INSERT INTO dhcp4_server(id, tag, description, modification_ts)
+    VALUES(1, "unassigned", "special type: unassigned server", NOW());
+
+# Special server entry meaning "all servers". This refers to
+# the configuration entries owned by all servers.
+INSERT INTO dhcp4_server(id, tag, description, modification_ts)
+    VALUES(2, "all", "special type: all servers", NOW());
+
 # Create table dhcp4_audit
 #
 CREATE TABLE IF NOT EXISTS dhcp4_audit (
@@ -390,6 +402,18 @@ CREATE TABLE IF NOT EXISTS dhcp6_server (
     KEY key_dhcp6_server_modification_ts (modification_ts)
 ) ENGINE=InnoDB;
 
+# Special server entry meaning "unassigned server". This refers
+# to configuration entries that shouldn't be used by any of the
+# servers, e.g. when configuration entry is created but an
+# administrator doesn't want the servers to start using it yet.
+INSERT INTO dhcp6_server(id, tag, description, modification_ts)
+    VALUES(1, "unassigned", "special type: unassigned server", NOW());
+
+# Special server entry meaning "all servers". This refers to
+# the configuration entries owned by all servers.
+INSERT INTO dhcp6_server(id, tag, description, modification_ts)
+    VALUES(2, "all", "special type: all servers", NOW());
+
 # Create table dhcp6_audit
 #
 CREATE TABLE IF NOT EXISTS dhcp6_audit (