2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#1405] updated schema scripts

This commit is contained in:
Razvan Becheriu
2020-10-28 11:10:17 +02:00
parent 73d56545f9
commit 76b4b058f7
2 changed files with 16 additions and 22 deletions

View File

@@ -3028,17 +3028,6 @@ SET version = '9', minor = '4';
# This line concludes database upgrade to version 9.4.
# Update reservation_mode value after separating flags.
CREATE TABLE reservation_mode_type (
reservation_mode TINYINT PRIMARY KEY NOT NULL, # Reservation mode code.
name VARCHAR(32) # Reservation mode name.
) ENGINE = INNODB;
START TRANSACTION;
INSERT INTO reservation_mode_type VALUES (0, 'disabled'); # disabled
INSERT INTO reservation_mode_type VALUES (1, 'out-of-pool'); # out-of-pool
INSERT INTO reservation_mode_type VALUES (2, 'all'); # in-subnet
INSERT INTO reservation_mode_type VALUES (4, 'global'); # global
COMMIT;
# update old global to new value
UPDATE dhcp4_subnet SET reservation_mode = 4 WHERE reservation_mode = 2;
@@ -3048,6 +3037,10 @@ UPDATE dhcp4_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp4_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp4_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# update out-of-pool all to new value
UPDATE dhcp4_subnet SET reservation_mode = 3 WHERE reservation_mode = 1;
UPDATE dhcp4_shared_network SET reservation_mode = 3 WHERE reservation_mode = 1;
# update old global to new value
UPDATE dhcp6_subnet SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp6_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
@@ -3056,6 +3049,10 @@ UPDATE dhcp6_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp6_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp6_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# update out-of-pool all to new value
UPDATE dhcp6_subnet SET reservation_mode = 3 WHERE reservation_mode = 1;
UPDATE dhcp6_shared_network SET reservation_mode = 3 WHERE reservation_mode = 1;
# Update the schema version number
UPDATE schema_version
SET version = '9', minor = '5';

View File

@@ -19,17 +19,6 @@ fi
mysql "$@" <<EOF
# Update reservation_mode value after separating flags.
CREATE TABLE reservation_mode_type (
reservation_mode TINYINT PRIMARY KEY NOT NULL, # Reservation mode code.
name VARCHAR(32) # Reservation mode name.
) ENGINE = INNODB;
START TRANSACTION;
INSERT INTO reservation_mode_type VALUES (0, 'disabled'); # disabled
INSERT INTO reservation_mode_type VALUES (1, 'out-of-pool'); # out-of-pool
INSERT INTO reservation_mode_type VALUES (2, 'all'); # in-subnet
INSERT INTO reservation_mode_type VALUES (4, 'global'); # global
COMMIT;
# update old global to new value
UPDATE dhcp4_subnet SET reservation_mode = 4 WHERE reservation_mode = 2;
@@ -39,6 +28,10 @@ UPDATE dhcp4_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp4_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp4_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# update out-of-pool all to new value
UPDATE dhcp4_subnet SET reservation_mode = 3 WHERE reservation_mode = 1;
UPDATE dhcp4_shared_network SET reservation_mode = 3 WHERE reservation_mode = 1;
# update old global to new value
UPDATE dhcp6_subnet SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp6_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
@@ -47,6 +40,10 @@ UPDATE dhcp6_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
UPDATE dhcp6_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp6_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# update out-of-pool all to new value
UPDATE dhcp6_subnet SET reservation_mode = 3 WHERE reservation_mode = 1;
UPDATE dhcp6_shared_network SET reservation_mode = 3 WHERE reservation_mode = 1;
# Update the schema version number
UPDATE schema_version
SET version = '9', minor = '5';