Remove spec11 domain foreign key (#757)

We'll want this eventually but until the Domain SQL table is populated,
we can't rely on domains' existence.
This commit is contained in:
gbrodman 2020-08-10 14:55:40 -04:00 committed by GitHub
parent 26dfdd5b71
commit 44d7ad61c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 8 deletions

View file

@ -33,6 +33,7 @@ import google.registry.persistence.VKey;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.joda.time.format.ISODateTimeFormat; import org.joda.time.format.ISODateTimeFormat;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** Unit tests for {@link Spec11ThreatMatch}. */ /** Unit tests for {@link Spec11ThreatMatch}. */
@ -121,6 +122,7 @@ public class Spec11ThreatMatchTest extends EntityTestCase {
} }
@Test @Test
@Disabled("We can't rely on foreign keys until we've migrated to SQL")
void testThreatForeignKeyConstraints() { void testThreatForeignKeyConstraints() {
assertThrowForeignKeyViolation( assertThrowForeignKeyViolation(
() -> { () -> {

View file

@ -0,0 +1,16 @@
-- Copyright 2020 The Nomulus Authors. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- We want this in general, but not until we've migrated
ALTER TABLE IF EXISTS "Spec11ThreatMatch" DROP CONSTRAINT "fk_safebrowsing_threat_domain_repo_id";

View file

@ -1871,14 +1871,6 @@ ALTER TABLE ONLY public."PollMessage"
ADD CONSTRAINT fk_poll_message_transfer_response_losing_registrar_id FOREIGN KEY (transfer_response_losing_registrar_id) REFERENCES public."Registrar"(registrar_id); ADD CONSTRAINT fk_poll_message_transfer_response_losing_registrar_id FOREIGN KEY (transfer_response_losing_registrar_id) REFERENCES public."Registrar"(registrar_id);
--
-- Name: Spec11ThreatMatch fk_safebrowsing_threat_domain_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Spec11ThreatMatch"
ADD CONSTRAINT fk_safebrowsing_threat_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id);
-- --
-- Name: DomainHost fkfmi7bdink53swivs390m2btxg; Type: FK CONSTRAINT; Schema: public; Owner: - -- Name: DomainHost fkfmi7bdink53swivs390m2btxg; Type: FK CONSTRAINT; Schema: public; Owner: -
-- --