From: Tomek Mrugalski Date: Mon, 24 Apr 2017 19:29:15 +0000 (+0200) Subject: [master] Merge branch 'trac5208a' (preparations for host_cmds hook) X-Git-Tag: trac5212_base~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88555d8f23745f3d615448e906796920cc7f44d0;p=thirdparty%2Fkea.git [master] Merge branch 'trac5208a' (preparations for host_cmds hook) --- 88555d8f23745f3d615448e906796920cc7f44d0 diff --cc src/share/database/scripts/mysql/dhcpdb_create.mysql index d167e3aeff,ba946f7b9b..1ebbcee348 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@@ -480,10 -480,24 +480,25 @@@ UPDATE schema_versio SET version = '5', minor = '0'; # This line concludes database upgrade to version 5.0. -# Add missing 'client-id' host identifier type. +# Add missing 'client-id' and new 'flex-id' host identifier types. INSERT INTO host_identifier_type VALUES (3, 'client-id'); +INSERT INTO host_identifier_type VALUES (4, 'flex-id'); + # Recreate the trigger removing dependent host entries. + DROP TRIGGER host_BDEL; + + DELIMITER $$ + CREATE TRIGGER host_BDEL BEFORE DELETE ON hosts FOR EACH ROW + -- Edit trigger body code below this line. Do not edit lines above this one + BEGIN + DELETE FROM ipv6_reservations WHERE ipv6_reservations.host_id = OLD.host_id; + DELETE FROM dhcp4_options WHERE dhcp4_options.host_id = OLD.host_id; + DELETE FROM dhcp6_options WHERE dhcp6_options.host_id = OLD.host_id; + END + $$ + DELIMITER ; + + # Update the schema version number UPDATE schema_version SET version = '5', minor = '1'; diff --cc src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in index 99bccebb5b,f8440b3a12..14d0ef0139 --- a/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in @@@ -17,10 -17,23 +17,24 @@@ f mysql "$@" <