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';
-# 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
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;
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';
#!/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
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
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';
--- 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
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;
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';
#!/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
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