summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2016-08-23 12:08:29 +0200
committerMarcin Siodelski <marcin@isc.org>2016-08-23 12:09:36 +0200
commitdb705b7435316a79b2fc946d5af0805702ff4061 (patch)
treecf7b05f00daa1a743f2a2680726902472f6ba0a4
parent[4552] DHCPv4 server assigns reserved siaddr, sname and file field. (diff)
downloadkea-db705b7435316a79b2fc946d5af0805702ff4061.tar.xz
kea-db705b7435316a79b2fc946d5af0805702ff4061.zip
[4552] Added siaddr, sname and file into the hosts table.
-rw-r--r--src/share/database/scripts/mysql/dhcpdb_create.mysql6
-rw-r--r--src/share/database/scripts/pgsql/dhcpdb_create.pgsql6
-rw-r--r--src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in6
3 files changed, 18 insertions, 0 deletions
diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql
index 5d6a321200..4031f50cc1 100644
--- a/src/share/database/scripts/mysql/dhcpdb_create.mysql
+++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql
@@ -465,6 +465,12 @@ ALTER TABLE dhcp6_options
ADD CONSTRAINT fk_dhcp6_option_scope FOREIGN KEY (scope_id)
REFERENCES dhcp_option_scope (scope_id);
+# Add columns holding reservations for siaddr, sname and file fields
+# carried within DHCPv4 message.
+ALTER TABLE hosts ADD COLUMN dhcp4_next_server INT UNSIGNED NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) NULL;
+
# Update the schema version number
UPDATE schema_version
SET version = '4', minor = '2';
diff --git a/src/share/database/scripts/pgsql/dhcpdb_create.pgsql b/src/share/database/scripts/pgsql/dhcpdb_create.pgsql
index 2d5241a6c4..8052ca53ef 100644
--- a/src/share/database/scripts/pgsql/dhcpdb_create.pgsql
+++ b/src/share/database/scripts/pgsql/dhcpdb_create.pgsql
@@ -471,6 +471,12 @@ CREATE FUNCTION lease6DumpData() RETURNS
ORDER BY l.address;
$$ LANGUAGE SQL;
+-- Add columns holding reservations for siaddr, sname and file fields
+-- carried within DHCPv4 message.
+ALTER TABLE hosts ADD COLUMN dhcp4_next_server BIGINT DEFAULT NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) DEFAULT NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) DEFAULT NULL;
+
-- Set 3.0 schema version.
UPDATE schema_version
SET version = '3', minor = '0';
diff --git a/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in b/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in
index 660142cecc..7163d3eea6 100644
--- a/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in
+++ b/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in
@@ -257,6 +257,12 @@ CREATE FUNCTION lease6DumpData() RETURNS
ORDER BY l.address;
\$\$ LANGUAGE SQL;
+-- Add columns holding reservations for siaddr, sname and file fields
+-- carried within DHCPv4 message.
+ALTER TABLE hosts ADD COLUMN dhcp4_next_server BIGINT DEFAULT NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) DEFAULT NULL;
+ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) DEFAULT NULL;
+
-- Set 3.0 schema version.
UPDATE schema_version
SET version = '3', minor = '0';