Skip to content

Commit

Permalink
[#89,!22] Removed dhcpX_options constraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
msiodelski committed Sep 18, 2018
1 parent 03b007f commit fd59729
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
24 changes: 0 additions & 24 deletions src/share/database/scripts/mysql/dhcpdb_create.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -1004,17 +1004,6 @@ ALTER TABLE dhcp4_options
ADD COLUMN dhcp4_pool_id BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN modification_ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;

# Add configuration backend specific constraints.
ALTER TABLE dhcp4_options
ADD CONSTRAINT fk_dhcp4_option_pool_id FOREIGN KEY (dhcp4_pool_id)
REFERENCES dhcp4_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp4_option_shared_network_name FOREIGN KEY (dhcp4_shared_network_name)
REFERENCES dhcp4_shared_network (name)
ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp4_option_subnet_id FOREIGN KEY (dhcp4_subnet_id)
REFERENCES dhcp4_subnet (subnet_id)
ON DELETE CASCADE ON UPDATE CASCADE;

-- -----------------------------------------------------
-- Table `dhcp4_options_server`
-- -----------------------------------------------------
Expand Down Expand Up @@ -1263,19 +1252,6 @@ ALTER TABLE dhcp6_options
ADD COLUMN dhcp6_pd_pool_id BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN modification_ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;

# Add configuration backend specific constraints.
ALTER TABLE dhcp6_options
ADD CONSTRAINT fk_dhcp6_option_pd_pool_id FOREIGN KEY (dhcp6_pd_pool_id)
REFERENCES dhcp6_pd_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_pool_id FOREIGN KEY (dhcp6_pool_id)
REFERENCES dhcp6_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_shared_network_name FOREIGN KEY (dhcp6_shared_network_name)
REFERENCES dhcp6_shared_network (name)
ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_subnet_id FOREIGN KEY (dhcp6_subnet_id)
REFERENCES dhcp6_subnet (subnet_id)
ON DELETE CASCADE ON UPDATE CASCADE;

-- -----------------------------------------------------
-- Table `dhcp6_options_server`
-- -----------------------------------------------------
Expand Down
24 changes: 0 additions & 24 deletions src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,6 @@ ALTER TABLE dhcp4_options
ADD COLUMN dhcp4_pool_id BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN modification_ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
# Add configuration backend specific constraints.
ALTER TABLE dhcp4_options
ADD CONSTRAINT fk_dhcp4_option_pool_id FOREIGN KEY (dhcp4_pool_id)
REFERENCES dhcp4_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp4_option_shared_network_name FOREIGN KEY (dhcp4_shared_network_name)
REFERENCES dhcp4_shared_network (name)
ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp4_option_subnet_id FOREIGN KEY (dhcp4_subnet_id)
REFERENCES dhcp4_subnet (subnet_id)
ON DELETE CASCADE ON UPDATE CASCADE;
# Create table dhcp4_options_server
CREATE TABLE IF NOT EXISTS dhcp4_options_server (
option_id BIGINT(20) UNSIGNED NOT NULL,
Expand Down Expand Up @@ -557,19 +546,6 @@ ALTER TABLE dhcp6_options
ADD COLUMN dhcp6_pd_pool_id BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN modification_ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
# Add configuration backend specific constraints.
ALTER TABLE dhcp6_options
ADD CONSTRAINT fk_dhcp6_option_pd_pool_id FOREIGN KEY (dhcp6_pd_pool_id)
REFERENCES dhcp6_pd_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_pool_id FOREIGN KEY (dhcp6_pool_id)
REFERENCES dhcp6_pool (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_shared_network_name FOREIGN KEY (dhcp6_shared_network_name)
REFERENCES dhcp6_shared_network (name)
ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT fk_dhcp6_option_subnet_id FOREIGN KEY (dhcp6_subnet_id)
REFERENCES dhcp6_subnet (subnet_id)
ON DELETE CASCADE ON UPDATE CASCADE;
# Create table dhcp6_options_server
CREATE TABLE IF NOT EXISTS dhcp6_options_server (
option_id BIGINT(20) UNSIGNED NOT NULL,
Expand Down

0 comments on commit fd59729

Please sign in to comment.