summaryrefslogtreecommitdiffstats
path: root/src/share/database/scripts/mysql/dhcpdb_create.mysql
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/database/scripts/mysql/dhcpdb_create.mysql')
-rw-r--r--src/share/database/scripts/mysql/dhcpdb_create.mysql34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql
index a212dc8cf9..8423b8e328 100644
--- a/src/share/database/scripts/mysql/dhcpdb_create.mysql
+++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql
@@ -6070,27 +6070,61 @@ UPDATE schema_version
-- This line starts the schema upgrade to version 27.0.
+SET @disable_audit = 1;
+
+DROP FUNCTION IF EXISTS textToJSONList;
+DELIMITER $$
+CREATE FUNCTION textToJSONList(orig TEXT)
+RETURNS TEXT
+DETERMINISTIC
+BEGIN
+ IF orig = '' THEN
+ RETURN NULL;
+ END IF;
+
+ RETURN CONCAT('[ "', orig, '" ]');
+END $$
+DELIMITER ;
+
ALTER TABLE dhcp4_shared_network
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp4_shared_network SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp4_subnet
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp4_subnet SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp4_pool
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp4_pool SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp6_shared_network
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp6_shared_network SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp6_subnet
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp6_subnet SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp6_pool
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp6_pool SET client_classes = textToJSONList(client_classes);
+
ALTER TABLE dhcp6_pd_pool
CHANGE client_class client_classes LONGTEXT DEFAULT NULL;
+UPDATE dhcp6_pd_pool SET client_classes = textToJSONList(client_classes);
+
+DROP FUNCTION textToJSONList;
+
+SET @disable_audit = 0;
+
-- Update the schema version number.
UPDATE schema_version
SET version = '27', minor = '0';