2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-07 13:36:21 +00:00

[master] subnet_id column types now consistent in schemas

Merges in branch 'trac5522'
This commit is contained in:
Thomas Markwalder
2018-03-05 15:01:29 -05:00
17 changed files with 236 additions and 25 deletions

View File

@@ -483,6 +483,8 @@ UPDATE schema_version
-- Schema 3.0 specification ends here.
-- Upgrade to schema 3.1 begins here:
-- This is a placeholder for the changes between 3.0 and 3.1. We have added a
-- missing 'client-id' host reservation type entry that had been accidentally
-- omitted when the 2.0 -> 3.0 upgrade script was created.
@@ -493,7 +495,9 @@ INSERT INTO host_identifier_type VALUES (4, 'flex-id');
UPDATE schema_version
SET version = '3', minor = '1';
-- Set 3.2 schema version.
-- Schema 3.1 specification ends here.
-- Upgrade to schema 3.2 begins here:
-- Remove constraints which perform too restrictive checks on the inserted
-- host reservations. We want to be able to insert host reservations which
@@ -528,7 +532,24 @@ CREATE UNIQUE INDEX key_dhcp6_identifier_subnet_id ON hosts
UPDATE schema_version
SET version = '3', minor = '2';
-- Set 4.0 schema version.
-- Schema 3.2 specification ends here.
-- Upgrade to schema 3.3 begins here:
-- Change subnet ID columns type to BIGINT to match lease4/6 tables
ALTER TABLE hosts ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
ALTER TABLE hosts ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
ALTER TABLE dhcp4_options ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
ALTER TABLE dhcp6_options ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
-- Set 3.3 schema version.
UPDATE schema_version
SET version = '3', minor = '3';
-- Schema 3.3 specification ends here.
-- Upgrade to schema 4.0 begins here:
-- Add a column holding hosts for user context.
ALTER TABLE hosts ADD COLUMN user_context TEXT;
@@ -554,6 +575,8 @@ CREATE INDEX lease6_by_duid_iaid_subnet_id ON lease6 (duid, iaid, subnet_id);
UPDATE schema_version
SET version = '4', minor = '0';
-- Schema 4.0 specification ends here.
-- Commit the script transaction.
COMMIT;