From: Marcin Siodelski Date: Mon, 8 Oct 2018 11:13:10 +0000 (+0200) Subject: [#93,!63] Added logical servers to dhcp4_server and dhcp6_server MySQL. X-Git-Tag: 153-netconf-configs_base~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4805251ff1477462cbb6528df519752ddb092c8;p=thirdparty%2Fkea.git [#93,!63] Added logical servers to dhcp4_server and dhcp6_server MySQL. --- diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index a54d1346ce..e5370b8801 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -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" diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql index cf09f99332..cd7692b409 100644 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@ -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` -- ----------------------------------------------------- diff --git a/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in b/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in index fb8beff7cc..de9ea68df3 100644 --- a/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in @@ -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 (