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

[#90] add ON DELETE action on dhcp6_subnet_server

This commit is contained in:
Andrei Pavel
2021-06-22 21:56:30 +03:00
committed by Tomek Mrugalski
parent 5281de721a
commit 961707d2c4
3 changed files with 8 additions and 5 deletions

View File

@@ -340,7 +340,7 @@ TEST_F(PgSqlSchemaTest, schemaVersion) {
<< "invalid schema version reported, major expected " << PG_SCHEMA_VERSION_MAJOR
<< ", actual:" << value;
// Get row 0, column 1 (i.e. version field)
// Get row 0, column 1 (i.e. minor field)
ASSERT_FALSE(PgSqlExchange::isColumnNull(*r, 0, 1));
ASSERT_NO_THROW(PgSqlExchange::getColumnValue(*r, 0, 1, value));
EXPECT_EQ(value, PG_SCHEMA_VERSION_MINOR)

View File

@@ -1294,6 +1294,7 @@ CREATE TRIGGER dhcp6_subnet_server_modification_ts_update
FOR EACH ROW EXECUTE PROCEDURE modification_ts_update();
-- Create table for storing global DHCPv6 parameters.
CREATE TABLE dhcp6_global_parameter (
id SERIAL PRIMARY KEY NOT NULL,
@@ -1318,7 +1319,7 @@ CREATE TABLE dhcp6_global_parameter_server (
modification_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (parameter_id, server_id),
CONSTRAINT fk_dhcp6_global_parameter_server_parameter_id FOREIGN KEY (parameter_id)
REFERENCES dhcp6_global_parameter(id) ON DELETE CASCADE ON UPDATE NO ACTION,
REFERENCES dhcp6_global_parameter(id) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT fk_dhcp6_global_parameter_server_server_id FOREIGN KEY (server_id)
REFERENCES dhcp6_server(id) ON DELETE CASCADE ON UPDATE NO ACTION
);
@@ -1466,7 +1467,7 @@ CREATE TABLE dhcp4_global_parameter_server (
CONSTRAINT fk_dhcp4_global_parameter_server_parameter_id FOREIGN KEY (parameter_id)
REFERENCES dhcp4_global_parameter(id) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT fk_dhcp4_global_parameter_server_server_id FOREIGN KEY (server_id)
REFERENCES dhcp4_server(id) ON DELETE CASCADE ON UPDATE NO ACTION
REFERENCES dhcp4_server(id) ON DELETE CASCADE ON UPDATE NO ACTION
);
CREATE INDEX key_dhcp4_global_parameter_idx1 ON dhcp4_global_parameter_server(modification_ts);
CREATE TRIGGER dhcp4_global_parameter_server_modification_ts_update

View File

@@ -274,8 +274,10 @@ CREATE TABLE dhcp6_subnet_server (
server_id BIGINT NOT NULL,
modification_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (subnet_id, server_id),
CONSTRAINT fk_dhcp6_subnet_server_server_id FOREIGN KEY (server_id) REFERENCES dhcp6_server (id),
CONSTRAINT fk_dhcp6_subnet_server_subnet_id FOREIGN KEY (subnet_id) REFERENCES dhcp6_subnet (subnet_id),
CONSTRAINT fk_dhcp6_subnet_server_server_id
FOREIGN KEY (server_id) REFERENCES dhcp6_server (id) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dhcp6_subnet_server_subnet_id
FOREIGN KEY (subnet_id) REFERENCES dhcp6_subnet (subnet_id) ON DELETE CASCADE ON UPDATE NO ACTION,
UNIQUE (subnet_id, server_id)
);
CREATE INDEX dhcp6_subnet_server_idx1 ON dhcp6_subnet_server(server_id);