Commit a1697ce6 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[5468] Added lease indexing by subnet identifiers and lease type.

parent 27322572
# Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2012-2018 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
......@@ -510,6 +510,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
# Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
# Create for searching leases by subnet identifier and lease type.
CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
# Update the schema version number
UPDATE schema_version
SET version = '6', minor = '0';
......
......@@ -24,6 +24,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
# Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
# Create for searching leases by subnet identifier and lease type.
CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
# Update the schema version number
UPDATE schema_version
SET version = '6', minor = '0';
......
-- Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
-- Copyright (C) 2012-2018 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
......@@ -537,6 +537,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT;
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT;
-- Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
-- Create for searching leases by subnet identifier and lease type.
CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
-- Set 4.0 schema version.
UPDATE schema_version
SET version = '4', minor = '0';
......
......@@ -26,6 +26,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT;
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT;
-- Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
-- Create for searching leases by subnet identifier and lease type.
CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
-- Set 4.0 schema version.
UPDATE schema_version
SET version = '4', minor = '0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment