]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2063] DROP FOREIGN KEY for MySQL 5 compatibility Kea-1.9.11
authorAndrei Pavel <andrei@isc.org>
Mon, 30 Aug 2021 11:55:14 +0000 (14:55 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 30 Aug 2021 11:55:14 +0000 (14:55 +0300)
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_010_to_011.sh.in

index b1f2de4538c601739c4ddc776767bc1e435d19de..e04ea8933da99d5f2ff958b1943769f61dceea0d 100644 (file)
@@ -4018,14 +4018,14 @@ UPDATE schema_version
 # Add a constraint that any state value added to the lease4 must
 # map to a value in the lease_state table.  Note we have to drop
 # the foreign keys first, then add them back.
-ALTER TABLE lease4 DROP CONSTRAINT fk_lease4_state;
+ALTER TABLE lease4 DROP FOREIGN KEY fk_lease4_state;
 DROP INDEX lease4_by_state_expire ON lease4;
 CREATE INDEX lease4_by_expire_state ON lease4 (expire ASC, state ASC);
 ALTER TABLE lease4
     ADD CONSTRAINT fk_lease4_state FOREIGN KEY (state)
     REFERENCES lease_state (state);
 
-ALTER TABLE lease6 DROP CONSTRAINT fk_lease6_state;
+ALTER TABLE lease6 DROP FOREIGN KEY fk_lease6_state;
 CREATE INDEX lease6_by_expire_state ON lease6 (expire ASC, state ASC);
 DROP INDEX lease6_by_state_expire ON lease6;
 ALTER TABLE lease6
index 7a484e6d3bdefa793cc57624cba12430df78f8ba..c5f512abb3e6609fc46bbc4322c320d15ebb8b76 100644 (file)
@@ -57,14 +57,14 @@ mysql "$@" <<EOF
 -- Add a constraint that any state value added to the lease4 must
 -- map to a value in the lease_state table.  Note we have to drop
 -- the foreign keys first, then add them back.
-ALTER TABLE lease4 DROP CONSTRAINT fk_lease4_state;
+ALTER TABLE lease4 DROP FOREIGN KEY fk_lease4_state;
 DROP INDEX lease4_by_state_expire ON lease4;
 CREATE INDEX lease4_by_expire_state ON lease4 (expire ASC, state ASC);
 ALTER TABLE lease4
     ADD CONSTRAINT fk_lease4_state FOREIGN KEY (state)
     REFERENCES lease_state (state);
 
-ALTER TABLE lease6 DROP CONSTRAINT fk_lease6_state;
+ALTER TABLE lease6 DROP FOREIGN KEY fk_lease6_state;
 CREATE INDEX lease6_by_expire_state ON lease6 (expire ASC, state ASC);
 DROP INDEX lease6_by_state_expire ON lease6;
 ALTER TABLE lease6