mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[#2867] Checkpoint: schema updated
This commit is contained in:
@@ -5300,6 +5300,31 @@ BEGIN
|
||||
END $$
|
||||
DELIMITER ;
|
||||
|
||||
-- Add the binary version of the IPv6 address for v6 BLQ prefix filter.
|
||||
ALTER TABLE lease6
|
||||
ADD COLUMN binaddr BINARY(16) DEFAULT NULL;
|
||||
CREATE INDEX lease6_by_binaddr ON lease6 (binaddr);
|
||||
|
||||
-- Create table for v6 BLQ by-relay-id.
|
||||
CREATE TABLE lease6_relay_id (
|
||||
extended_info_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
relay_id VARBINARY(130) NOT NULL,
|
||||
lease_addr BINARY(16) NOT NULL,
|
||||
PRIMARY KEY (extended_info_id),
|
||||
INDEX key_lease6_relay_id_by_id (lease6_relay_id, lease_addr ASC),
|
||||
INDEX key_lease6_relay_id_by_address (lease_addr)
|
||||
) ENGINE = INNODB;
|
||||
|
||||
-- Create table for v6 BLQ by-remote-id.
|
||||
CREATE TABLE lease6_remote_id (
|
||||
extended_info_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
remote_id VARBINARY(255) NOT NULL,
|
||||
lease_addr BINARY(16) NOT NULL,
|
||||
PRIMARY KEY (extended_info_id),
|
||||
INDEX key_lease6_remote_id_by_id (remote_id, lease_addr ASC),
|
||||
INDEX key_lease6_remote_id_by_address (lease_addr)
|
||||
) ENGINE = INNODB;
|
||||
|
||||
-- Update the schema version number.
|
||||
UPDATE schema_version
|
||||
SET version = '18', minor = '0';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2016-2022 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 2016-2023 Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -151,3 +151,5 @@ DROP TRIGGER IF EXISTS lease6_ADEL;
|
||||
DROP FUNCTION IF EXISTS checkLease4Limits;
|
||||
DROP FUNCTION IF EXISTS checkLease6Limits;
|
||||
DROP FUNCTION IF EXISTS isJsonSupported;
|
||||
DROP TABLE IF EXISTS lease6_relay_id;
|
||||
DROP TABLE IF EXISTS lease6_remote_id;
|
||||
|
@@ -188,6 +188,31 @@ BEGIN
|
||||
END $$
|
||||
DELIMITER ;
|
||||
|
||||
-- Add the binary version of the IPv6 address for v6 BLQ prefix filter.
|
||||
ALTER TABLE lease6
|
||||
ADD COLUMN binaddr BINARY(16) DEFAULT NULL;
|
||||
CREATE INDEX lease6_by_binaddr ON lease6 (binaddr);
|
||||
|
||||
-- Create table for v6 BLQ by-relay-id.
|
||||
CREATE TABLE lease6_relay_id (
|
||||
extended_info_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
relay_id VARBINARY(130) NOT NULL,
|
||||
lease_addr BINARY(16) NOT NULL,
|
||||
PRIMARY KEY (extended_info_id),
|
||||
INDEX key_lease6_relay_id_by_id (lease6_relay_id, lease_addr ASC),
|
||||
INDEX key_lease6_relay_id_by_address (lease_addr)
|
||||
) ENGINE = INNODB;
|
||||
|
||||
-- Create table for v6 BLQ by-remote-id.
|
||||
CREATE TABLE lease6_remote_id (
|
||||
extended_info_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
remote_id VARBINARY(255) NOT NULL,
|
||||
lease_addr BINARY(16) NOT NULL,
|
||||
PRIMARY KEY (extended_info_id),
|
||||
INDEX key_lease6_remote_id_by_id (remote_id, lease_addr ASC),
|
||||
INDEX key_lease6_remote_id_by_address (lease_addr)
|
||||
) ENGINE = INNODB;
|
||||
|
||||
-- Update the schema version number.
|
||||
UPDATE schema_version
|
||||
SET version = '18', minor = '0';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2019-2022 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 2019-2023 Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -114,5 +114,7 @@ DELETE FROM lease6_stat;
|
||||
DELETE FROM logs;
|
||||
DELETE FROM lease4_stat_by_client_class;
|
||||
DELETE FROM lease6_stat_by_client_class;
|
||||
DELETE FROM lease6_relay_id;
|
||||
DELETE FROM lease6_remote_id;
|
||||
COMMIT;
|
||||
EOF
|
||||
|
@@ -5637,6 +5637,26 @@ UPDATE schema_version
|
||||
|
||||
UPDATE lease6 SET duid = E'\\x000000' WHERE duid = E'\\x00';
|
||||
|
||||
-- Add the binary version of the IPv6 address for v6 BLQ prefix filter.
|
||||
ALTER TABLE lease6
|
||||
ADD COLUMN binaddr BYTEA DEFAULT NULL;
|
||||
|
||||
-- Create table for v6 BLQ by-relay-id.
|
||||
CREATE TABLE lease6_relay_id (
|
||||
extended_info_id SERIAL PRIMARY KEY NOT NULL,
|
||||
relay_id BYTEA NOT NULL,
|
||||
lease_addr BYTEA NOT NULL);
|
||||
CREATE INDEX lease6_relay_id_by_id ON lease6_relay_id (relay_id, lease_addr ASC);
|
||||
CREATE INDEX lease6_relay_id_by_address ON lease6_relay_id (lease_addr);
|
||||
|
||||
-- Create table for v6 BLQ by-remote-id.
|
||||
CREATE TABLE lease6_remote_id (
|
||||
extended_info_id SERIAL PRIMARY KEY NOT NULL,
|
||||
remote_id BYTEA NOT NULL,
|
||||
lease_addr BYTEA NOT NULL);
|
||||
CREATE INDEX lease6_remote_id_by_id ON lease6_remote_id (remote_id, lease_addr ASC);
|
||||
CREATE INDEX lease6_remote_id_by_address ON lease6_remote_id (lease_addr);
|
||||
|
||||
-- Update the schema version number.
|
||||
UPDATE schema_version
|
||||
SET version = '17', minor = '0';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
-- Copyright (C) 2016-2022 Internet Systems Consortium.
|
||||
-- Copyright (C) 2016-2023 Internet Systems Consortium.
|
||||
|
||||
-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
-- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -226,3 +226,7 @@ DROP FUNCTION IF EXISTS checkLease4Limits(user_context TEXT);
|
||||
DROP FUNCTION IF EXISTS checkLease6Limits(user_context TEXT);
|
||||
DROP FUNCTION IF EXISTS isJsonSupported();
|
||||
DROP FUNCTION IF EXISTS json_cast(json_candidate TEXT);
|
||||
|
||||
-- v6 BLQ cross-tables
|
||||
DROP TABLE IF EXISTS lease6_relay_id;
|
||||
DROP TABLE IF EXISTS lease6_remote_id;
|
||||
|
@@ -40,6 +40,26 @@ START TRANSACTION;
|
||||
|
||||
UPDATE lease6 SET duid = E'\\\\x000000' WHERE duid = E'\\\\x00';
|
||||
|
||||
-- Add the binary version of the IPv6 address for v6 BLQ prefix filter.
|
||||
ALTER TABLE lease6
|
||||
ADD COLUMN binaddr BYTEA DEFAULT NULL;
|
||||
|
||||
-- Create table for v6 BLQ by-relay-id.
|
||||
CREATE TABLE lease6_relay_id (
|
||||
extended_info_id SERIAL PRIMARY KEY NOT NULL,
|
||||
relay_id BYTEA NOT NULL,
|
||||
lease_addr BYTEA NOT NULL);
|
||||
CREATE INDEX lease6_relay_id_by_id ON lease6_relay_id (relay_id, lease_addr ASC);
|
||||
CREATE INDEX lease6_relay_id_by_address ON lease6_relay_id (lease_addr);
|
||||
|
||||
-- Create table for v6 BLQ by-remote-id.
|
||||
CREATE TABLE lease6_remote_id (
|
||||
extended_info_id SERIAL PRIMARY KEY NOT NULL,
|
||||
remote_id BYTEA NOT NULL,
|
||||
lease_addr BYTEA NOT NULL);
|
||||
CREATE INDEX lease6_remote_id_by_id ON lease6_remote_id (remote_id, lease_addr ASC);
|
||||
CREATE INDEX lease6_remote_id_by_address ON lease6_remote_id (lease_addr);
|
||||
|
||||
-- Update the schema version number.
|
||||
UPDATE schema_version
|
||||
SET version = '17', minor = '0';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2019-2022 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 2019-2023 Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -113,5 +113,8 @@ DELETE FROM dhcp6_client_class_server;
|
||||
DELETE FROM dhcp6_client_class;
|
||||
DELETE FROM dhcp6_server WHERE tag != 'all'; -- preserve the special tag
|
||||
|
||||
DELETE FROM lease6_relay_id;
|
||||
DELETE FROM lease6_remote_id;
|
||||
|
||||
COMMIT;
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user