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

[#1405] fix update script

This commit is contained in:
Razvan Becheriu
2020-10-27 21:01:17 +02:00
parent f5651ccefb
commit 248ade8958
2 changed files with 24 additions and 4 deletions

View File

@@ -3036,16 +3036,26 @@ CREATE TABLE reservation_mode_type (
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, 'in-subnet'); # in-subnet
INSERT INTO reservation_mode_type VALUES (3, 'all'); # all (in-subnet + 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;
UPDATE dhcp4_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
# update old all to new value
UPDATE dhcp4_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp4_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# 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;
# update old all to new value
UPDATE dhcp6_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp6_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# Update the schema version number
UPDATE schema_version
SET version = '9', minor = '5';

View File

@@ -27,16 +27,26 @@ CREATE TABLE reservation_mode_type (
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, 'in-subnet'); # in-subnet
INSERT INTO reservation_mode_type VALUES (3, 'all'); # all (in-subnet + 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;
UPDATE dhcp4_shared_network SET reservation_mode = 4 WHERE reservation_mode = 2;
# update old all to new value
UPDATE dhcp4_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp4_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# 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;
# update old all to new value
UPDATE dhcp6_subnet SET reservation_mode = 2 WHERE reservation_mode = 3;
UPDATE dhcp6_shared_network SET reservation_mode = 2 WHERE reservation_mode = 3;
# Update the schema version number
UPDATE schema_version
SET version = '9', minor = '5';