diff --git a/core/src/main/java/google/registry/beam/initsql/InitSqlPipeline.java b/core/src/main/java/google/registry/beam/initsql/InitSqlPipeline.java index 546103cf9..1d2593d93 100644 --- a/core/src/main/java/google/registry/beam/initsql/InitSqlPipeline.java +++ b/core/src/main/java/google/registry/beam/initsql/InitSqlPipeline.java @@ -92,9 +92,8 @@ public class InitSqlPipeline implements Serializable { * Datastore kinds to be written to the SQL database before the cleansed version of {@link * DomainBase}. */ - // TODO(weiminyu): include Registry.class when it is modeled in JPA. private static final ImmutableList> PHASE_ONE_ORDERED = - ImmutableList.of(Registrar.class, ContactResource.class); + ImmutableList.of(Registry.class, Registrar.class, ContactResource.class); /** * Datastore kinds to be written to the SQL database after the cleansed version of {@link diff --git a/core/src/main/java/google/registry/model/billing/BillingEvent.java b/core/src/main/java/google/registry/model/billing/BillingEvent.java index 7263f526c..c873beed4 100644 --- a/core/src/main/java/google/registry/model/billing/BillingEvent.java +++ b/core/src/main/java/google/registry/model/billing/BillingEvent.java @@ -121,13 +121,11 @@ public abstract class BillingEvent extends ImmutableObject String clientId; /** Revision id of the entry in DomainHistory table that ths bill belongs to. */ - // TODO(shicong): Add foreign key constraint when DomainHistory table is generated @Ignore @Column(nullable = false) Long domainHistoryRevisionId; /** ID of the EPP resource that the bill is for. */ - // TODO(shicong): Add foreign key constraint when we expand DatastoreHelp for Postgresql @Ignore @Column(nullable = false) String domainRepoId; @@ -291,7 +289,7 @@ public abstract class BillingEvent extends ImmutableObject @javax.persistence.Index(columnList = "eventTime"), @javax.persistence.Index(columnList = "billingTime"), @javax.persistence.Index(columnList = "syntheticCreationTime"), - @javax.persistence.Index(columnList = "allocation_token_id") + @javax.persistence.Index(columnList = "allocationToken") }) @AttributeOverride(name = "id", column = @Column(name = "billing_event_id")) @WithLongVKey @@ -334,10 +332,7 @@ public abstract class BillingEvent extends ImmutableObject /** * The {@link AllocationToken} used in the creation of this event, or null if one was not used. - * - *

TODO(shicong): Add foreign key constraint when AllocationToken schema is generated */ - @Column(name = "allocation_token_id") @Index @Nullable VKey allocationToken; diff --git a/core/src/test/java/google/registry/beam/initsql/InitSqlPipelineTest.java b/core/src/test/java/google/registry/beam/initsql/InitSqlPipelineTest.java index 0c8c4ae43..104aed33f 100644 --- a/core/src/test/java/google/registry/beam/initsql/InitSqlPipelineTest.java +++ b/core/src/test/java/google/registry/beam/initsql/InitSqlPipelineTest.java @@ -217,7 +217,7 @@ class InitSqlPipelineTest { GracePeriodStatus.ADD, "4-COM", fakeClock.nowUtc().plusDays(1), - "registrar", + "TheRegistrar", null)) .build()); exportDir = store.export(exportRootDir.getAbsolutePath(), ALL_KINDS, ImmutableSet.of()); diff --git a/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java b/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java index 0ed048390..aed19355b 100644 --- a/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java +++ b/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java @@ -17,6 +17,7 @@ package google.registry.model.domain; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableObjects; import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm; +import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.SqlHelper.assertThrowForeignKeyViolation; import static google.registry.testing.SqlHelper.saveRegistrar; import static google.registry.util.DateTimeUtils.END_OF_TIME; @@ -45,30 +46,29 @@ import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.ContactTransferData; import google.registry.model.transfer.DomainTransferData; import google.registry.persistence.VKey; -import google.registry.persistence.transaction.JpaTestRules; -import google.registry.persistence.transaction.JpaTestRules.JpaIntegrationWithCoverageExtension; -import google.registry.testing.DatastoreEntityExtension; +import google.registry.testing.AppEngineExtension; +import google.registry.testing.DualDatabaseTest; import google.registry.testing.FakeClock; +import google.registry.testing.TestSqlOnly; import java.util.Arrays; import org.joda.money.Money; import org.joda.time.DateTime; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; /** Verify that we can store/retrieve DomainBase objects from a SQL database. */ +@DualDatabaseTest public class DomainBaseSqlTest { protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC)); @RegisterExtension - @Order(value = 1) - DatastoreEntityExtension datastoreEntityExtension = new DatastoreEntityExtension(); - - @RegisterExtension - JpaIntegrationWithCoverageExtension jpa = - new JpaTestRules.Builder().withClock(fakeClock).buildIntegrationWithCoverageExtension(); + public final AppEngineExtension appEngine = + AppEngineExtension.builder() + .withDatastoreAndCloudSql() + .enableJpaEntityCoverageCheck(true) + .withClock(fakeClock) + .build(); private DomainBase domain; private DomainHistory historyEntry; @@ -132,7 +132,7 @@ public class DomainBaseSqlTest { contact2 = makeContact("contact_id2"); } - @Test + @TestSqlOnly void testDomainBasePersistence() { persistDomain(); @@ -144,7 +144,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testHostForeignKeyConstraints() { assertThrowForeignKeyViolation( () -> @@ -158,7 +158,7 @@ public class DomainBaseSqlTest { })); } - @Test + @TestSqlOnly void testContactForeignKeyConstraints() { assertThrowForeignKeyViolation( () -> @@ -171,7 +171,7 @@ public class DomainBaseSqlTest { })); } - @Test + @TestSqlOnly void testResaveDomain_succeeds() { persistDomain(); jpaTm() @@ -189,7 +189,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testModifyGracePeriod_setEmptyCollectionSuccessfully() { persistDomain(); jpaTm() @@ -209,7 +209,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testModifyGracePeriod_setNullCollectionSuccessfully() { persistDomain(); jpaTm() @@ -228,7 +228,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testModifyGracePeriod_addThenRemoveSuccessfully() { persistDomain(); jpaTm() @@ -305,7 +305,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testModifyGracePeriod_removeThenAddSuccessfully() { persistDomain(); jpaTm() @@ -347,7 +347,7 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testModifyDsData_addThenRemoveSuccessfully() { persistDomain(); DelegationSignerData extraDsData = @@ -391,8 +391,9 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void testUpdates() { + createTld("com"); jpaTm() .transact( () -> { @@ -423,6 +424,7 @@ public class DomainBaseSqlTest { } private void persistDomain() { + createTld("com"); jpaTm() .transact( () -> { @@ -442,8 +444,9 @@ public class DomainBaseSqlTest { }); } - @Test + @TestSqlOnly void persistDomainWithCompositeVKeys() { + createTld("com"); jpaTm() .transact( () -> { @@ -572,8 +575,9 @@ public class DomainBaseSqlTest { assertThat(persisted.getGracePeriods()).isEqualTo(gracePeriods); } - @Test + @TestSqlOnly void persistDomainWithLegacyVKeys() { + createTld("com"); jpaTm() .transact( () -> { diff --git a/core/src/test/java/google/registry/model/history/DomainHistoryTest.java b/core/src/test/java/google/registry/model/history/DomainHistoryTest.java index 54227c966..fb554e81e 100644 --- a/core/src/test/java/google/registry/model/history/DomainHistoryTest.java +++ b/core/src/test/java/google/registry/model/history/DomainHistoryTest.java @@ -20,10 +20,10 @@ import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableO import static google.registry.model.ImmutableObjectSubject.immutableObjectCorrespondence; import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.newContactResourceWithRoid; import static google.registry.testing.DatastoreHelper.newDomainBase; import static google.registry.testing.DatastoreHelper.newHostResourceWithRoid; -import static google.registry.testing.SqlHelper.saveRegistrar; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableSet; @@ -41,22 +41,19 @@ import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField; import google.registry.model.reporting.HistoryEntry; import google.registry.persistence.VKey; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyOnly; +import google.registry.testing.TestSqlOnly; /** Tests for {@link DomainHistory}. */ +@DualDatabaseTest public class DomainHistoryTest extends EntityTestCase { DomainHistoryTest() { super(JpaEntityCoverageCheck.ENABLED); } - @BeforeEach - void beforeEach() { - saveRegistrar("TheRegistrar"); - } - - @Test + @TestSqlOnly void testPersistence() { DomainBase domain = createDomainWithContactsAndHosts(); DomainHistory domainHistory = createDomainHistory(domain); @@ -71,7 +68,7 @@ public class DomainHistoryTest extends EntityTestCase { }); } - @Test + @TestSqlOnly void testLegacyPersistence_nullResource() { DomainBase domain = createDomainWithContactsAndHosts(); DomainHistory domainHistory = @@ -92,7 +89,7 @@ public class DomainHistoryTest extends EntityTestCase { }); } - @Test + @TestOfyOnly void testOfyPersistence() { HostResource host = newHostResourceWithRoid("ns1.example.com", "host1"); ContactResource contact = newContactResourceWithRoid("contactId", "contact1"); @@ -128,6 +125,7 @@ public class DomainHistoryTest extends EntityTestCase { } static DomainBase createDomainWithContactsAndHosts() { + createTld("tld"); HostResource host = newHostResourceWithRoid("ns1.example.com", "host1"); ContactResource contact = newContactResourceWithRoid("contactId", "contact1"); diff --git a/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java b/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java index 595443c74..f57e63627 100644 --- a/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java +++ b/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java @@ -17,10 +17,10 @@ package google.registry.model.history; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableObjects; import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm; -import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import static google.registry.persistence.transaction.TransactionManagerFactory.ofyTm; +import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.newContactResourceWithRoid; import static google.registry.testing.DatastoreHelper.newHostResourceWithRoid; -import static google.registry.testing.SqlHelper.saveRegistrar; import static google.registry.util.CollectionUtils.nullToEmpty; import static java.nio.charset.StandardCharsets.UTF_8; @@ -40,34 +40,32 @@ import google.registry.model.reporting.DomainTransactionRecord; import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField; import google.registry.model.reporting.HistoryEntry; import google.registry.persistence.VKey; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestSqlOnly; /** Tests to check {@link HistoryEntry} + its subclasses' transitions to/from Datastore/SQL. */ +@DualDatabaseTest public class LegacyHistoryObjectTest extends EntityTestCase { public LegacyHistoryObjectTest() { super(JpaEntityCoverageCheck.ENABLED); } - @BeforeEach - void beforeEach() { - saveRegistrar("TheRegistrar"); - } - - @Test + @TestSqlOnly void testFullConversion_contact() { // Create+save an old contact HistoryEntry, reload it, and verify it's a proper ContactHistory ContactResource contact = newContactResourceWithRoid("contactId", "contact1"); HistoryEntry legacyHistoryEntry = historyEntryBuilderFor(contact).build(); - tm().transact(() -> tm().insert(legacyHistoryEntry)); + ofyTm().transact(() -> ofyTm().insert(legacyHistoryEntry)); // In Datastore, we will save it as HistoryEntry but retrieve it as ContactHistory long historyEntryId = legacyHistoryEntry.getId(); HistoryEntry fromObjectify = - tm().transact( + ofyTm() + .transact( () -> - tm().load( + ofyTm() + .load( VKey.create( HistoryEntry.class, historyEntryId, @@ -96,19 +94,22 @@ public class LegacyHistoryObjectTest extends EntityTestCase { .isEqualTo(legacyHistoryFromSql.getParentVKey().getSqlKey()); } - @Test + @TestSqlOnly void testFullConversion_domain() { + createTld("foobar"); // Create+save an old domain HistoryEntry, reload it, and verify it's a proper DomainHistory DomainBase domain = DomainHistoryTest.createDomainWithContactsAndHosts(); HistoryEntry legacyHistoryEntry = historyEntryForDomain(domain); - tm().transact(() -> tm().insert(legacyHistoryEntry)); + ofyTm().transact(() -> ofyTm().insert(legacyHistoryEntry)); // In Datastore, we will save it as HistoryEntry but retrieve it as DomainHistory long historyEntryId = legacyHistoryEntry.getId(); HistoryEntry fromObjectify = - tm().transact( + ofyTm() + .transact( () -> - tm().load( + ofyTm() + .load( VKey.create( HistoryEntry.class, historyEntryId, @@ -140,19 +141,21 @@ public class LegacyHistoryObjectTest extends EntityTestCase { .isEqualTo(nullToEmpty(legacyHistoryFromSql.getNsHosts())); } - @Test + @TestSqlOnly void testFullConversion_host() { // Create+save an old host HistoryEntry, reload it, and verify it's a proper HostHistory HostResource host = newHostResourceWithRoid("hs1.example.com", "host1"); HistoryEntry legacyHistoryEntry = historyEntryBuilderFor(host).build(); - tm().transact(() -> tm().insert(legacyHistoryEntry)); + ofyTm().transact(() -> ofyTm().insert(legacyHistoryEntry)); // In Datastore, we will save it as HistoryEntry but retrieve it as HostHistory long historyEntryId = legacyHistoryEntry.getId(); HistoryEntry fromObjectify = - tm().transact( + ofyTm() + .transact( () -> - tm().load( + ofyTm() + .load( VKey.create( HistoryEntry.class, historyEntryId, diff --git a/core/src/test/java/google/registry/model/poll/PollMessageTest.java b/core/src/test/java/google/registry/model/poll/PollMessageTest.java index 6c8ca679b..34da94085 100644 --- a/core/src/test/java/google/registry/model/poll/PollMessageTest.java +++ b/core/src/test/java/google/registry/model/poll/PollMessageTest.java @@ -15,13 +15,12 @@ package google.registry.model.poll; import static com.google.common.truth.Truth.assertThat; -import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm; +import static google.registry.persistence.transaction.TransactionManagerFactory.tm; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.newDomainBase; import static google.registry.testing.DatastoreHelper.persistActiveContact; import static google.registry.testing.DatastoreHelper.persistResource; -import static google.registry.testing.SqlHelper.saveRegistrar; import static java.nio.charset.StandardCharsets.UTF_8; import google.registry.model.EntityTestCase; @@ -31,10 +30,14 @@ import google.registry.model.domain.Period; import google.registry.model.eppcommon.Trid; import google.registry.model.reporting.HistoryEntry; import google.registry.persistence.VKey; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; +import google.registry.testing.TestOfyOnly; +import google.registry.testing.TestSqlOnly; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link PollMessage}. */ +@DualDatabaseTest public class PollMessageTest extends EntityTestCase { private DomainBase domain; @@ -64,7 +67,8 @@ public class PollMessageTest extends EntityTestCase { .setBySuperuser(false) .setReason("reason") .setRequestedByRegistrar(false) - .build()); + .build() + .toChildHistoryEntity()); oneTime = new PollMessage.OneTime.Builder() .setId(100L) @@ -83,35 +87,9 @@ public class PollMessageTest extends EntityTestCase { .setAutorenewEndTime(fakeClock.nowUtc().plusDays(365)) .setTargetId("foobar.foo") .build(); - jpaTm() - .transact( - () -> { - saveRegistrar("TheRegistrar"); - jpaTm().insert(contact); - jpaTm().insert(domain); - jpaTm().insert(historyEntry.toChildHistoryEntity()); - }); } - @Test - void testCloudSqlPersistenceOneTime() { - jpaTm().transact(() -> jpaTm().insert(oneTime)); - PollMessage.OneTime persisted = - jpaTm().transact(() -> jpaTm().load(VKey.createSql(PollMessage.OneTime.class, oneTime.id))); - assertThat(persisted).isEqualTo(oneTime); - } - - @Test - void testCloudSqlPersistenceAutorenew() { - jpaTm().transact(() -> jpaTm().insert(autoRenew)); - PollMessage.Autorenew persisted = - jpaTm() - .transact( - () -> jpaTm().load(VKey.createSql(PollMessage.Autorenew.class, autoRenew.id))); - assertThat(persisted).isEqualTo(autoRenew); - } - - @Test + @TestSqlOnly void testCloudSqlSupportForPolymorphicVKey() { jpaTm().transact(() -> jpaTm().insert(oneTime)); PollMessage persistedOneTime = @@ -126,7 +104,7 @@ public class PollMessageTest extends EntityTestCase { assertThat(persistedAutoRenew).isEqualTo(autoRenew); } - @Test + @TestOfyAndSql void testPersistenceOneTime() { PollMessage.OneTime pollMessage = persistResource( @@ -136,10 +114,10 @@ public class PollMessageTest extends EntityTestCase { .setMsg("Test poll message") .setParent(historyEntry) .build()); - assertThat(ofy().load().entity(pollMessage).now()).isEqualTo(pollMessage); + assertThat(tm().transact(() -> tm().load(pollMessage))).isEqualTo(pollMessage); } - @Test + @TestOfyAndSql void testPersistenceAutorenew() { PollMessage.Autorenew pollMessage = persistResource( @@ -151,10 +129,10 @@ public class PollMessageTest extends EntityTestCase { .setAutorenewEndTime(fakeClock.nowUtc().plusDays(365)) .setTargetId("foobar.foo") .build()); - assertThat(ofy().load().entity(pollMessage).now()).isEqualTo(pollMessage); + assertThat(tm().transact(() -> tm().load(pollMessage))).isEqualTo(pollMessage); } - @Test + @TestOfyOnly void testIndexingAutorenew() throws Exception { PollMessage.Autorenew pollMessage = persistResource( diff --git a/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchDaoTest.java b/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchDaoTest.java index 57710a1bc..898c95e72 100644 --- a/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchDaoTest.java +++ b/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchDaoTest.java @@ -17,23 +17,42 @@ package google.registry.model.reporting; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ImmutableObjectSubject.immutableObjectCorrespondence; import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm; +import static google.registry.testing.DatastoreHelper.createTlds; +import static google.registry.testing.DatastoreHelper.newDomainBase; +import static google.registry.testing.DatastoreHelper.persistActiveContact; +import static google.registry.testing.DatastoreHelper.persistResource; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import google.registry.model.EntityTestCase; +import google.registry.model.contact.ContactResource; +import google.registry.model.domain.DomainBase; import google.registry.model.reporting.Spec11ThreatMatch.ThreatType; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestSqlOnly; import org.joda.time.LocalDate; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link Spec11ThreatMatchDao}. */ +@DualDatabaseTest public class Spec11ThreatMatchDaoTest extends EntityTestCase { private static final LocalDate TODAY = new LocalDate(2020, 8, 4); private static final LocalDate YESTERDAY = new LocalDate(2020, 8, 3); + private DomainBase todayComDomain; + private DomainBase todayOrgDomain; + private DomainBase yesterdayComDomain; + private DomainBase yesterdayOrgDomain; + @BeforeEach void setUp() { + createTlds("com", "org"); + ContactResource contact = persistActiveContact("jd1234"); + todayComDomain = persistResource(newDomainBase("today.com", contact)); + todayOrgDomain = persistResource(newDomainBase("today.org", contact)); + yesterdayComDomain = persistResource(newDomainBase("yesterday.com", contact)); + yesterdayOrgDomain = persistResource(newDomainBase("yesterday.org", contact)); jpaTm() .transact( () -> { @@ -42,7 +61,7 @@ public class Spec11ThreatMatchDaoTest extends EntityTestCase { }); } - @Test + @TestSqlOnly void testDeleteEntriesByDate() { // Verify that all entries with the date TODAY were removed jpaTm() @@ -66,7 +85,7 @@ public class Spec11ThreatMatchDaoTest extends EntityTestCase { }); } - @Test + @TestSqlOnly void testLoadEntriesByDate() { jpaTm() .transact( @@ -82,23 +101,25 @@ public class Spec11ThreatMatchDaoTest extends EntityTestCase { private ImmutableList getThreatMatchesYesterday() { return ImmutableList.of( - createThreatMatch("yesterday.com", YESTERDAY), - createThreatMatch("yesterday.org", YESTERDAY)); + createThreatMatch("yesterday.com", yesterdayComDomain.getRepoId(), YESTERDAY), + createThreatMatch("yesterday.org", yesterdayOrgDomain.getRepoId(), YESTERDAY)); } private ImmutableList getThreatMatchesToday() { return ImmutableList.of( - createThreatMatch("today.com", TODAY), createThreatMatch("today.org", TODAY)); + createThreatMatch("today.com", todayComDomain.getRepoId(), TODAY), + createThreatMatch("today.org", todayOrgDomain.getRepoId(), TODAY)); } - private Spec11ThreatMatch createThreatMatch(String domainName, LocalDate date) { + private Spec11ThreatMatch createThreatMatch( + String domainName, String domainRepoId, LocalDate date) { return new Spec11ThreatMatch() .asBuilder() .setThreatTypes(ImmutableSet.of(ThreatType.MALWARE)) .setCheckDate(date) .setDomainName(domainName) - .setRegistrarId("Example Registrar") - .setDomainRepoId("1-COM") + .setRegistrarId("TheRegistrar") + .setDomainRepoId(domainRepoId) .build(); } } diff --git a/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchTest.java b/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchTest.java index e4ee76a54..17fa111cd 100644 --- a/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchTest.java +++ b/core/src/test/java/google/registry/model/reporting/Spec11ThreatMatchTest.java @@ -30,13 +30,16 @@ import google.registry.model.domain.DomainBase; import google.registry.model.host.HostResource; import google.registry.model.transfer.ContactTransferData; import google.registry.persistence.VKey; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; +import google.registry.testing.TestSqlOnly; import org.joda.time.LocalDate; import org.joda.time.format.ISODateTimeFormat; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; /** Unit tests for {@link Spec11ThreatMatch}. */ +@DualDatabaseTest public class Spec11ThreatMatchTest extends EntityTestCase { private static final String REGISTRAR_ID = "registrar"; @@ -100,8 +103,9 @@ public class Spec11ThreatMatchTest extends EntityTestCase { .build(); } - @Test + @TestSqlOnly void testPersistence() { + createTld("tld"); saveRegistrar(REGISTRAR_ID); jpaTm() @@ -121,7 +125,7 @@ public class Spec11ThreatMatchTest extends EntityTestCase { assertThat(threat).isEqualTo(persistedThreat); } - @Test + @TestSqlOnly @Disabled("We can't rely on foreign keys until we've migrated to SQL") void testThreatForeignKeyConstraints() { assertThrowForeignKeyViolation( @@ -152,7 +156,7 @@ public class Spec11ThreatMatchTest extends EntityTestCase { }); } - @Test + @TestOfyAndSql void testFailure_threatsWithInvalidFields() { assertThrows( IllegalArgumentException.class, () -> threat.asBuilder().setRegistrarId(null).build()); diff --git a/core/src/test/resources/google/registry/beam/initsql/pipeline_golden.dot b/core/src/test/resources/google/registry/beam/initsql/pipeline_golden.dot index af3fce7b4..cbe670ae6 100644 --- a/core/src/test/resources/google/registry/beam/initsql/pipeline_golden.dot +++ b/core/src/test/resources/google/registry/beam/initsql/pipeline_golden.dot @@ -210,77 +210,77 @@ digraph { 78 -> 79 [style=solid label=""] } subgraph cluster_80 { - label = "Write to sql: Transforms:Registrar" + label = "Write to sql: Transforms:Registry" subgraph cluster_81 { - label = "Write to sql: Transforms:Registrar/Shard data for Transforms:Registrar" + label = "Write to sql: Transforms:Registry/Shard data for Transforms:Registry" subgraph cluster_82 { - label = "Write to sql: Transforms:Registrar/Shard data for Transforms:Registrar/Map" + label = "Write to sql: Transforms:Registry/Shard data for Transforms:Registry/Map" 83 [label="ParMultiDo(Anonymous)"] 79 -> 83 [style=solid label=""] } } subgraph cluster_84 { - label = "Write to sql: Transforms:Registrar/Batch output by shard Transforms:Registrar" + label = "Write to sql: Transforms:Registry/Batch output by shard Transforms:Registry" subgraph cluster_85 { - label = "Write to sql: Transforms:Registrar/Batch output by shard Transforms:Registrar/ParDo(GroupIntoBatches)" + label = "Write to sql: Transforms:Registry/Batch output by shard Transforms:Registry/ParDo(GroupIntoBatches)" 86 [label="ParMultiDo(GroupIntoBatches)"] 83 -> 86 [style=solid label=""] } } subgraph cluster_87 { - label = "Write to sql: Transforms:Registrar/Write in batch for Transforms:Registrar" + label = "Write to sql: Transforms:Registry/Write in batch for Transforms:Registry" 88 [label="ParMultiDo(SqlBatchWriter)"] 86 -> 88 [style=solid label=""] } } subgraph cluster_89 { - label = "Wait on Transforms:Registrar" + label = "Wait on Transforms:Registry" subgraph cluster_90 { - label = "Wait on Transforms:Registrar/To wait view 0" + label = "Wait on Transforms:Registry/To wait view 0" subgraph cluster_91 { - label = "Wait on Transforms:Registrar/To wait view 0/Window.Into()" + label = "Wait on Transforms:Registry/To wait view 0/Window.Into()" 92 [label="Flatten.PCollections"] 88 -> 92 [style=solid label=""] } subgraph cluster_93 { - label = "Wait on Transforms:Registrar/To wait view 0/ParDo(CollectWindows)" + label = "Wait on Transforms:Registry/To wait view 0/ParDo(CollectWindows)" 94 [label="ParMultiDo(CollectWindows)"] 92 -> 94 [style=solid label=""] } subgraph cluster_95 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any" subgraph cluster_96 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)" subgraph cluster_97 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" subgraph cluster_98 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" subgraph cluster_99 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" 100 [label="ParMultiDo(Anonymous)"] 94 -> 100 [style=solid label=""] } } } subgraph cluster_101 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" 102 [label="GroupByKey"] 100 -> 102 [style=solid label=""] subgraph cluster_103 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" subgraph cluster_104 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" 105 [label="ParMultiDo(Anonymous)"] 102 -> 105 [style=solid label=""] } } } subgraph cluster_106 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" subgraph cluster_107 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" subgraph cluster_108 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" 109 [label="ParMultiDo(Anonymous)"] 105 -> 109 [style=solid label=""] } @@ -288,11 +288,11 @@ digraph { } } subgraph cluster_110 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Flatten.Iterables" subgraph cluster_111 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" subgraph cluster_112 { - label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" + label = "Wait on Transforms:Registry/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" 113 [label="ParMultiDo(Anonymous)"] 109 -> 113 [style=solid label=""] } @@ -300,11 +300,11 @@ digraph { } } subgraph cluster_114 { - label = "Wait on Transforms:Registrar/To wait view 0/View.AsList" + label = "Wait on Transforms:Registry/To wait view 0/View.AsList" subgraph cluster_115 { - label = "Wait on Transforms:Registrar/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" + label = "Wait on Transforms:Registry/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" subgraph cluster_116 { - label = "Wait on Transforms:Registrar/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" + label = "Wait on Transforms:Registry/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" 117 [label="ParMultiDo(VoidKeyToMultimapMaterialization)"] 113 -> 117 [style=solid label=""] } @@ -314,9 +314,9 @@ digraph { } } subgraph cluster_119 { - label = "Wait on Transforms:Registrar/Wait" + label = "Wait on Transforms:Registry/Wait" subgraph cluster_120 { - label = "Wait on Transforms:Registrar/Wait/Map" + label = "Wait on Transforms:Registry/Wait/Map" 121 [label="ParMultiDo(Anonymous)"] 79 -> 121 [style=solid label=""] 117 -> 121 [style=dashed label=""] @@ -324,196 +324,196 @@ digraph { } } subgraph cluster_122 { - label = "Write to sql: Transforms:ContactResource" + label = "Write to sql: Transforms:Registrar" subgraph cluster_123 { - label = "Write to sql: Transforms:ContactResource/Shard data for Transforms:ContactResource" + label = "Write to sql: Transforms:Registrar/Shard data for Transforms:Registrar" subgraph cluster_124 { - label = "Write to sql: Transforms:ContactResource/Shard data for Transforms:ContactResource/Map" + label = "Write to sql: Transforms:Registrar/Shard data for Transforms:Registrar/Map" 125 [label="ParMultiDo(Anonymous)"] 121 -> 125 [style=solid label=""] } } subgraph cluster_126 { - label = "Write to sql: Transforms:ContactResource/Batch output by shard Transforms:ContactResource" + label = "Write to sql: Transforms:Registrar/Batch output by shard Transforms:Registrar" subgraph cluster_127 { - label = "Write to sql: Transforms:ContactResource/Batch output by shard Transforms:ContactResource/ParDo(GroupIntoBatches)" + label = "Write to sql: Transforms:Registrar/Batch output by shard Transforms:Registrar/ParDo(GroupIntoBatches)" 128 [label="ParMultiDo(GroupIntoBatches)"] 125 -> 128 [style=solid label=""] } } subgraph cluster_129 { - label = "Write to sql: Transforms:ContactResource/Write in batch for Transforms:ContactResource" + label = "Write to sql: Transforms:Registrar/Write in batch for Transforms:Registrar" 130 [label="ParMultiDo(SqlBatchWriter)"] 128 -> 130 [style=solid label=""] } } subgraph cluster_131 { - label = "Remove circular foreign keys from DomainBase" - 132 [label="ParMultiDo(RemoveDomainBaseForeignKeys)"] - 79 -> 132 [style=solid label=""] - } - subgraph cluster_133 { - label = "Wait on phase one" - subgraph cluster_134 { - label = "Wait on phase one/To wait view 0" + label = "Wait on Transforms:Registrar" + subgraph cluster_132 { + label = "Wait on Transforms:Registrar/To wait view 0" + subgraph cluster_133 { + label = "Wait on Transforms:Registrar/To wait view 0/Window.Into()" + 134 [label="Flatten.PCollections"] + 130 -> 134 [style=solid label=""] + } subgraph cluster_135 { - label = "Wait on phase one/To wait view 0/Window.Into()" - 136 [label="Flatten.PCollections"] - 130 -> 136 [style=solid label=""] + label = "Wait on Transforms:Registrar/To wait view 0/ParDo(CollectWindows)" + 136 [label="ParMultiDo(CollectWindows)"] + 134 -> 136 [style=solid label=""] } subgraph cluster_137 { - label = "Wait on phase one/To wait view 0/ParDo(CollectWindows)" - 138 [label="ParMultiDo(CollectWindows)"] - 136 -> 138 [style=solid label=""] - } - subgraph cluster_139 { - label = "Wait on phase one/To wait view 0/Sample.Any" - subgraph cluster_140 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)" - subgraph cluster_141 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" - subgraph cluster_142 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" - subgraph cluster_143 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" - 144 [label="ParMultiDo(Anonymous)"] - 138 -> 144 [style=solid label=""] + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any" + subgraph cluster_138 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)" + subgraph cluster_139 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" + subgraph cluster_140 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" + subgraph cluster_141 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" + 142 [label="ParMultiDo(Anonymous)"] + 136 -> 142 [style=solid label=""] } } } - subgraph cluster_145 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" - 146 [label="GroupByKey"] - 144 -> 146 [style=solid label=""] - subgraph cluster_147 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" - subgraph cluster_148 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" - 149 [label="ParMultiDo(Anonymous)"] - 146 -> 149 [style=solid label=""] + subgraph cluster_143 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" + 144 [label="GroupByKey"] + 142 -> 144 [style=solid label=""] + subgraph cluster_145 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" + subgraph cluster_146 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" + 147 [label="ParMultiDo(Anonymous)"] + 144 -> 147 [style=solid label=""] } } } - subgraph cluster_150 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" - subgraph cluster_151 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" - subgraph cluster_152 { - label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" - 153 [label="ParMultiDo(Anonymous)"] - 149 -> 153 [style=solid label=""] + subgraph cluster_148 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" + subgraph cluster_149 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" + subgraph cluster_150 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" + 151 [label="ParMultiDo(Anonymous)"] + 147 -> 151 [style=solid label=""] } } } } - subgraph cluster_154 { - label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables" - subgraph cluster_155 { - label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" - subgraph cluster_156 { - label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" - 157 [label="ParMultiDo(Anonymous)"] - 153 -> 157 [style=solid label=""] + subgraph cluster_152 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables" + subgraph cluster_153 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" + subgraph cluster_154 { + label = "Wait on Transforms:Registrar/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" + 155 [label="ParMultiDo(Anonymous)"] + 151 -> 155 [style=solid label=""] } } } } - subgraph cluster_158 { - label = "Wait on phase one/To wait view 0/View.AsList" - subgraph cluster_159 { - label = "Wait on phase one/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" - subgraph cluster_160 { - label = "Wait on phase one/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" - 161 [label="ParMultiDo(VoidKeyToMultimapMaterialization)"] - 157 -> 161 [style=solid label=""] + subgraph cluster_156 { + label = "Wait on Transforms:Registrar/To wait view 0/View.AsList" + subgraph cluster_157 { + label = "Wait on Transforms:Registrar/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" + subgraph cluster_158 { + label = "Wait on Transforms:Registrar/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" + 159 [label="ParMultiDo(VoidKeyToMultimapMaterialization)"] + 155 -> 159 [style=solid label=""] } } - 162 [label="View.CreatePCollectionView"] - 161 -> 162 [style=solid label=""] + 160 [label="View.CreatePCollectionView"] + 159 -> 160 [style=solid label=""] } } - subgraph cluster_163 { - label = "Wait on phase one/Wait" - subgraph cluster_164 { - label = "Wait on phase one/Wait/Map" - 165 [label="ParMultiDo(Anonymous)"] - 132 -> 165 [style=solid label=""] - 161 -> 165 [style=dashed label=""] + subgraph cluster_161 { + label = "Wait on Transforms:Registrar/Wait" + subgraph cluster_162 { + label = "Wait on Transforms:Registrar/Wait/Map" + 163 [label="ParMultiDo(Anonymous)"] + 79 -> 163 [style=solid label=""] + 159 -> 163 [style=dashed label=""] } } } - subgraph cluster_166 { - label = "Write to sql: DomainBase without circular foreign keys" - subgraph cluster_167 { - label = "Write to sql: DomainBase without circular foreign keys/Shard data for DomainBase without circular foreign keys" - subgraph cluster_168 { - label = "Write to sql: DomainBase without circular foreign keys/Shard data for DomainBase without circular foreign keys/Map" - 169 [label="ParMultiDo(Anonymous)"] - 165 -> 169 [style=solid label=""] + subgraph cluster_164 { + label = "Write to sql: Transforms:ContactResource" + subgraph cluster_165 { + label = "Write to sql: Transforms:ContactResource/Shard data for Transforms:ContactResource" + subgraph cluster_166 { + label = "Write to sql: Transforms:ContactResource/Shard data for Transforms:ContactResource/Map" + 167 [label="ParMultiDo(Anonymous)"] + 163 -> 167 [style=solid label=""] } } - subgraph cluster_170 { - label = "Write to sql: DomainBase without circular foreign keys/Batch output by shard DomainBase without circular foreign keys" - subgraph cluster_171 { - label = "Write to sql: DomainBase without circular foreign keys/Batch output by shard DomainBase without circular foreign keys/ParDo(GroupIntoBatches)" - 172 [label="ParMultiDo(GroupIntoBatches)"] - 169 -> 172 [style=solid label=""] + subgraph cluster_168 { + label = "Write to sql: Transforms:ContactResource/Batch output by shard Transforms:ContactResource" + subgraph cluster_169 { + label = "Write to sql: Transforms:ContactResource/Batch output by shard Transforms:ContactResource/ParDo(GroupIntoBatches)" + 170 [label="ParMultiDo(GroupIntoBatches)"] + 167 -> 170 [style=solid label=""] } } - subgraph cluster_173 { - label = "Write to sql: DomainBase without circular foreign keys/Write in batch for DomainBase without circular foreign keys" - 174 [label="ParMultiDo(SqlBatchWriter)"] - 172 -> 174 [style=solid label=""] + subgraph cluster_171 { + label = "Write to sql: Transforms:ContactResource/Write in batch for Transforms:ContactResource" + 172 [label="ParMultiDo(SqlBatchWriter)"] + 170 -> 172 [style=solid label=""] } } + subgraph cluster_173 { + label = "Remove circular foreign keys from DomainBase" + 174 [label="ParMultiDo(RemoveDomainBaseForeignKeys)"] + 79 -> 174 [style=solid label=""] + } subgraph cluster_175 { - label = "Wait on DomainBaseNoFkeys" + label = "Wait on phase one" subgraph cluster_176 { - label = "Wait on DomainBaseNoFkeys/To wait view 0" + label = "Wait on phase one/To wait view 0" subgraph cluster_177 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Window.Into()" + label = "Wait on phase one/To wait view 0/Window.Into()" 178 [label="Flatten.PCollections"] - 174 -> 178 [style=solid label=""] + 172 -> 178 [style=solid label=""] } subgraph cluster_179 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/ParDo(CollectWindows)" + label = "Wait on phase one/To wait view 0/ParDo(CollectWindows)" 180 [label="ParMultiDo(CollectWindows)"] 178 -> 180 [style=solid label=""] } subgraph cluster_181 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any" + label = "Wait on phase one/To wait view 0/Sample.Any" subgraph cluster_182 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)" subgraph cluster_183 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" subgraph cluster_184 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" subgraph cluster_185 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" 186 [label="ParMultiDo(Anonymous)"] 180 -> 186 [style=solid label=""] } } } subgraph cluster_187 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" 188 [label="GroupByKey"] 186 -> 188 [style=solid label=""] subgraph cluster_189 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" subgraph cluster_190 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" 191 [label="ParMultiDo(Anonymous)"] 188 -> 191 [style=solid label=""] } } } subgraph cluster_192 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" subgraph cluster_193 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" subgraph cluster_194 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" + label = "Wait on phase one/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" 195 [label="ParMultiDo(Anonymous)"] 191 -> 195 [style=solid label=""] } @@ -521,11 +521,11 @@ digraph { } } subgraph cluster_196 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables" + label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables" subgraph cluster_197 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" + label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" subgraph cluster_198 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" + label = "Wait on phase one/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" 199 [label="ParMultiDo(Anonymous)"] 195 -> 199 [style=solid label=""] } @@ -533,11 +533,11 @@ digraph { } } subgraph cluster_200 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList" + label = "Wait on phase one/To wait view 0/View.AsList" subgraph cluster_201 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" + label = "Wait on phase one/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" subgraph cluster_202 { - label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" + label = "Wait on phase one/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" 203 [label="ParMultiDo(VoidKeyToMultimapMaterialization)"] 199 -> 203 [style=solid label=""] } @@ -547,38 +547,152 @@ digraph { } } subgraph cluster_205 { - label = "Wait on DomainBaseNoFkeys/Wait" + label = "Wait on phase one/Wait" subgraph cluster_206 { - label = "Wait on DomainBaseNoFkeys/Wait/Map" + label = "Wait on phase one/Wait/Map" 207 [label="ParMultiDo(Anonymous)"] - 79 -> 207 [style=solid label=""] + 174 -> 207 [style=solid label=""] 203 -> 207 [style=dashed label=""] } } } subgraph cluster_208 { - label = "Write to sql: Transforms:HostResource" + label = "Write to sql: DomainBase without circular foreign keys" subgraph cluster_209 { - label = "Write to sql: Transforms:HostResource/Shard data for Transforms:HostResource" + label = "Write to sql: DomainBase without circular foreign keys/Shard data for DomainBase without circular foreign keys" subgraph cluster_210 { - label = "Write to sql: Transforms:HostResource/Shard data for Transforms:HostResource/Map" + label = "Write to sql: DomainBase without circular foreign keys/Shard data for DomainBase without circular foreign keys/Map" 211 [label="ParMultiDo(Anonymous)"] 207 -> 211 [style=solid label=""] } } subgraph cluster_212 { - label = "Write to sql: Transforms:HostResource/Batch output by shard Transforms:HostResource" + label = "Write to sql: DomainBase without circular foreign keys/Batch output by shard DomainBase without circular foreign keys" subgraph cluster_213 { - label = "Write to sql: Transforms:HostResource/Batch output by shard Transforms:HostResource/ParDo(GroupIntoBatches)" + label = "Write to sql: DomainBase without circular foreign keys/Batch output by shard DomainBase without circular foreign keys/ParDo(GroupIntoBatches)" 214 [label="ParMultiDo(GroupIntoBatches)"] 211 -> 214 [style=solid label=""] } } subgraph cluster_215 { - label = "Write to sql: Transforms:HostResource/Write in batch for Transforms:HostResource" + label = "Write to sql: DomainBase without circular foreign keys/Write in batch for DomainBase without circular foreign keys" 216 [label="ParMultiDo(SqlBatchWriter)"] 214 -> 216 [style=solid label=""] } } + subgraph cluster_217 { + label = "Wait on DomainBaseNoFkeys" + subgraph cluster_218 { + label = "Wait on DomainBaseNoFkeys/To wait view 0" + subgraph cluster_219 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Window.Into()" + 220 [label="Flatten.PCollections"] + 216 -> 220 [style=solid label=""] + } + subgraph cluster_221 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/ParDo(CollectWindows)" + 222 [label="ParMultiDo(CollectWindows)"] + 220 -> 222 [style=solid label=""] + } + subgraph cluster_223 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any" + subgraph cluster_224 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)" + subgraph cluster_225 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys" + subgraph cluster_226 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys" + subgraph cluster_227 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/WithKeys/AddKeys/Map" + 228 [label="ParMultiDo(Anonymous)"] + 222 -> 228 [style=solid label=""] + } + } + } + subgraph cluster_229 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)" + 230 [label="GroupByKey"] + 228 -> 230 [style=solid label=""] + subgraph cluster_231 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues" + subgraph cluster_232 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Combine.perKey(SampleAny)/Combine.GroupedValues/ParDo(Anonymous)" + 233 [label="ParMultiDo(Anonymous)"] + 230 -> 233 [style=solid label=""] + } + } + } + subgraph cluster_234 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values" + subgraph cluster_235 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values" + subgraph cluster_236 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Combine.globally(SampleAny)/Values/Values/Map" + 237 [label="ParMultiDo(Anonymous)"] + 233 -> 237 [style=solid label=""] + } + } + } + } + subgraph cluster_238 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables" + subgraph cluster_239 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables" + subgraph cluster_240 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/Sample.Any/Flatten.Iterables/FlattenIterables/FlatMap" + 241 [label="ParMultiDo(Anonymous)"] + 237 -> 241 [style=solid label=""] + } + } + } + } + subgraph cluster_242 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList" + subgraph cluster_243 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization" + subgraph cluster_244 { + label = "Wait on DomainBaseNoFkeys/To wait view 0/View.AsList/View.VoidKeyToMultimapMaterialization/ParDo(VoidKeyToMultimapMaterialization)" + 245 [label="ParMultiDo(VoidKeyToMultimapMaterialization)"] + 241 -> 245 [style=solid label=""] + } + } + 246 [label="View.CreatePCollectionView"] + 245 -> 246 [style=solid label=""] + } + } + subgraph cluster_247 { + label = "Wait on DomainBaseNoFkeys/Wait" + subgraph cluster_248 { + label = "Wait on DomainBaseNoFkeys/Wait/Map" + 249 [label="ParMultiDo(Anonymous)"] + 79 -> 249 [style=solid label=""] + 245 -> 249 [style=dashed label=""] + } + } + } + subgraph cluster_250 { + label = "Write to sql: Transforms:HostResource" + subgraph cluster_251 { + label = "Write to sql: Transforms:HostResource/Shard data for Transforms:HostResource" + subgraph cluster_252 { + label = "Write to sql: Transforms:HostResource/Shard data for Transforms:HostResource/Map" + 253 [label="ParMultiDo(Anonymous)"] + 249 -> 253 [style=solid label=""] + } + } + subgraph cluster_254 { + label = "Write to sql: Transforms:HostResource/Batch output by shard Transforms:HostResource" + subgraph cluster_255 { + label = "Write to sql: Transforms:HostResource/Batch output by shard Transforms:HostResource/ParDo(GroupIntoBatches)" + 256 [label="ParMultiDo(GroupIntoBatches)"] + 253 -> 256 [style=solid label=""] + } + } + subgraph cluster_257 { + label = "Write to sql: Transforms:HostResource/Write in batch for Transforms:HostResource" + 258 [label="ParMultiDo(SqlBatchWriter)"] + 256 -> 258 [style=solid label=""] + } + } } } diff --git a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html index d85e83fd1..657d1d06e 100644 --- a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html +++ b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html @@ -261,2433 +261,2792 @@ td.section { generated on - 2020-10-30 21:56:22.867321 + 2020-11-04 16:40:52.942256 last flyway file - V71__create_kms_secret.sql + V72__add_missing_foreign_keys.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2020-10-30 21:56:22.867321 + + 2020-11-04 16:40:52.942256 - + allocationtoken_a08ccbef - - + + public.AllocationToken - - + + [table] - + token - + - + text not null - + domain_name - + - + text - - - - billingcancellation_6eedf614 - - - public.BillingCancellation - - - - [table] - - - billing_cancellation_id - - - - - int8 not null - - - registrar_id - - - - - text not null - - - event_time - - - - - timestamptz not null - - - billing_time - - - - - timestamptz - - - billing_event_id - - - - - int8 - - - billing_recurrence_id - - - - - int8 - - + - + billingevent_a57d1815 - - + + public.BillingEvent - - + + [table] - + billing_event_id - + - + int8 not null - + registrar_id - + - + text not null - + + domain_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + + text not null + + event_time - + - + timestamptz not null - - allocation_token_id + + allocation_token - + - + text - + billing_time - + - + timestamptz - + cancellation_matching_billing_recurrence_id - + - + int8 - + synthetic_creation_time - + - + timestamptz - - - - billingcancellation_6eedf614:w->billingevent_a57d1815:e - - - - - - - - - fk_billing_cancellation_billing_event_id + + + + billingevent_a57d1815:w->allocationtoken_a08ccbef:e + + + + + + + + + fk_billing_event_allocation_token billingrecurrence_5fa2cb01 - - + + public.BillingRecurrence - - + + [table] - + billing_recurrence_id - + - + int8 not null - + registrar_id - + - + text not null - + + domain_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + + text not null + + event_time - + - + timestamptz not null - + recurrence_end_time - + - + timestamptz - + recurrence_time_of_year - + - + text - - - - billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_billing_cancellation_billing_recurrence_id + + + + billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e + + + + + + + + + fk_billing_event_cancellation_matching_billing_recurrence_id - - - registrar_6e1503e3 - - - public.Registrar + + + domainhistory_a54cc226 + + + public.DomainHistory - - + + [table] - + + history_revision_id + + + + + int8 not null + + + history_registrar_id + + + + + text + + + history_modification_time + + + + + timestamptz not null + + + history_type + + + + + text not null + + + creation_time + + + + + timestamptz + + + domain_repo_id + + + + + text not null + + + + + billingevent_a57d1815:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_event_domain_history + + + + billingevent_a57d1815:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_event_domain_history + + + + registrar_6e1503e3 + + + public.Registrar + + + + [table] + + registrar_id - + - + text not null - + iana_identifier - + - + int8 - + registrar_name - + - + text not null - + + + + billingevent_a57d1815:w->registrar_6e1503e3:e + + + + + + + + + fk_billing_event_registrar_id + + + + billingcancellation_6eedf614 + + + public.BillingCancellation + + + + [table] + + + billing_cancellation_id + + + + + int8 not null + + + registrar_id + + + + + text not null + + + domain_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + + text not null + + + event_time + + + + + timestamptz not null + + + billing_time + + + + + timestamptz + + + billing_event_id + + + + + int8 + + + billing_recurrence_id + + + + + int8 + + + + + billingcancellation_6eedf614:w->billingevent_a57d1815:e + + + + + + + + + fk_billing_cancellation_billing_event_id + + + + billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e + + + + + + + + + fk_billing_cancellation_billing_recurrence_id + + + + billingcancellation_6eedf614:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_cancellation_domain_history + + + + billingcancellation_6eedf614:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_cancellation_domain_history + - + billingcancellation_6eedf614:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_cancellation_registrar_id - + domain_6c51cffa - - + + public.Domain - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + domain_name - + - + text - + tld - + - + text - + admin_contact - + - + text - + billing_contact - + - + text - + registrant_contact - + - + text - + tech_contact - + - + text - + transfer_billing_cancellation_id - + - + int8 - + transfer_billing_event_id - + - + int8 - + transfer_billing_recurrence_id - + - + int8 - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + billing_recurrence_id - + - + int8 - + autorenew_poll_message_id - + - + int8 - + deletion_poll_message_id - + - + int8 - + autorenew_end_time - + - + timestamptz - - - - domain_6c51cffa:w->billingcancellation_6eedf614:e - - - - - - - - - fk_domain_transfer_billing_cancellation_id - + - + domain_6c51cffa:w->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_event_id - - - domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_domain_billing_recurrence_id + + + domain_6c51cffa:w->billingcancellation_6eedf614:e + + + + + + + + + fk_domain_transfer_billing_cancellation_id domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + + fk_domain_billing_recurrence_id + + + + domain_6c51cffa:w->billingrecurrence_5fa2cb01:e + + + + + + + + fk_domain_transfer_billing_recurrence_id contact_8de8cb16 - - + + public.Contact - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + contact_id - + - + text - + search_name - + - + text - + + transfer_gaining_poll_message_id + + + + + int8 + + + transfer_losing_poll_message_id + + + + + int8 + + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - - - - domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_admin_contact - + domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_billing_contact + + + + + + + + + fk_domain_admin_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_registrant_contact + + + + + + + + + fk_domain_billing_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + + fk_domain_registrant_contact + + + + domain_6c51cffa:w->contact_8de8cb16:e + + + + + + + + fk_domain_tech_contact pollmessage_614a523e - - + + public.PollMessage - - + + [table] - + poll_message_id - + - + int8 not null - + registrar_id - + - + text not null - + contact_repo_id - + - + text - + contact_history_revision_id - + - + int8 - + domain_repo_id - + - + text - + domain_history_revision_id - + - + int8 - + event_time - + - + timestamptz not null - + host_repo_id - + - + text - + host_history_revision_id - + - + int8 - + transfer_response_gaining_registrar_id - + - + text - + transfer_response_losing_registrar_id - + - + text - + - + domain_6c51cffa:w->pollmessage_614a523e:e - - - - - - - - + + + + + + + + fk_domain_autorenew_poll_message_id - + domain_6c51cffa:w->pollmessage_614a523e:e - - - - - - - - + + + + + + + + fk_domain_deletion_poll_message_id - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2u3srsfbei272093m3b3xwj23 - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkjc0r9r5y1lfbt4gpbqw4wsuvq - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_gaining_registrar_id - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_losing_registrar_id - - - billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_billing_event_cancellation_matching_billing_recurrence_id + + + tld_f1fa57e2 + + + public.Tld - - - billingevent_a57d1815:w->registrar_6e1503e3:e - - - - - - - - - fk_billing_event_registrar_id + + + [table] + + + tld_name + + + + + text not null + + + + + domain_6c51cffa:w->tld_f1fa57e2:e + + + + + + + + + fk_domain_tld graceperiod_cd3b2e8f - - + + public.GracePeriod - - + + [table] - + id - + - + int8 not null - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - - domain_repo_id + + registrar_id - + - + text not null - - - - graceperiod_cd3b2e8f:w->domain_6c51cffa:e - - - - - - - - - fk_grace_period_domain_repo_id + + domain_repo_id + + + + text not null + + - + graceperiod_cd3b2e8f:w->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_grace_period_billing_event_id + + + graceperiod_cd3b2e8f:w->domain_6c51cffa:e + + + + + + + + + fk_grace_period_domain_repo_id + - + graceperiod_cd3b2e8f:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_grace_period_billing_recurrence_id + + + graceperiod_cd3b2e8f:w->registrar_6e1503e3:e + + + + + + + + + fk_grace_period_registrar_id + + + + billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_recurrence_domain_history + + + + billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_recurrence_domain_history + - + billingrecurrence_5fa2cb01:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_recurrence_registrar_id claimsentry_105da9f1 - - + + public.ClaimsEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + claimslist_3d49bc2b - - + + public.ClaimsList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + - + claimsentry_105da9f1:w->claimslist_3d49bc2b:e - - - - - - - - + + + + + + + + fk6sc6at5hedffc0nhdcab6ivuq + + + contact_8de8cb16:w->pollmessage_614a523e:e + + + + + + + + + fk_contact_transfer_gaining_poll_message_id + + + + contact_8de8cb16:w->pollmessage_614a523e:e + + + + + + + + + fk_contact_transfer_losing_poll_message_id + - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk93c185fx7chn68uv7nl6uv2s0 - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkmb7tdiv85863134w1wogtxrb2 - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_gaining_registrar_id - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_losing_registrar_id contacthistory_d2964f8a - - + + public.ContactHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + creation_time - + - + timestamptz - + contact_repo_id - + - + text not null - + - + contacthistory_d2964f8a:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_contact_history_contact_repo_id - + contacthistory_d2964f8a:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_history_registrar_id - + pollmessage_614a523e:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_poll_message_domain_repo_id - - pollmessage_614a523e:w->contact_8de8cb16:e - - - - - - - - - fk_poll_message_contact_repo_id - - - pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - - fk_poll_message_contact_history + pollmessage_614a523e:w->contact_8de8cb16:e + + + + + + + + + fk_poll_message_contact_repo_id pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history - - - domainhistory_a54cc226 - - - public.DomainHistory + + + pollmessage_614a523e:w->contacthistory_d2964f8a:e + + + + + + + + + fk_poll_message_contact_history - - - [table] - - - history_revision_id - - - - - int8 not null - - - history_registrar_id - - - - - text - - - history_modification_time - - - - - timestamptz not null - - - history_type - - - - - text not null - - - creation_time - - - - - timestamptz - - - domain_repo_id - - - - - text not null - - - + pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_poll_message_domain_history - + pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_poll_message_domain_history host_f21b78de - - + + public.Host - - + + [table] - + repo_id - + - + text not null - - superordinate_domain + + creation_registrar_id - + - + text - + + current_sponsor_registrar_id + + + + + text + + + last_epp_update_registrar_id + + + + + text + + + superordinate_domain + + + + + text + + - + pollmessage_614a523e:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_poll_message_host_repo_id - + hosthistory_56210c2 - - + + public.HostHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text not null - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + host_name - + - + text - + creation_time - + - + timestamptz - + host_repo_id - + - + text not null - + - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_registrar_id - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_gaining_registrar_id - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_losing_registrar_id cursor_6af40e8c - - + + public."Cursor" - - + + [table] - + "scope" - + - + text not null - + type - + - + text not null - + delegationsignerdata_e542a872 - - + + public.DelegationSignerData - - + + [table] - + domain_repo_id - + - + text not null - + key_tag - + - + int4 not null - + algorithm - + - + int4 not null - + digest - + - + bytea not null - + digest_type - + - + int4 not null - + - + delegationsignerdata_e542a872:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fktr24j9v14ph2mfuw2gsmt12kq - + domainhistory_a54cc226:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_domain_history_domain_repo_id - + domainhistory_a54cc226:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_history_registrar_id domainhost_1ea127c2 - - + + public.DomainHost - - + + [table] - + domain_repo_id - + - + text not null - + host_repo_id - + - + text - + - + domainhost_1ea127c2:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fkfmi7bdink53swivs390m2btxg - + domainhost_1ea127c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_domainhost_host_valid - + host_f21b78de:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_host_superordinate_domain - - - domaindsdatahistory_995b060d - - - public.DomainDsDataHistory + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_creation_registrar_id - - + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_current_sponsor_registrar_id + + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_last_epp_update_registrar_id + + + + spec11threatmatch_a61228a6 + + + public.Spec11ThreatMatch + + + [table] - - ds_data_history_revision_id + + id - + - - int8 not null + + bigserial not null - - domain_history_revision_id + - + + auto-incremented - - int8 not null + + check_date - + + + + date not null + + domain_repo_id - + - + + text not null + + + registrar_id + + + + + text not null + + + tld + + + + + text not null + + + + + spec11threatmatch_a61228a6:w->domain_6c51cffa:e + + + + + + + + + fk_spec11_threat_match_domain_repo_id + + + + spec11threatmatch_a61228a6:w->registrar_6e1503e3:e + + + + + + + + + fk_spec11_threat_match_registrar_id + + + + spec11threatmatch_a61228a6:w->tld_f1fa57e2:e + + + + + + + + + fk_spec11_threat_match_tld + + + + domaindsdatahistory_995b060d + + + public.DomainDsDataHistory + + + + [table] + + + ds_data_history_revision_id + + + + + int8 not null + + + domain_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + text - + - + domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j - + domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j - + domainhistoryhost_9f3f23ee - - + + public.DomainHistoryHost - - + + [table] - + domain_history_history_revision_id - + - + int8 not null - + domain_history_domain_repo_id - + - + text not null - + - + domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n - + domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n - + domaintransactionrecord_6e77ff61 - - + + public.DomainTransactionRecord - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + + tld + + + + + text not null + + domain_repo_id - + - + text - + history_revision_id - + - + int8 - + - + domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fkcjqe54u72kha71vkibvxhjye7 - + domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fkcjqe54u72kha71vkibvxhjye7 + + + domaintransactionrecord_6e77ff61:w->tld_f1fa57e2:e + + + + + + + + + fk_domain_transaction_record_tld + - + hosthistory_56210c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_hosthistory_host - + hosthistory_56210c2:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk3d09knnmxrt6iniwnp8j2ykga - + kmssecret_f3b28857 - - + + public.KmsSecret - - + + [table] - + revision_id - + - + int8 not null - + secret_name - + - + text not null - + - + lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name - + - + text not null - + tld - + - + text not null - + - + premiumentry_b0060b91 - - + + public.PremiumEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + - + premiumlist_7c3ea68b - - + + public.PremiumList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + name - + - + text not null - + - + premiumentry_b0060b91:w->premiumlist_7c3ea68b:e - - - - - - - - + + + + + + + + fko0gw90lpo1tuee56l0nb6y6g5 - + rderevision_83396864 - - + + public.RdeRevision - - + + [table] - + tld - + - + text not null - + mode - + - + text not null - + "date" - + - + date not null - + - + registrarpoc_ab47054d - - + + public.RegistrarPoc - - + + [table] - + email_address - + - + text not null - + gae_user_id - + - + text - + registrar_id - + - + text not null - + + + + registrarpoc_ab47054d:w->registrar_6e1503e3:e + + + + + + + + + fk_registrar_poc_registrar_id + - + registrylock_ac88663e - - + + public.RegistryLock - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + registrar_id - + - + text not null - + repo_id - + - + text not null - + verification_code - + - + text not null - + relock_revision_id - + - + int8 - + - + registrylock_ac88663e:w->registrylock_ac88663e:e - - - - - - - - + + + + + + + + fk2lhcwpxlnqijr96irylrh1707 - + reservedentry_1a7b8520 - - + + public.ReservedEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + - + reservedlist_b97c3f1c - - + + public.ReservedList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + name - + - + text not null - + - + reservedentry_1a7b8520:w->reservedlist_b97c3f1c:e - - - - - - - - + + + + + + + + fkgq03rk0bt1hb915dnyvd3vnfc - + signedmarkrevocationentry_99c39721 - - + + public.SignedMarkRevocationEntry - - + + [table] - + revision_id - + - + int8 not null - + smd_id - + - + text not null - + - + signedmarkrevocationlist_c5d968fb - - + + public.SignedMarkRevocationList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + - + signedmarkrevocationentry_99c39721:w->signedmarkrevocationlist_c5d968fb:e - - - - - - - - + + + + + + + + fk5ivlhvs3121yx2li5tqh54u4 - - - spec11threatmatch_a61228a6 - - - public.Spec11ThreatMatch - - - - [table] - - - id - - - - - bigserial not null - - - - - auto-incremented - - - check_date - - - - - date not null - - - registrar_id - - - - - text not null - - - tld - - - - - text not null - - - - - tld_f1fa57e2 - - - public.Tld - - - - [table] - - - tld_name - - - - - text not null - - transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + @@ -2724,6 +3083,24 @@ td.section { token +
+ +
+
+ Foreign Keys +
+
+ +
+
+ fk_billing_event_allocation_token + [foreign key, with no action] +
+
+ + token ←(0..many) public.BillingEvent.allocation_token + +

 

@@ -2741,6 +3118,16 @@ td.section { registrar_id text not null + + + domain_history_revision_id + int8 not null + + + + domain_repo_id + text not null + event_time @@ -2833,6 +3220,23 @@ td.section { registrar_id (0..many)→ public.Registrar.registrar_id + + + + + fk_billing_cancellation_domain_history + [foreign key, with no action] + + + + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + + + + + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +

 

@@ -2850,6 +3254,16 @@ td.section { registrar_id text not null + + + domain_history_revision_id + int8 not null + + + + domain_repo_id + text not null + event_time @@ -2857,7 +3271,7 @@ td.section { - allocation_token_id + allocation_token text @@ -2902,6 +3316,18 @@ td.section { + + fk_billing_event_allocation_token + [foreign key, with no action] + + + + allocation_token (0..many)→ public.AllocationToken.token + + + + + fk_billing_cancellation_billing_event_id [foreign key, with no action] @@ -2959,6 +3385,23 @@ td.section { registrar_id (0..many)→ public.Registrar.registrar_id + + + + + fk_billing_event_domain_history + [foreign key, with no action] + + + + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + + + + + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +

 

@@ -2976,6 +3419,16 @@ td.section { registrar_id text not null + + + domain_history_revision_id + int8 not null + + + + domain_repo_id + text not null + event_time @@ -3087,6 +3540,23 @@ td.section { registrar_id (0..many)→ public.Registrar.registrar_id + + + + + fk_billing_recurrence_domain_history + [foreign key, with no action] + + + + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + + + + + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +

 

@@ -3245,6 +3715,16 @@ td.section { search_name text + + + transfer_gaining_poll_message_id + int8 + + + + transfer_losing_poll_message_id + int8 + transfer_gaining_registrar_id @@ -3354,6 +3834,30 @@ td.section { + + fk_contact_transfer_gaining_poll_message_id + [foreign key, with no action] + + + + transfer_gaining_poll_message_id (0..many)→ public.PollMessage.poll_message_id + + + + + + + fk_contact_transfer_losing_poll_message_id + [foreign key, with no action] + + + + transfer_losing_poll_message_id (0..many)→ public.PollMessage.poll_message_id + + + + + fk1sfyj7o7954prbn1exk7lpnoe [foreign key, with no action] @@ -3953,6 +4457,18 @@ td.section { + + fk_spec11_threat_match_domain_repo_id + [foreign key, with no action] + + + + repo_id ←(0..many) public.Spec11ThreatMatch.domain_repo_id + + + + + fk_domain_autorenew_poll_message_id [foreign key, with no action] @@ -4034,6 +4550,18 @@ td.section { transfer_losing_registrar_id (0..many)→ public.Registrar.registrar_id + + + + + fk_domain_tld + [foreign key, with no action] + + + + tld (0..many)→ public.Tld.tld_name + +

 

@@ -4190,6 +4718,57 @@ td.section { + + fk_billing_cancellation_domain_history + [foreign key, with no action] + + + + domain_repo_id ←(0..many) public.BillingCancellation.domain_repo_id + + + + + history_revision_id ←(0..many) public.BillingCancellation.domain_history_revision_id + + + + + + + fk_billing_event_domain_history + [foreign key, with no action] + + + + domain_repo_id ←(0..many) public.BillingEvent.domain_repo_id + + + + + history_revision_id ←(0..many) public.BillingEvent.domain_history_revision_id + + + + + + + fk_billing_recurrence_domain_history + [foreign key, with no action] + + + + domain_repo_id ←(0..many) public.BillingRecurrence.domain_repo_id + + + + + history_revision_id ←(0..many) public.BillingRecurrence.domain_history_revision_id + + + + + fko4ilgyyfnvppbpuivus565i0j [foreign key, with no action] @@ -4359,6 +4938,11 @@ td.section { auto-incremented + + + tld + text not null + domain_repo_id @@ -4396,6 +4980,18 @@ td.section { + + fk_domain_transaction_record_tld + [foreign key, with no action] + + + + tld (0..many)→ public.Tld.tld_name + + + + + fkcjqe54u72kha71vkibvxhjye7 [foreign key, with no action] @@ -4432,6 +5028,11 @@ td.section { billing_recurrence_id int8 + + + registrar_id + text not null + domain_repo_id @@ -4497,6 +5098,18 @@ td.section { domain_repo_id (0..many)→ public.Domain.repo_id + + + + + fk_grace_period_registrar_id + [foreign key, with no action] + + + + registrar_id (0..many)→ public.Registrar.registrar_id + +

 

@@ -4509,6 +5122,21 @@ td.section { repo_id text not null + + + creation_registrar_id + text + + + + current_sponsor_registrar_id + text + + + + last_epp_update_registrar_id + text + superordinate_domain @@ -4586,6 +5214,42 @@ td.section { repo_id ←(0..many) public.PollMessage.host_repo_id + + + + + fk_host_creation_registrar_id + [foreign key, with no action] + + + + creation_registrar_id (0..many)→ public.Registrar.registrar_id + + + + + + + fk_host_current_sponsor_registrar_id + [foreign key, with no action] + + + + current_sponsor_registrar_id (0..many)→ public.Registrar.registrar_id + + + + + + + fk_host_last_epp_update_registrar_id + [foreign key, with no action] + + + + last_epp_update_registrar_id (0..many)→ public.Registrar.registrar_id + +

 

@@ -4898,6 +5562,30 @@ td.section { + + fk_contact_transfer_gaining_poll_message_id + [foreign key, with no action] + + + + poll_message_id ←(0..many) public.Contact.transfer_gaining_poll_message_id + + + + + + + fk_contact_transfer_losing_poll_message_id + [foreign key, with no action] + + + + poll_message_id ←(0..many) public.Contact.transfer_losing_poll_message_id + + + + + fk_domain_autorenew_poll_message_id [foreign key, with no action] @@ -5401,6 +6089,54 @@ td.section { + + fk_grace_period_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.GracePeriod.registrar_id + + + + + + + fk_host_creation_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.Host.creation_registrar_id + + + + + + + fk_host_current_sponsor_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.Host.current_sponsor_registrar_id + + + + + + + fk_host_last_epp_update_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.Host.last_epp_update_registrar_id + + + + + fk3d09knnmxrt6iniwnp8j2ykga [foreign key, with no action] @@ -5446,6 +6182,30 @@ td.section { registrar_id ←(0..many) public.PollMessage.transfer_response_losing_registrar_id + + + + + fk_registrar_poc_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.RegistrarPoc.registrar_id + + + + + + + fk_spec11_threat_match_registrar_id + [foreign key, with no action] + + + + registrar_id ←(0..many) public.Spec11ThreatMatch.registrar_id + +

 

@@ -5491,6 +6251,24 @@ td.section { email_address + + + + + Foreign Keys + + + + + + fk_registrar_poc_registrar_id + [foreign key, with no action] + + + + registrar_id (0..many)→ public.Registrar.registrar_id + +

 

@@ -5813,6 +6591,11 @@ td.section { check_date date not null + + + domain_repo_id + text not null + registrar_id @@ -5841,6 +6624,48 @@ td.section { id + + + + + Foreign Keys + + + + + + fk_spec11_threat_match_domain_repo_id + [foreign key, with no action] + + + + domain_repo_id (0..many)→ public.Domain.repo_id + + + + + + + fk_spec11_threat_match_registrar_id + [foreign key, with no action] + + + + registrar_id (0..many)→ public.Registrar.registrar_id + + + + + + + fk_spec11_threat_match_tld + [foreign key, with no action] + + + + tld (0..many)→ public.Tld.tld_name + +

 

@@ -5871,6 +6696,48 @@ td.section { tld_name + + + + + Foreign Keys + + + + + + fk_domain_tld + [foreign key, with no action] + + + + tld_name ←(0..many) public.Domain.tld + + + + + + + fk_domain_transaction_record_tld + [foreign key, with no action] + + + + tld_name ←(0..many) public.DomainTransactionRecord.tld + + + + + + + fk_spec11_threat_match_tld + [foreign key, with no action] + + + + tld_name ←(0..many) public.Spec11ThreatMatch.tld + +

 

diff --git a/db/src/main/resources/sql/er_diagram/full_er_diagram.html b/db/src/main/resources/sql/er_diagram/full_er_diagram.html index f35101fa3..0c7224a31 100644 --- a/db/src/main/resources/sql/er_diagram/full_er_diagram.html +++ b/db/src/main/resources/sql/er_diagram/full_er_diagram.html @@ -261,5681 +261,5928 @@ td.section { generated on - 2020-10-30 21:56:21.17995 + 2020-11-04 16:40:50.903391 last flyway file - V71__create_kms_secret.sql + V72__add_missing_foreign_keys.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2020-10-30 21:56:21.17995 + + 2020-11-04 16:40:50.903391 - + allocationtoken_a08ccbef - - + + public.AllocationToken - - + + [table] - + token - + - + text not null - + update_timestamp - + - + timestamptz - + allowed_registrar_ids - + - + _text - + allowed_tlds - + - + _text - + creation_time - + - + timestamptz not null - + discount_fraction - + - + float8(17, 17) not null - + discount_premiums - + - + bool not null - + discount_years - + - + int4 not null - + domain_name - + - + text - + redemption_history_entry - + - + text - + token_status_transitions - + - + "hstore" - + token_type - + - + text - - - - billingcancellation_6eedf614 - - - public.BillingCancellation - - - - [table] - - - billing_cancellation_id - - - - - int8 not null - - - registrar_id - - - - - text not null - - - domain_history_revision_id - - - - - int8 not null - - - domain_repo_id - - - - - text not null - - - event_time - - - - - timestamptz not null - - - flags - - - - - _text - - - reason - - - - - text not null - - - domain_name - - - - - text not null - - - billing_time - - - - - timestamptz - - - billing_event_id - - - - - int8 - - - billing_recurrence_id - - - - - int8 - - + - + billingevent_a57d1815 - - + + public.BillingEvent - - + + [table] - + billing_event_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + flags - + - + _text - + reason - + - + text not null - + domain_name - + - + text not null - - allocation_token_id + + allocation_token - + - + text - + billing_time - + - + timestamptz - + cancellation_matching_billing_recurrence_id - + - + int8 - + cost_amount - + - + numeric(19, 2) - + cost_currency - + - + text - + period_years - + - + int4 - + synthetic_creation_time - + - + timestamptz - - - - billingcancellation_6eedf614:w->billingevent_a57d1815:e - - - - - - - - - fk_billing_cancellation_billing_event_id + + + + billingevent_a57d1815:w->allocationtoken_a08ccbef:e + + + + + + + + + fk_billing_event_allocation_token billingrecurrence_5fa2cb01 - - + + public.BillingRecurrence - - + + [table] - + billing_recurrence_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + flags - + - + _text - + reason - + - + text not null - + domain_name - + - + text not null - + recurrence_end_time - + - + timestamptz - + recurrence_time_of_year - + - + text - - - - billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_billing_cancellation_billing_recurrence_id + + + + billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e + + + + + + + + + fk_billing_event_cancellation_matching_billing_recurrence_id - - - registrar_6e1503e3 - - - public.Registrar + + + domainhistory_a54cc226 + + + public.DomainHistory - - + + [table] - - registrar_id + + history_revision_id - + - + + int8 not null + + + history_by_superuser + + + + + bool not null + + + history_registrar_id + + + + + text + + + history_modification_time + + + + + timestamptz not null + + + history_reason + + + + + text + + + history_requested_by_registrar + + + + + bool not null + + + history_client_transaction_id + + + + + text + + + history_server_transaction_id + + + + + text + + + history_type + + + + text not null - - allowed_tlds + + history_xml_bytes - + - - _text + + bytea not null - - billing_account_map + + admin_contact - + - - "hstore" + + text - - billing_identifier + + auth_info_repo_id - + - + + text + + + auth_info_value + + + + + text + + + billing_recurrence_id + + + + int8 - - block_premium_names + + autorenew_poll_message_id - + - - bool not null + + int8 - - client_certificate + + billing_contact - + - + text - - client_certificate_hash + + deletion_poll_message_id - + - + + int8 + + + domain_name + + + + text - - contacts_require_syncing + + idn_table_name - + - - bool not null + + text - + + last_transfer_time + + + + + timestamptz + + + launch_notice_accepted_time + + + + + timestamptz + + + launch_notice_expiration_time + + + + + timestamptz + + + launch_notice_tcn_id + + + + + text + + + launch_notice_validator_id + + + + + text + + + registrant_contact + + + + + text + + + registration_expiration_time + + + + + timestamptz + + + smd_id + + + + + text + + + subordinate_hosts + + + + + _text + + + tech_contact + + + + + text + + + tld + + + + + text + + + transfer_billing_cancellation_id + + + + + int8 + + + transfer_billing_recurrence_id + + + + + int8 + + + transfer_autorenew_poll_message_id + + + + + int8 + + + transfer_billing_event_id + + + + + int8 + + + transfer_renew_period_unit + + + + + text + + + transfer_renew_period_value + + + + + int4 + + + transfer_registration_expiration_time + + + + + timestamptz + + + transfer_gaining_poll_message_id + + + + + int8 + + + transfer_losing_poll_message_id + + + + + int8 + + + transfer_client_txn_id + + + + + text + + + transfer_server_txn_id + + + + + text + + + transfer_gaining_registrar_id + + + + + text + + + transfer_losing_registrar_id + + + + + text + + + transfer_pending_expiration_time + + + + + timestamptz + + + transfer_request_time + + + + + timestamptz + + + transfer_status + + + + + text + + + creation_registrar_id + + + + + text + + creation_time - + - + timestamptz - - drive_folder_id + + current_sponsor_registrar_id - + - + text - - email_address + + deletion_time - + - + + timestamptz + + + last_epp_update_registrar_id + + + + text - - failover_client_certificate + + last_epp_update_time - + - + + timestamptz + + + statuses + + + + + _text + + + update_timestamp + + + + + timestamptz + + + domain_repo_id + + + + + text not null + + + autorenew_end_time + + + + + timestamptz + + + history_other_registrar_id + + + + text - - failover_client_certificate_hash + + history_period_unit - + - + text - - fax_number + + history_period_value - + - - text + + int4 - - iana_identifier + + billing_recurrence_history_id - + - + int8 - - icann_referral_email + + autorenew_poll_message_history_id - + - - text + + int8 - - i18n_address_city + + deletion_poll_message_history_id - + - - text + + int8 - - i18n_address_country_code + + transfer_billing_recurrence_history_id - + - - text + + int8 - - i18n_address_state + + transfer_autorenew_poll_message_history_id - + - - text + + int8 - - i18n_address_street_line1 + + transfer_billing_event_history_id - + - - text + + int8 - - i18n_address_street_line2 + + + + billingevent_a57d1815:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_event_domain_history - + + + billingevent_a57d1815:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_event_domain_history - - text + + + registrar_6e1503e3 + + + public.Registrar - - i18n_address_street_line3 + + + [table] - + + registrar_id - - text + - - i18n_address_zip - - - - - text - - - ip_address_allow_list - - - - - _text - - - last_certificate_update_time - - - - - timestamptz - - - last_update_time - - - - - timestamptz - - - localized_address_city - - - - - text - - - localized_address_country_code - - - - - text - - - localized_address_state - - - - - text - - - localized_address_street_line1 - - - - - text - - - localized_address_street_line2 - - - - - text - - - localized_address_street_line3 - - - - - text - - - localized_address_zip - - - - - text - - - password_hash - - - - - text - - - phone_number - - - - - text - - - phone_passcode - - - - - text - - - po_number - - - - - text - - - rdap_base_urls - - - - - _text - - - registrar_name - - - - + text not null - - registry_lock_allowed + + allowed_tlds - + - + + _text + + + billing_account_map + + + + + "hstore" + + + billing_identifier + + + + + int8 + + + block_premium_names + + + + bool not null - - password_salt + + client_certificate - + - + text - - state + + client_certificate_hash - + - + text - - type + + contacts_require_syncing - + - + + bool not null + + + creation_time + + + + + timestamptz + + + drive_folder_id + + + + + text + + + email_address + + + + + text + + + failover_client_certificate + + + + + text + + + failover_client_certificate_hash + + + + + text + + + fax_number + + + + + text + + + iana_identifier + + + + + int8 + + + icann_referral_email + + + + + text + + + i18n_address_city + + + + + text + + + i18n_address_country_code + + + + + text + + + i18n_address_state + + + + + text + + + i18n_address_street_line1 + + + + + text + + + i18n_address_street_line2 + + + + + text + + + i18n_address_street_line3 + + + + + text + + + i18n_address_zip + + + + + text + + + ip_address_allow_list + + + + + _text + + + last_certificate_update_time + + + + + timestamptz + + + last_update_time + + + + + timestamptz + + + localized_address_city + + + + + text + + + localized_address_country_code + + + + + text + + + localized_address_state + + + + + text + + + localized_address_street_line1 + + + + + text + + + localized_address_street_line2 + + + + + text + + + localized_address_street_line3 + + + + + text + + + localized_address_zip + + + + + text + + + password_hash + + + + + text + + + phone_number + + + + + text + + + phone_passcode + + + + + text + + + po_number + + + + + text + + + rdap_base_urls + + + + + _text + + + registrar_name + + + + text not null - + + registry_lock_allowed + + + + + bool not null + + + password_salt + + + + + text + + + state + + + + + text + + + type + + + + + text not null + + url - + - + text - + whois_server - + - + text - + + + + billingevent_a57d1815:w->registrar_6e1503e3:e + + + + + + + + + fk_billing_event_registrar_id + + + + billingcancellation_6eedf614 + + + public.BillingCancellation + + + + [table] + + + billing_cancellation_id + + + + + int8 not null + + + registrar_id + + + + + text not null + + + domain_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + + text not null + + + event_time + + + + + timestamptz not null + + + flags + + + + + _text + + + reason + + + + + text not null + + + domain_name + + + + + text not null + + + billing_time + + + + + timestamptz + + + billing_event_id + + + + + int8 + + + billing_recurrence_id + + + + + int8 + + + + + billingcancellation_6eedf614:w->billingevent_a57d1815:e + + + + + + + + + fk_billing_cancellation_billing_event_id + + + + billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e + + + + + + + + + fk_billing_cancellation_billing_recurrence_id + + + + billingcancellation_6eedf614:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_cancellation_domain_history + + + + billingcancellation_6eedf614:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_cancellation_domain_history + - + billingcancellation_6eedf614:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_cancellation_registrar_id - + domain_6c51cffa - - + + public.Domain - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + auth_info_repo_id - + - + text - + auth_info_value - + - + text - + domain_name - + - + text - + idn_table_name - + - + text - + last_transfer_time - + - + timestamptz - + launch_notice_accepted_time - + - + timestamptz - + launch_notice_expiration_time - + - + timestamptz - + launch_notice_tcn_id - + - + text - + launch_notice_validator_id - + - + text - + registration_expiration_time - + - + timestamptz - + smd_id - + - + text - + subordinate_hosts - + - + _text - + tld - + - + text - + admin_contact - + - + text - + billing_contact - + - + text - + registrant_contact - + - + text - + tech_contact - + - + text - + transfer_gaining_poll_message_id - + - + int8 - + transfer_losing_poll_message_id - + - + int8 - + transfer_billing_cancellation_id - + - + int8 - + transfer_billing_event_id - + - + int8 - + transfer_billing_recurrence_id - + - + int8 - + transfer_autorenew_poll_message_id - + - + int8 - + transfer_renew_period_unit - + - + text - + transfer_renew_period_value - + - + int4 - + transfer_client_txn_id - + - + text - + transfer_server_txn_id - + - + text - + transfer_registration_expiration_time - + - + timestamptz - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + transfer_pending_expiration_time - + - + timestamptz - + transfer_request_time - + - + timestamptz - + transfer_status - + - + text - + update_timestamp - + - + timestamptz - + billing_recurrence_id - + - + int8 - + autorenew_poll_message_id - + - + int8 - + deletion_poll_message_id - + - + int8 - + autorenew_end_time - + - + timestamptz - + billing_recurrence_history_id - + - + int8 - + autorenew_poll_message_history_id - + - + int8 - + deletion_poll_message_history_id - + - + int8 - + transfer_billing_recurrence_history_id - + - + int8 - + transfer_autorenew_poll_message_history_id - + - + int8 - + transfer_billing_event_history_id - + - + int8 - - - - domain_6c51cffa:w->billingcancellation_6eedf614:e - - - - - - - - - fk_domain_transfer_billing_cancellation_id - + - + domain_6c51cffa:w->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_event_id - - - domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_domain_billing_recurrence_id + + + domain_6c51cffa:w->billingcancellation_6eedf614:e + + + + + + + + + fk_domain_transfer_billing_cancellation_id domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + + fk_domain_billing_recurrence_id + + + + domain_6c51cffa:w->billingrecurrence_5fa2cb01:e + + + + + + + + fk_domain_transfer_billing_recurrence_id contact_8de8cb16 - - + + public.Contact - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + auth_info_repo_id - + - + text - + auth_info_value - + - + text - + contact_id - + - + text - + disclose_types_addr - + - + _text - + disclose_show_email - + - + bool - + disclose_show_fax - + - + bool - + disclose_mode_flag - + - + bool - + disclose_types_name - + - + _text - + disclose_types_org - + - + _text - + disclose_show_voice - + - + bool - + email - + - + text - + fax_phone_extension - + - + text - + fax_phone_number - + - + text - + addr_i18n_city - + - + text - + addr_i18n_country_code - + - + text - + addr_i18n_state - + - + text - + addr_i18n_street_line1 - + - + text - + addr_i18n_street_line2 - + - + text - + addr_i18n_street_line3 - + - + text - + addr_i18n_zip - + - + text - + addr_i18n_name - + - + text - + addr_i18n_org - + - + text - + addr_i18n_type - + - + text - + last_transfer_time - + - + timestamptz - + addr_local_city - + - + text - + addr_local_country_code - + - + text - + addr_local_state - + - + text - + addr_local_street_line1 - + - + text - + addr_local_street_line2 - + - + text - + addr_local_street_line3 - + - + text - + addr_local_zip - + - + text - + addr_local_name - + - + text - + addr_local_org - + - + text - + addr_local_type - + - + text - + search_name - + - + text - + voice_phone_extension - + - + text - + voice_phone_number - + - + text - + transfer_gaining_poll_message_id - + - + int8 - + transfer_losing_poll_message_id - + - + int8 - + transfer_client_txn_id - + - + text - + transfer_server_txn_id - + - + text - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + transfer_pending_expiration_time - + - + timestamptz - + transfer_request_time - + - + timestamptz - + transfer_status - + - + text - + update_timestamp - + - + timestamptz - - - - domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_admin_contact - + domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_billing_contact + + + + + + + + + fk_domain_admin_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - - fk_domain_registrant_contact + + + + + + + + + fk_domain_billing_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + + fk_domain_registrant_contact + + + + domain_6c51cffa:w->contact_8de8cb16:e + + + + + + + + fk_domain_tech_contact pollmessage_614a523e - - + + public.PollMessage - - + + [table] - + type - + - + text not null - + poll_message_id - + - + int8 not null - + registrar_id - + - + text not null - + contact_repo_id - + - + text - + contact_history_revision_id - + - + int8 - + domain_repo_id - + - + text - + domain_history_revision_id - + - + int8 - + event_time - + - + timestamptz not null - + host_repo_id - + - + text - + host_history_revision_id - + - + int8 - + message - + - + text - + transfer_response_contact_id - + - + text - + transfer_response_domain_expiration_time - + - + timestamptz - + transfer_response_domain_name - + - + text - + pending_action_response_action_result - + - + bool - + pending_action_response_name_or_id - + - + text - + pending_action_response_processed_date - + - + timestamptz - + pending_action_response_client_txn_id - + - + text - + pending_action_response_server_txn_id - + - + text - + transfer_response_gaining_registrar_id - + - + text - + transfer_response_losing_registrar_id - + - + text - + transfer_response_pending_transfer_expiration_time - + - + timestamptz - + transfer_response_transfer_request_time - + - + timestamptz - + transfer_response_transfer_status - + - + text - + autorenew_end_time - + - + timestamptz - + autorenew_domain_name - + - + text - + - + domain_6c51cffa:w->pollmessage_614a523e:e - - - - - - - - + + + + + + + + fk_domain_autorenew_poll_message_id - + domain_6c51cffa:w->pollmessage_614a523e:e - - - - - - - - + + + + + + + + fk_domain_deletion_poll_message_id - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2u3srsfbei272093m3b3xwj23 - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkjc0r9r5y1lfbt4gpbqw4wsuvq - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_gaining_registrar_id - + domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_losing_registrar_id - - - billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e - - - - - - - - - fk_billing_event_cancellation_matching_billing_recurrence_id + + + tld_f1fa57e2 + + + public.Tld - - - billingevent_a57d1815:w->registrar_6e1503e3:e - - - - - - - - - fk_billing_event_registrar_id + + + [table] + + + tld_name + + + + + text not null + + + add_grace_period_length + + + + + interval not null + + + allowed_fully_qualified_host_names + + + + + _text + + + allowed_registrant_contact_ids + + + + + _text + + + anchor_tenant_add_grace_period_length + + + + + interval not null + + + auto_renew_grace_period_length + + + + + interval not null + + + automatic_transfer_length + + + + + interval not null + + + claims_period_end + + + + + timestamptz not null + + + create_billing_cost_amount + + + + + numeric(19, 2) + + + create_billing_cost_currency + + + + + text + + + creation_time + + + + + timestamptz not null + + + currency + + + + + text not null + + + dns_paused + + + + + bool not null + + + dns_writers + + + + + _text not null + + + drive_folder_id + + + + + text + + + eap_fee_schedule + + + + + "hstore" not null + + + escrow_enabled + + + + + bool not null + + + invoicing_enabled + + + + + bool not null + + + lordn_username + + + + + text + + + num_dns_publish_locks + + + + + int4 not null + + + pending_delete_length + + + + + interval not null + + + premium_list_name + + + + + text + + + pricing_engine_class_name + + + + + text + + + redemption_grace_period_length + + + + + interval not null + + + registry_lock_or_unlock_cost_amount + + + + + numeric(19, 2) + + + registry_lock_or_unlock_cost_currency + + + + + text + + + renew_billing_cost_transitions + + + + + "hstore" not null + + + renew_grace_period_length + + + + + interval not null + + + reserved_list_names + + + + + _text + + + restore_billing_cost_amount + + + + + numeric(19, 2) + + + restore_billing_cost_currency + + + + + text + + + roid_suffix + + + + + text + + + server_status_change_billing_cost_amount + + + + + numeric(19, 2) + + + server_status_change_billing_cost_currency + + + + + text + + + tld_state_transitions + + + + + "hstore" not null + + + tld_type + + + + + text not null + + + tld_unicode + + + + + text not null + + + transfer_grace_period_length + + + + + interval not null + + + + + domain_6c51cffa:w->tld_f1fa57e2:e + + + + + + + + + fk_domain_tld graceperiod_cd3b2e8f - - + + public.GracePeriod - - + + [table] - + id - + - + int8 not null - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + registrar_id - + - + text not null - + domain_repo_id - + - + text not null - + expiration_time - + - + timestamptz not null - + type - + - + text not null - + billing_event_history_id - + - + int8 - + billing_recurrence_history_id - + - + int8 - - - - graceperiod_cd3b2e8f:w->domain_6c51cffa:e - - - - - - - - - fk_grace_period_domain_repo_id - + - + graceperiod_cd3b2e8f:w->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_grace_period_billing_event_id + + + graceperiod_cd3b2e8f:w->domain_6c51cffa:e + + + + + + + + + fk_grace_period_domain_repo_id + - + graceperiod_cd3b2e8f:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_grace_period_billing_recurrence_id + + + graceperiod_cd3b2e8f:w->registrar_6e1503e3:e + + + + + + + + + fk_grace_period_registrar_id + + + + billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_recurrence_domain_history + + + + billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e + + + + + + + + + fk_billing_recurrence_domain_history + - + billingrecurrence_5fa2cb01:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_recurrence_registrar_id claimsentry_105da9f1 - - + + public.ClaimsEntry - - + + [table] - + revision_id - + - + int8 not null - + claim_key - + - + text not null - + domain_label - + - + text not null - + claimslist_3d49bc2b - - + + public.ClaimsList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_timestamp - + - + timestamptz not null - + tmdb_generation_time - + - + timestamptz not null - + - + claimsentry_105da9f1:w->claimslist_3d49bc2b:e - - - - - - - - + + + + + + + + fk6sc6at5hedffc0nhdcab6ivuq + + + contact_8de8cb16:w->pollmessage_614a523e:e + + + + + + + + + fk_contact_transfer_gaining_poll_message_id + + + + contact_8de8cb16:w->pollmessage_614a523e:e + + + + + + + + + fk_contact_transfer_losing_poll_message_id + - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk93c185fx7chn68uv7nl6uv2s0 - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkmb7tdiv85863134w1wogtxrb2 - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_gaining_registrar_id - + contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_losing_registrar_id contacthistory_d2964f8a - - + + public.ContactHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_by_superuser - + - + bool not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_reason - + - + text - + history_requested_by_registrar - + - + bool not null - + history_client_transaction_id - + - + text - + history_server_transaction_id - + - + text - + history_type - + - + text not null - + history_xml_bytes - + - + bytea not null - + auth_info_repo_id - + - + text - + auth_info_value - + - + text - + contact_id - + - + text - + disclose_types_addr - + - + _text - + disclose_show_email - + - + bool - + disclose_show_fax - + - + bool - + disclose_mode_flag - + - + bool - + disclose_types_name - + - + _text - + disclose_types_org - + - + _text - + disclose_show_voice - + - + bool - + email - + - + text - + fax_phone_extension - + - + text - + fax_phone_number - + - + text - + addr_i18n_city - + - + text - + addr_i18n_country_code - + - + text - + addr_i18n_state - + - + text - + addr_i18n_street_line1 - + - + text - + addr_i18n_street_line2 - + - + text - + addr_i18n_street_line3 - + - + text - + addr_i18n_zip - + - + text - + addr_i18n_name - + - + text - + addr_i18n_org - + - + text - + addr_i18n_type - + - + text - + last_transfer_time - + - + timestamptz - + addr_local_city - + - + text - + addr_local_country_code - + - + text - + addr_local_state - + - + text - + addr_local_street_line1 - + - + text - + addr_local_street_line2 - + - + text - + addr_local_street_line3 - + - + text - + addr_local_zip - + - + text - + addr_local_name - + - + text - + addr_local_org - + - + text - + addr_local_type - + - + text - + search_name - + - + text - + transfer_gaining_poll_message_id - + - + int8 - + transfer_losing_poll_message_id - + - + int8 - + transfer_client_txn_id - + - + text - + transfer_server_txn_id - + - + text - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + transfer_pending_expiration_time - + - + timestamptz - + transfer_request_time - + - + timestamptz - + transfer_status - + - + text - + voice_phone_extension - + - + text - + voice_phone_number - + - + text - + creation_registrar_id - + - + text - + creation_time - + - + timestamptz - + current_sponsor_registrar_id - + - + text - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + contact_repo_id - + - + text not null - + update_timestamp - + - + timestamptz - + - + contacthistory_d2964f8a:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_contact_history_contact_repo_id - + contacthistory_d2964f8a:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_history_registrar_id - + pollmessage_614a523e:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_poll_message_domain_repo_id - - pollmessage_614a523e:w->contact_8de8cb16:e - - - - - - - - - fk_poll_message_contact_repo_id - - - pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - - fk_poll_message_contact_history + pollmessage_614a523e:w->contact_8de8cb16:e + + + + + + + + + fk_poll_message_contact_repo_id pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history - - - domainhistory_a54cc226 - - - public.DomainHistory + + + pollmessage_614a523e:w->contacthistory_d2964f8a:e + + + + + + + + + fk_poll_message_contact_history - - - [table] - - - history_revision_id - - - - - int8 not null - - - history_by_superuser - - - - - bool not null - - - history_registrar_id - - - - - text - - - history_modification_time - - - - - timestamptz not null - - - history_reason - - - - - text - - - history_requested_by_registrar - - - - - bool not null - - - history_client_transaction_id - - - - - text - - - history_server_transaction_id - - - - - text - - - history_type - - - - - text not null - - - history_xml_bytes - - - - - bytea not null - - - admin_contact - - - - - text - - - auth_info_repo_id - - - - - text - - - auth_info_value - - - - - text - - - billing_recurrence_id - - - - - int8 - - - autorenew_poll_message_id - - - - - int8 - - - billing_contact - - - - - text - - - deletion_poll_message_id - - - - - int8 - - - domain_name - - - - - text - - - idn_table_name - - - - - text - - - last_transfer_time - - - - - timestamptz - - - launch_notice_accepted_time - - - - - timestamptz - - - launch_notice_expiration_time - - - - - timestamptz - - - launch_notice_tcn_id - - - - - text - - - launch_notice_validator_id - - - - - text - - - registrant_contact - - - - - text - - - registration_expiration_time - - - - - timestamptz - - - smd_id - - - - - text - - - subordinate_hosts - - - - - _text - - - tech_contact - - - - - text - - - tld - - - - - text - - - transfer_billing_cancellation_id - - - - - int8 - - - transfer_billing_recurrence_id - - - - - int8 - - - transfer_autorenew_poll_message_id - - - - - int8 - - - transfer_billing_event_id - - - - - int8 - - - transfer_renew_period_unit - - - - - text - - - transfer_renew_period_value - - - - - int4 - - - transfer_registration_expiration_time - - - - - timestamptz - - - transfer_gaining_poll_message_id - - - - - int8 - - - transfer_losing_poll_message_id - - - - - int8 - - - transfer_client_txn_id - - - - - text - - - transfer_server_txn_id - - - - - text - - - transfer_gaining_registrar_id - - - - - text - - - transfer_losing_registrar_id - - - - - text - - - transfer_pending_expiration_time - - - - - timestamptz - - - transfer_request_time - - - - - timestamptz - - - transfer_status - - - - - text - - - creation_registrar_id - - - - - text - - - creation_time - - - - - timestamptz - - - current_sponsor_registrar_id - - - - - text - - - deletion_time - - - - - timestamptz - - - last_epp_update_registrar_id - - - - - text - - - last_epp_update_time - - - - - timestamptz - - - statuses - - - - - _text - - - update_timestamp - - - - - timestamptz - - - domain_repo_id - - - - - text not null - - - autorenew_end_time - - - - - timestamptz - - - history_other_registrar_id - - - - - text - - - history_period_unit - - - - - text - - - history_period_value - - - - - int4 - - - billing_recurrence_history_id - - - - - int8 - - - autorenew_poll_message_history_id - - - - - int8 - - - deletion_poll_message_history_id - - - - - int8 - - - transfer_billing_recurrence_history_id - - - - - int8 - - - transfer_autorenew_poll_message_history_id - - - - - int8 - - - transfer_billing_event_history_id - - - - - int8 - - - + pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_poll_message_domain_history - + pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_poll_message_domain_history host_f21b78de - - + + public.Host - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text - + creation_time - + - + timestamptz - + current_sponsor_registrar_id - + - + text - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + host_name - + - + text - + last_superordinate_change - + - + timestamptz - + last_transfer_time - + - + timestamptz - + superordinate_domain - + - + text - + inet_addresses - + - + _text - + update_timestamp - + - + timestamptz - + - + pollmessage_614a523e:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_poll_message_host_repo_id - + hosthistory_56210c2 - - + + public.HostHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_by_superuser - + - + bool not null - + history_registrar_id - + - + text not null - + history_modification_time - + - + timestamptz not null - + history_reason - + - + text - + history_requested_by_registrar - + - + bool not null - + history_client_transaction_id - + - + text - + history_server_transaction_id - + - + text - + history_type - + - + text not null - + history_xml_bytes - + - + bytea not null - + host_name - + - + text - + inet_addresses - + - + _text - + last_superordinate_change - + - + timestamptz - + last_transfer_time - + - + timestamptz - + superordinate_domain - + - + text - + creation_registrar_id - + - + text - + creation_time - + - + timestamptz - + current_sponsor_registrar_id - + - + text - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + host_repo_id - + - + text not null - + update_timestamp - + - + timestamptz - + - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_registrar_id - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_gaining_registrar_id - + pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_losing_registrar_id cursor_6af40e8c - - + + public."Cursor" - - + + [table] - + "scope" - + - + text not null - + type - + - + text not null - + cursor_time - + - + timestamptz not null - + last_update_time - + - + timestamptz not null - + delegationsignerdata_e542a872 - - + + public.DelegationSignerData - - + + [table] - + domain_repo_id - + - + text not null - + key_tag - + - + int4 not null - + algorithm - + - + int4 not null - + digest - + - + bytea not null - + digest_type - + - + int4 not null - + - + delegationsignerdata_e542a872:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fktr24j9v14ph2mfuw2gsmt12kq - + domainhistory_a54cc226:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_domain_history_domain_repo_id - + domainhistory_a54cc226:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_history_registrar_id domainhost_1ea127c2 - - + + public.DomainHost - - + + [table] - + domain_repo_id - + - + text not null - + host_repo_id - + - + text - + - + domainhost_1ea127c2:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fkfmi7bdink53swivs390m2btxg - + domainhost_1ea127c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_domainhost_host_valid - + host_f21b78de:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_host_superordinate_domain - - - domaindsdatahistory_995b060d - - - public.DomainDsDataHistory + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_creation_registrar_id - - + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_current_sponsor_registrar_id + + + + host_f21b78de:w->registrar_6e1503e3:e + + + + + + + + + fk_host_last_epp_update_registrar_id + + + + spec11threatmatch_a61228a6 + + + public.Spec11ThreatMatch + + + [table] - - ds_data_history_revision_id + + id - + - - int8 not null + + bigserial not null - - algorithm + - + + auto-incremented - - int4 not null + + check_date - - digest + - + + date not null - - bytea not null + + domain_name - - digest_type + - + + text not null - - int4 not null - - - domain_history_revision_id - - - - - int8 not null - - - key_tag - - - - - int4 not null - - + domain_repo_id - + - + + text not null + + + registrar_id + + + + + text not null + + + threat_types + + + + + _text not null + + + tld + + + + + text not null + + + + + spec11threatmatch_a61228a6:w->domain_6c51cffa:e + + + + + + + + + fk_spec11_threat_match_domain_repo_id + + + + spec11threatmatch_a61228a6:w->registrar_6e1503e3:e + + + + + + + + + fk_spec11_threat_match_registrar_id + + + + spec11threatmatch_a61228a6:w->tld_f1fa57e2:e + + + + + + + + + fk_spec11_threat_match_tld + + + + domaindsdatahistory_995b060d + + + public.DomainDsDataHistory + + + + [table] + + + ds_data_history_revision_id + + + + + int8 not null + + + algorithm + + + + + int4 not null + + + digest + + + + + bytea not null + + + digest_type + + + + + int4 not null + + + domain_history_revision_id + + + + + int8 not null + + + key_tag + + + + + int4 not null + + + domain_repo_id + + + + text - + - + domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j - + domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j - + domainhistoryhost_9f3f23ee - - + + public.DomainHistoryHost - - + + [table] - + domain_history_history_revision_id - + - + int8 not null - + host_repo_id - + - + text - + domain_history_domain_repo_id - + - + text not null - + - + domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n - + domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n - + domaintransactionrecord_6e77ff61 - - + + public.DomainTransactionRecord - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + report_amount - + - + int4 not null - + report_field - + - + text not null - + reporting_time - + - + timestamptz not null - + tld - + - + text not null - + domain_repo_id - + - + text - + history_revision_id - + - + int8 - + - + domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fkcjqe54u72kha71vkibvxhjye7 - + domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fkcjqe54u72kha71vkibvxhjye7 + + + domaintransactionrecord_6e77ff61:w->tld_f1fa57e2:e + + + + + + + + + fk_domain_transaction_record_tld + - + hosthistory_56210c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_hosthistory_host - + hosthistory_56210c2:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk3d09knnmxrt6iniwnp8j2ykga - + kmssecret_f3b28857 - - + + public.KmsSecret - - + + [table] - + revision_id - + - + int8 not null - + creation_time - + - + timestamptz not null - + encrypted_value - + - + text not null - + crypto_key_version_name - + - + text not null - + secret_name - + - + text not null - + - + lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name - + - + text not null - + tld - + - + text not null - + acquired_time - + - + timestamptz not null - + expiration_time - + - + timestamptz not null - + request_log_id - + - + text not null - + - + premiumentry_b0060b91 - - + + public.PremiumEntry - - + + [table] - + revision_id - + - + int8 not null - + price - + - + numeric(19, 2) not null - + domain_label - + - + text not null - + - + premiumlist_7c3ea68b - - + + public.PremiumList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_timestamp - + - + timestamptz not null - + name - + - + text not null - + bloom_filter - + - + bytea not null - + currency - + - + text not null - + - + premiumentry_b0060b91:w->premiumlist_7c3ea68b:e - - - - - - - - + + + + + + + + fko0gw90lpo1tuee56l0nb6y6g5 - + rderevision_83396864 - - + + public.RdeRevision - - + + [table] - + tld - + - + text not null - + mode - + - + text not null - + "date" - + - + date not null - + update_timestamp - + - + timestamptz - + revision - + - + int4 not null - + - + registrarpoc_ab47054d - - + + public.RegistrarPoc - - + + [table] - + email_address - + - + text not null - + allowed_to_set_registry_lock_password - + - + bool not null - + fax_number - + - + text - + gae_user_id - + - + text - + name - + - + text - + phone_number - + - + text - + registry_lock_password_hash - + - + text - + registry_lock_password_salt - + - + text - + types - + - + _text - + visible_in_domain_whois_as_abuse - + - + bool not null - + visible_in_whois_as_admin - + - + bool not null - + visible_in_whois_as_tech - + - + bool not null - + registry_lock_email_address - + - + text - + registrar_id - + - + text not null - + + + + registrarpoc_ab47054d:w->registrar_6e1503e3:e + + + + + + + + + fk_registrar_poc_registrar_id + - + registrylock_ac88663e - - + + public.RegistryLock - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + lock_completion_timestamp - + - + timestamptz - + lock_request_timestamp - + - + timestamptz not null - + domain_name - + - + text not null - + is_superuser - + - + bool not null - + registrar_id - + - + text not null - + registrar_poc_id - + - + text - + repo_id - + - + text not null - + verification_code - + - + text not null - + unlock_request_timestamp - + - + timestamptz - + unlock_completion_timestamp - + - + timestamptz - + last_update_timestamp - + - + timestamptz - + relock_revision_id - + - + int8 - + relock_duration - + - + interval - + - + registrylock_ac88663e:w->registrylock_ac88663e:e - - - - - - - - + + + + + + + + fk2lhcwpxlnqijr96irylrh1707 - + reservedentry_1a7b8520 - - + + public.ReservedEntry - - + + [table] - + revision_id - + - + int8 not null - + comment - + - + text - + reservation_type - + - + int4 not null - + domain_label - + - + text not null - + - + reservedlist_b97c3f1c - - + + public.ReservedList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_timestamp - + - + timestamptz not null - + name - + - + text not null - + should_publish - + - + bool not null - + - + reservedentry_1a7b8520:w->reservedlist_b97c3f1c:e - - - - - - - - + + + + + + + + fkgq03rk0bt1hb915dnyvd3vnfc - + signedmarkrevocationentry_99c39721 - - + + public.SignedMarkRevocationEntry - - + + [table] - + revision_id - + - + int8 not null - + revocation_time - + - + timestamptz not null - + smd_id - + - + text not null - + - + signedmarkrevocationlist_c5d968fb - - + + public.SignedMarkRevocationList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_time - + - + timestamptz - + - + signedmarkrevocationentry_99c39721:w->signedmarkrevocationlist_c5d968fb:e - - - - - - - - + + + + + + + + fk5ivlhvs3121yx2li5tqh54u4 - - - spec11threatmatch_a61228a6 - - - public.Spec11ThreatMatch - - - - [table] - - - id - - - - - bigserial not null - - - - - auto-incremented - - - check_date - - - - - date not null - - - domain_name - - - - - text not null - - - domain_repo_id - - - - - text not null - - - registrar_id - - - - - text not null - - - threat_types - - - - - _text not null - - - tld - - - - - text not null - - - - - tld_f1fa57e2 - - - public.Tld - - - - [table] - - - tld_name - - - - - text not null - - - add_grace_period_length - - - - - interval not null - - - allowed_fully_qualified_host_names - - - - - _text - - - allowed_registrant_contact_ids - - - - - _text - - - anchor_tenant_add_grace_period_length - - - - - interval not null - - - auto_renew_grace_period_length - - - - - interval not null - - - automatic_transfer_length - - - - - interval not null - - - claims_period_end - - - - - timestamptz not null - - - create_billing_cost_amount - - - - - numeric(19, 2) - - - create_billing_cost_currency - - - - - text - - - creation_time - - - - - timestamptz not null - - - currency - - - - - text not null - - - dns_paused - - - - - bool not null - - - dns_writers - - - - - _text not null - - - drive_folder_id - - - - - text - - - eap_fee_schedule - - - - - "hstore" not null - - - escrow_enabled - - - - - bool not null - - - invoicing_enabled - - - - - bool not null - - - lordn_username - - - - - text - - - num_dns_publish_locks - - - - - int4 not null - - - pending_delete_length - - - - - interval not null - - - premium_list_name - - - - - text - - - pricing_engine_class_name - - - - - text - - - redemption_grace_period_length - - - - - interval not null - - - registry_lock_or_unlock_cost_amount - - - - - numeric(19, 2) - - - registry_lock_or_unlock_cost_currency - - - - - text - - - renew_billing_cost_transitions - - - - - "hstore" not null - - - renew_grace_period_length - - - - - interval not null - - - reserved_list_names - - - - - _text - - - restore_billing_cost_amount - - - - - numeric(19, 2) - - - restore_billing_cost_currency - - - - - text - - - roid_suffix - - - - - text - - - server_status_change_billing_cost_amount - - - - - numeric(19, 2) - - - server_status_change_billing_cost_currency - - - - - text - - - tld_state_transitions - - - - - "hstore" not null - - - tld_type - - - - - text not null - - - tld_unicode - - - - - text not null - - - transfer_grace_period_length - - - - - interval not null - - transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + contents - + - + bytea - + @@ -6025,6 +6272,24 @@ td.section {
+
+ Foreign Keys +
+
+ +
+
+ fk_billing_event_allocation_token + [foreign key, with no action] +
+
+ + token ←(0..many) public.BillingEvent.allocation_token + +
+
+ +
Indexes
@@ -6189,6 +6454,23 @@ td.section {
+
+ fk_billing_cancellation_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + +
+
+ + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +
+
+ +
Indexes
@@ -6289,7 +6571,7 @@ td.section {
- allocation_token_id + allocation_token text
@@ -6349,6 +6631,18 @@ td.section {
+
+ fk_billing_event_allocation_token + [foreign key, with no action] +
+
+ + allocation_token (0..many)→ public.AllocationToken.token + +
+
+ +
fk_billing_cancellation_billing_event_id [foreign key, with no action] @@ -6409,6 +6703,23 @@ td.section {
+
+ fk_billing_event_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + +
+
+ + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +
+
+ +
Indexes
@@ -6433,7 +6744,7 @@ td.section {
- allocation_token_id + allocation_token ascending
@@ -6640,6 +6951,23 @@ td.section {
+
+ fk_billing_recurrence_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id (0..many)→ public.DomainHistory.domain_repo_id + +
+
+ + domain_history_revision_id (0..many)→ public.DomainHistory.history_revision_id + +
+
+ +
Indexes
@@ -7251,6 +7579,30 @@ td.section {
+
+ fk_contact_transfer_gaining_poll_message_id + [foreign key, with no action] +
+
+ + transfer_gaining_poll_message_id (0..many)→ public.PollMessage.poll_message_id + +
+
+ +
+
+ fk_contact_transfer_losing_poll_message_id + [foreign key, with no action] +
+
+ + transfer_losing_poll_message_id (0..many)→ public.PollMessage.poll_message_id + +
+
+ +
fk1sfyj7o7954prbn1exk7lpnoe [foreign key, with no action] @@ -8532,6 +8884,18 @@ td.section {
+
+ fk_spec11_threat_match_domain_repo_id + [foreign key, with no action] +
+
+ + repo_id ←(0..many) public.Spec11ThreatMatch.domain_repo_id + +
+
+ +
fk_domain_autorenew_poll_message_id [foreign key, with no action] @@ -8616,6 +8980,18 @@ td.section {
+
+ fk_domain_tld + [foreign key, with no action] +
+
+ + tld (0..many)→ public.Tld.tld_name + +
+
+ +
Indexes
@@ -9192,6 +9568,57 @@ td.section {
+
+ fk_billing_cancellation_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id ←(0..many) public.BillingCancellation.domain_repo_id + +
+
+ + history_revision_id ←(0..many) public.BillingCancellation.domain_history_revision_id + +
+
+ +
+
+ fk_billing_event_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id ←(0..many) public.BillingEvent.domain_repo_id + +
+
+ + history_revision_id ←(0..many) public.BillingEvent.domain_history_revision_id + +
+
+ +
+
+ fk_billing_recurrence_domain_history + [foreign key, with no action] +
+
+ + domain_repo_id ←(0..many) public.BillingRecurrence.domain_repo_id + +
+
+ + history_revision_id ←(0..many) public.BillingRecurrence.domain_history_revision_id + +
+
+ +
fko4ilgyyfnvppbpuivus565i0j [foreign key, with no action] @@ -9494,6 +9921,18 @@ td.section {
+
+ fk_domain_transaction_record_tld + [foreign key, with no action] +
+
+ + tld (0..many)→ public.Tld.tld_name + +
+
+ +
fkcjqe54u72kha71vkibvxhjye7 [foreign key, with no action] @@ -9641,6 +10080,18 @@ td.section {
+
+ fk_grace_period_registrar_id + [foreign key, with no action] +
+
+ + registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
Indexes
@@ -9820,6 +10271,42 @@ td.section {
+
+ fk_host_creation_registrar_id + [foreign key, with no action] +
+
+ + creation_registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
+
+ fk_host_current_sponsor_registrar_id + [foreign key, with no action] +
+
+ + current_sponsor_registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
+
+ fk_host_last_epp_update_registrar_id + [foreign key, with no action] +
+
+ + last_epp_update_registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
Indexes
@@ -10473,6 +10960,30 @@ td.section {
+
+ fk_contact_transfer_gaining_poll_message_id + [foreign key, with no action] +
+
+ + poll_message_id ←(0..many) public.Contact.transfer_gaining_poll_message_id + +
+
+ +
+
+ fk_contact_transfer_losing_poll_message_id + [foreign key, with no action] +
+
+ + poll_message_id ←(0..many) public.Contact.transfer_losing_poll_message_id + +
+
+ +
fk_domain_autorenew_poll_message_id [foreign key, with no action] @@ -11339,6 +11850,54 @@ td.section {
+
+ fk_grace_period_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.GracePeriod.registrar_id + +
+
+ +
+
+ fk_host_creation_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.Host.creation_registrar_id + +
+
+ +
+
+ fk_host_current_sponsor_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.Host.current_sponsor_registrar_id + +
+
+ +
+
+ fk_host_last_epp_update_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.Host.last_epp_update_registrar_id + +
+
+ +
fk3d09knnmxrt6iniwnp8j2ykga [foreign key, with no action] @@ -11387,6 +11946,30 @@ td.section {
+
+ fk_registrar_poc_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.RegistrarPoc.registrar_id + +
+
+ +
+
+ fk_spec11_threat_match_registrar_id + [foreign key, with no action] +
+
+ + registrar_id ←(0..many) public.Spec11ThreatMatch.registrar_id + +
+
+ +
Indexes
@@ -11529,6 +12112,24 @@ td.section {
+
+ Foreign Keys +
+
+ +
+
+ fk_registrar_poc_registrar_id + [foreign key, with no action] +
+
+ + registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
Indexes
@@ -12157,6 +12758,48 @@ td.section {
+
+ Foreign Keys +
+
+ +
+
+ fk_spec11_threat_match_domain_repo_id + [foreign key, with no action] +
+
+ + domain_repo_id (0..many)→ public.Domain.repo_id + +
+
+ +
+
+ fk_spec11_threat_match_registrar_id + [foreign key, with no action] +
+
+ + registrar_id (0..many)→ public.Registrar.registrar_id + +
+
+ +
+
+ fk_spec11_threat_match_tld + [foreign key, with no action] +
+
+ + tld (0..many)→ public.Tld.tld_name + +
+
+ +
Indexes
@@ -12426,6 +13069,48 @@ td.section {
+
+ Foreign Keys +
+
+ +
+
+ fk_domain_tld + [foreign key, with no action] +
+
+ + tld_name ←(0..many) public.Domain.tld + +
+
+ +
+
+ fk_domain_transaction_record_tld + [foreign key, with no action] +
+
+ + tld_name ←(0..many) public.DomainTransactionRecord.tld + +
+
+ +
+
+ fk_spec11_threat_match_tld + [foreign key, with no action] +
+
+ + tld_name ←(0..many) public.Spec11ThreatMatch.tld + +
+
+ +
Indexes
diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index fa017182b..6e1602c67 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -69,3 +69,4 @@ V68__make_reserved_list_nullable_in_registry.sql V69__change_primary_key_and_add_history_table_for_delegation_signer.sql V70__signed_mark_revocation_list.sql V71__create_kms_secret.sql +V72__add_missing_foreign_keys.sql diff --git a/db/src/main/resources/sql/flyway/V72__add_missing_foreign_keys.sql b/db/src/main/resources/sql/flyway/V72__add_missing_foreign_keys.sql new file mode 100644 index 000000000..f92062a09 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V72__add_missing_foreign_keys.sql @@ -0,0 +1,95 @@ +-- 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. + +alter table if exists "RegistrarPoc" + add constraint fk_registrar_poc_registrar_id + foreign key (registrar_id) + references "Registrar"; + +alter table if exists "Spec11ThreatMatch" + add constraint fk_spec11_threat_match_domain_repo_id + foreign key (domain_repo_id) + references "Domain"; + +alter table if exists "Spec11ThreatMatch" + add constraint fk_spec11_threat_match_registrar_id + foreign key (registrar_id) + references "Registrar"; + +alter table if exists "Spec11ThreatMatch" + add constraint fk_spec11_threat_match_tld + foreign key (tld) + references "Tld"; + +alter table if exists "BillingEvent" + add constraint fk_billing_event_domain_history + foreign key (domain_repo_id, domain_history_revision_id) + references "DomainHistory"; + +alter table "BillingEvent" rename allocation_token_id to allocation_token; + +alter table if exists "BillingEvent" + add constraint fk_billing_event_allocation_token + foreign key (allocation_token) + references "AllocationToken"; + +alter table if exists "BillingRecurrence" + add constraint fk_billing_recurrence_domain_history + foreign key (domain_repo_id, domain_history_revision_id) + references "DomainHistory"; + +alter table if exists "BillingCancellation" + add constraint fk_billing_cancellation_domain_history + foreign key (domain_repo_id, domain_history_revision_id) + references "DomainHistory"; + +alter table if exists "Contact" + add constraint fk_contact_transfer_gaining_poll_message_id + foreign key (transfer_gaining_poll_message_id) + references "PollMessage"; + +alter table if exists "Contact" + add constraint fk_contact_transfer_losing_poll_message_id + foreign key (transfer_losing_poll_message_id) + references "PollMessage"; + +alter table if exists "Domain" + add constraint fk_domain_tld + foreign key (tld) + references "Tld"; + +alter table if exists "DomainTransactionRecord" + add constraint fk_domain_transaction_record_tld + foreign key (tld) + references "Tld"; + +alter table if exists "GracePeriod" + add constraint fk_grace_period_registrar_id + foreign key (registrar_id) + references "Registrar"; + +alter table if exists "Host" + add constraint fk_host_creation_registrar_id + foreign key (creation_registrar_id) + references "Registrar"; + +alter table if exists "Host" + add constraint fk_host_current_sponsor_registrar_id + foreign key (current_sponsor_registrar_id) + references "Registrar"; + +alter table if exists "Host" + add constraint fk_host_last_epp_update_registrar_id + foreign key (last_epp_update_registrar_id) + references "Registrar"; diff --git a/db/src/main/resources/sql/schema/db-schema.sql.generated b/db/src/main/resources/sql/schema/db-schema.sql.generated index d58973af7..1bdd0556d 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -52,7 +52,7 @@ flags text[], reason text not null, domain_name text not null, - allocation_token_id text, + allocation_token text, billing_time timestamptz, cancellation_matching_billing_recurrence_id int8, cost_amount numeric(19, 2), @@ -705,7 +705,7 @@ create index IDXqspv57gj2led8ly42fq01t7m7 on "BillingEvent" (registrar_id); create index IDX5yfbr88439pxw0v3j86c74fp8 on "BillingEvent" (event_time); create index IDX6py6ocrab0ivr76srcd2okpnq on "BillingEvent" (billing_time); create index IDXplxf9v56p0wg8ws6qsvd082hk on "BillingEvent" (synthetic_creation_time); -create index IDXhmv411mdqo5ibn4vy7ykxpmlv on "BillingEvent" (allocation_token_id); +create index IDXcesda59ssop44kklytpb292hn on "BillingEvent" (allocation_token); create index IDXd3gxhkh0jk694pjvh9pyn7wjc on "BillingRecurrence" (registrar_id); create index IDX6syykou4nkc7hqa5p8r92cpch on "BillingRecurrence" (event_time); create index IDXp3usbtvk0v1m14i5tdp4xnxgc on "BillingRecurrence" (recurrence_end_time); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 5f1667a9f..e95350d55 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -86,7 +86,7 @@ CREATE TABLE public."BillingEvent" ( flags text[], reason text NOT NULL, domain_name text NOT NULL, - allocation_token_id text, + allocation_token text, billing_time timestamp with time zone, cancellation_matching_billing_recurrence_id bigint, cost_amount numeric(19,2), @@ -1514,7 +1514,7 @@ CREATE INDEX idxhlqqd5uy98cjyos72d81x9j95 ON public."DelegationSignerData" USING -- Name: idxhmv411mdqo5ibn4vy7ykxpmlv; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX idxhmv411mdqo5ibn4vy7ykxpmlv ON public."BillingEvent" USING btree (allocation_token_id); +CREATE INDEX idxhmv411mdqo5ibn4vy7ykxpmlv ON public."BillingEvent" USING btree (allocation_token); -- @@ -1786,6 +1786,14 @@ ALTER TABLE ONLY public."BillingCancellation" ADD CONSTRAINT fk_billing_cancellation_billing_recurrence_id FOREIGN KEY (billing_recurrence_id) REFERENCES public."BillingRecurrence"(billing_recurrence_id); +-- +-- Name: BillingCancellation fk_billing_cancellation_domain_history; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."BillingCancellation" + ADD CONSTRAINT fk_billing_cancellation_domain_history FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id); + + -- -- Name: BillingCancellation fk_billing_cancellation_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1794,6 +1802,14 @@ ALTER TABLE ONLY public."BillingCancellation" ADD CONSTRAINT fk_billing_cancellation_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id); +-- +-- Name: BillingEvent fk_billing_event_allocation_token; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."BillingEvent" + ADD CONSTRAINT fk_billing_event_allocation_token FOREIGN KEY (allocation_token) REFERENCES public."AllocationToken"(token); + + -- -- Name: BillingEvent fk_billing_event_cancellation_matching_billing_recurrence_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1802,6 +1818,14 @@ ALTER TABLE ONLY public."BillingEvent" ADD CONSTRAINT fk_billing_event_cancellation_matching_billing_recurrence_id FOREIGN KEY (cancellation_matching_billing_recurrence_id) REFERENCES public."BillingRecurrence"(billing_recurrence_id); +-- +-- Name: BillingEvent fk_billing_event_domain_history; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."BillingEvent" + ADD CONSTRAINT fk_billing_event_domain_history FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id); + + -- -- Name: BillingEvent fk_billing_event_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1810,6 +1834,14 @@ ALTER TABLE ONLY public."BillingEvent" ADD CONSTRAINT fk_billing_event_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id); +-- +-- Name: BillingRecurrence fk_billing_recurrence_domain_history; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."BillingRecurrence" + ADD CONSTRAINT fk_billing_recurrence_domain_history FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id); + + -- -- Name: BillingRecurrence fk_billing_recurrence_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1834,6 +1866,14 @@ ALTER TABLE ONLY public."ContactHistory" ADD CONSTRAINT fk_contact_history_registrar_id FOREIGN KEY (history_registrar_id) REFERENCES public."Registrar"(registrar_id); +-- +-- Name: Contact fk_contact_transfer_gaining_poll_message_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Contact" + ADD CONSTRAINT fk_contact_transfer_gaining_poll_message_id FOREIGN KEY (transfer_gaining_poll_message_id) REFERENCES public."PollMessage"(poll_message_id); + + -- -- Name: Contact fk_contact_transfer_gaining_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1842,6 +1882,14 @@ ALTER TABLE ONLY public."Contact" ADD CONSTRAINT fk_contact_transfer_gaining_registrar_id FOREIGN KEY (transfer_gaining_registrar_id) REFERENCES public."Registrar"(registrar_id); +-- +-- Name: Contact fk_contact_transfer_losing_poll_message_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Contact" + ADD CONSTRAINT fk_contact_transfer_losing_poll_message_id FOREIGN KEY (transfer_losing_poll_message_id) REFERENCES public."PollMessage"(poll_message_id); + + -- -- Name: Contact fk_contact_transfer_losing_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1922,6 +1970,22 @@ ALTER TABLE ONLY public."Domain" ADD CONSTRAINT fk_domain_tech_contact FOREIGN KEY (tech_contact) REFERENCES public."Contact"(repo_id); +-- +-- Name: Domain fk_domain_tld; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Domain" + ADD CONSTRAINT fk_domain_tld FOREIGN KEY (tld) REFERENCES public."Tld"(tld_name); + + +-- +-- Name: DomainTransactionRecord fk_domain_transaction_record_tld; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."DomainTransactionRecord" + ADD CONSTRAINT fk_domain_transaction_record_tld FOREIGN KEY (tld) REFERENCES public."Tld"(tld_name); + + -- -- Name: Domain fk_domain_transfer_billing_cancellation_id; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -1994,6 +2058,38 @@ ALTER TABLE ONLY public."GracePeriod" ADD CONSTRAINT fk_grace_period_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id) DEFERRABLE INITIALLY DEFERRED; +-- +-- Name: GracePeriod fk_grace_period_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."GracePeriod" + ADD CONSTRAINT fk_grace_period_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id); + + +-- +-- Name: Host fk_host_creation_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Host" + ADD CONSTRAINT fk_host_creation_registrar_id FOREIGN KEY (creation_registrar_id) REFERENCES public."Registrar"(registrar_id); + + +-- +-- Name: Host fk_host_current_sponsor_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Host" + ADD CONSTRAINT fk_host_current_sponsor_registrar_id FOREIGN KEY (current_sponsor_registrar_id) REFERENCES public."Registrar"(registrar_id); + + +-- +-- Name: Host fk_host_last_epp_update_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Host" + ADD CONSTRAINT fk_host_last_epp_update_registrar_id FOREIGN KEY (last_epp_update_registrar_id) REFERENCES public."Registrar"(registrar_id); + + -- -- Name: Host fk_host_superordinate_domain; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2082,6 +2178,38 @@ 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); +-- +-- Name: RegistrarPoc fk_registrar_poc_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."RegistrarPoc" + ADD CONSTRAINT fk_registrar_poc_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id); + + +-- +-- Name: Spec11ThreatMatch fk_spec11_threat_match_domain_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Spec11ThreatMatch" + ADD CONSTRAINT fk_spec11_threat_match_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id); + + +-- +-- Name: Spec11ThreatMatch fk_spec11_threat_match_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Spec11ThreatMatch" + ADD CONSTRAINT fk_spec11_threat_match_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id); + + +-- +-- Name: Spec11ThreatMatch fk_spec11_threat_match_tld; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."Spec11ThreatMatch" + ADD CONSTRAINT fk_spec11_threat_match_tld FOREIGN KEY (tld) REFERENCES public."Tld"(tld_name); + + -- -- Name: DomainHistoryHost fka9woh3hu8gx5x0vly6bai327n; Type: FK CONSTRAINT; Schema: public; Owner: - --