diff --git a/common/src/testing/java/google/registry/testing/truth/TruthUtils.java b/common/src/testing/java/google/registry/testing/truth/TruthUtils.java new file mode 100644 index 000000000..a0f4b1155 --- /dev/null +++ b/common/src/testing/java/google/registry/testing/truth/TruthUtils.java @@ -0,0 +1,47 @@ +// 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. + +package google.registry.testing.truth; + +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.common.truth.Truth; +import javax.annotation.Nullable; + +/** Utils class containing helper functions for {@link Truth}. */ +public class TruthUtils { + + /** Asserts that both of the given objects are either null or nonnull. */ + public static void assertNullnessParity(@Nullable Object thisObj, @Nullable Object thatObj) { + if (thisObj == null) { + assertWithMessage("Expects both objects are null but thatObj is not null") + .that(thatObj) + .isNull(); + } else { + assertWithMessage("Expects both objects are not null but thatObj is null") + .that(thatObj) + .isNotNull(); + } + } + + /** Asserts that both of the given objects are either null or nonnull. */ + public static void assertNullnessParity( + @Nullable Object thisObj, @Nullable Object thatObj, String errorMessage) { + if (thisObj == null) { + assertWithMessage(errorMessage).that(thatObj).isNull(); + } else { + assertWithMessage(errorMessage).that(thatObj).isNotNull(); + } + } +} diff --git a/core/src/main/java/google/registry/model/domain/DomainHistory.java b/core/src/main/java/google/registry/model/domain/DomainHistory.java index 2d0c8cbdb..cb389be0c 100644 --- a/core/src/main/java/google/registry/model/domain/DomainHistory.java +++ b/core/src/main/java/google/registry/model/domain/DomainHistory.java @@ -24,6 +24,7 @@ import com.googlecode.objectify.annotation.EntitySubclass; import com.googlecode.objectify.annotation.Ignore; import google.registry.model.ImmutableObject; import google.registry.model.domain.DomainHistory.DomainHistoryId; +import google.registry.model.domain.GracePeriod.GracePeriodHistory; import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.host.HostResource; import google.registry.model.reporting.DomainTransactionRecord; @@ -118,6 +119,24 @@ public class DomainHistory extends HistoryEntry implements SqlEntity { }) Set dsDataHistories; + @OneToMany( + cascade = {CascadeType.ALL}, + fetch = FetchType.EAGER, + orphanRemoval = true) + @JoinColumns({ + @JoinColumn( + name = "domainHistoryRevisionId", + referencedColumnName = "historyRevisionId", + insertable = false, + updatable = false), + @JoinColumn( + name = "domainRepoId", + referencedColumnName = "domainRepoId", + insertable = false, + updatable = false) + }) + Set gracePeriodHistories; + @Override @Nullable @Access(AccessType.PROPERTY) @@ -205,6 +224,10 @@ public class DomainHistory extends HistoryEntry implements SqlEntity { return VKey.create(DomainBase.class, getDomainRepoId()); } + public Set getGracePeriodHistories() { + return nullToEmptyImmutableCopy(gracePeriodHistories); + } + /** Creates a {@link VKey} instance for this entity. */ public VKey createVKey() { return VKey.create( @@ -327,6 +350,10 @@ public class DomainHistory extends HistoryEntry implements SqlEntity { nullToEmptyImmutableCopy(instance.domainContent.getDsData()).stream() .map(dsData -> DomainDsDataHistory.createFrom(instance.id, dsData)) .collect(toImmutableSet()); + instance.gracePeriodHistories = + nullToEmptyImmutableCopy(instance.domainContent.getGracePeriods()).stream() + .map(gracePeriod -> GracePeriodHistory.createFrom(instance.id, gracePeriod)) + .collect(toImmutableSet()); } return instance; } diff --git a/core/src/main/java/google/registry/model/domain/GracePeriod.java b/core/src/main/java/google/registry/model/domain/GracePeriod.java index 3f7c71f70..7c860e8ea 100644 --- a/core/src/main/java/google/registry/model/domain/GracePeriod.java +++ b/core/src/main/java/google/registry/model/domain/GracePeriod.java @@ -17,7 +17,9 @@ package google.registry.model.domain; import static com.google.common.base.Preconditions.checkArgument; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; +import com.google.common.annotations.VisibleForTesting; import com.googlecode.objectify.annotation.Embed; +import com.googlecode.objectify.annotation.OnLoad; import google.registry.model.billing.BillingEvent; import google.registry.model.billing.BillingEvent.Recurring; import google.registry.model.domain.rgp.GracePeriodStatus; @@ -25,7 +27,10 @@ import google.registry.model.ofy.ObjectifyService; import google.registry.persistence.VKey; import google.registry.schema.replay.DatastoreAndSqlEntity; import javax.annotation.Nullable; +import javax.persistence.Access; +import javax.persistence.AccessType; import javax.persistence.Entity; +import javax.persistence.Id; import javax.persistence.Index; import javax.persistence.Table; import org.joda.time.DateTime; @@ -41,20 +46,36 @@ import org.joda.time.DateTime; @Table(indexes = @Index(columnList = "domainRepoId")) public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntity { + @Id + @Access(AccessType.PROPERTY) + @Override + public long getGracePeriodId() { + return super.getGracePeriodId(); + } + + // TODO(b/169873747): Remove this method after explicitly re-saving all domain entities. + @OnLoad + void onLoad() { + if (gracePeriodId == null) { + gracePeriodId = ObjectifyService.allocateId(); + } + } + private static GracePeriod createInternal( GracePeriodStatus type, String domainRepoId, DateTime expirationTime, String clientId, @Nullable VKey billingEventOneTime, - @Nullable VKey billingEventRecurring) { + @Nullable VKey billingEventRecurring, + @Nullable Long gracePeriodId) { checkArgument((billingEventOneTime == null) || (billingEventRecurring == null), "A grace period can have at most one billing event"); checkArgument( (billingEventRecurring != null) == GracePeriodStatus.AUTO_RENEW.equals(type), "Recurring billing events must be present on (and only on) autorenew grace periods"); GracePeriod instance = new GracePeriod(); - instance.id = ObjectifyService.allocateId(); + instance.gracePeriodId = gracePeriodId == null ? ObjectifyService.allocateId() : gracePeriodId; instance.type = checkArgumentNotNull(type); instance.domainRepoId = checkArgumentNotNull(domainRepoId); instance.expirationTime = checkArgumentNotNull(expirationTime); @@ -79,7 +100,28 @@ public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntit DateTime expirationTime, String clientId, @Nullable VKey billingEventOneTime) { - return createInternal(type, domainRepoId, expirationTime, clientId, billingEventOneTime, null); + return createInternal( + type, domainRepoId, expirationTime, clientId, billingEventOneTime, null, null); + } + + /** + * Creates a GracePeriod for an (optional) OneTime billing event and a given {@link + * #gracePeriodId}. + * + *

Normal callers should always use {@link #forBillingEvent} instead, assuming they do not need + * to avoid loading the BillingEvent from Datastore. This method should typically be called only + * from test code to explicitly construct GracePeriods. + */ + @VisibleForTesting + public static GracePeriod create( + GracePeriodStatus type, + String domainRepoId, + DateTime expirationTime, + String clientId, + @Nullable VKey billingEventOneTime, + @Nullable Long gracePeriodId) { + return createInternal( + type, domainRepoId, expirationTime, clientId, billingEventOneTime, null, gracePeriodId); } /** Creates a GracePeriod for a Recurring billing event. */ @@ -91,13 +133,27 @@ public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntit VKey billingEventRecurring) { checkArgumentNotNull(billingEventRecurring, "billingEventRecurring cannot be null"); return createInternal( - type, domainRepoId, expirationTime, clientId, null, billingEventRecurring); + type, domainRepoId, expirationTime, clientId, null, billingEventRecurring, null); + } + + /** Creates a GracePeriod for a Recurring billing event and a given {@link #gracePeriodId}. */ + @VisibleForTesting + public static GracePeriod createForRecurring( + GracePeriodStatus type, + String domainRepoId, + DateTime expirationTime, + String clientId, + VKey billingEventRecurring, + @Nullable Long gracePeriodId) { + checkArgumentNotNull(billingEventRecurring, "billingEventRecurring cannot be null"); + return createInternal( + type, domainRepoId, expirationTime, clientId, null, billingEventRecurring, gracePeriodId); } /** Creates a GracePeriod with no billing event. */ public static GracePeriod createWithoutBillingEvent( GracePeriodStatus type, String domainRepoId, DateTime expirationTime, String clientId) { - return createInternal(type, domainRepoId, expirationTime, clientId, null, null); + return createInternal(type, domainRepoId, expirationTime, clientId, null, null, null); } /** Constructs a GracePeriod of the given type from the provided one-time BillingEvent. */ @@ -119,7 +175,6 @@ public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntit */ public GracePeriod cloneAfterOfyLoad(String domainRepoId) { GracePeriod clone = clone(this); - clone.id = ObjectifyService.allocateId(); clone.domainRepoId = checkArgumentNotNull(domainRepoId); clone.restoreHistoryIds(); return clone; @@ -136,4 +191,49 @@ public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntit clone.billingEventRecurring = recurring; return clone; } + + /** + * Returns a clone of this {@link GracePeriod} with prepopulated {@link #gracePeriodId} generated + * by {@link ObjectifyService#allocateId()}. + * + *

TODO(shicong): Figure out how to generate the id only when the entity is used for Cloud SQL. + */ + @VisibleForTesting + public GracePeriod cloneWithPrepopulatedId() { + GracePeriod clone = clone(this); + clone.gracePeriodId = ObjectifyService.allocateId(); + return clone; + } + + /** Entity class to represent a historic {@link GracePeriod}. */ + @Entity(name = "GracePeriodHistory") + @Table(indexes = @Index(columnList = "domainRepoId")) + static class GracePeriodHistory extends GracePeriodBase { + @Id Long gracePeriodHistoryRevisionId; + + /** ID for the associated {@link DomainHistory} entity. */ + Long domainHistoryRevisionId; + + @Override + @Access(AccessType.PROPERTY) + public long getGracePeriodId() { + return super.getGracePeriodId(); + } + + static GracePeriodHistory createFrom(long historyRevisionId, GracePeriod gracePeriod) { + GracePeriodHistory instance = new GracePeriodHistory(); + instance.gracePeriodHistoryRevisionId = ObjectifyService.allocateId(); + instance.domainHistoryRevisionId = historyRevisionId; + instance.gracePeriodId = gracePeriod.gracePeriodId; + instance.type = gracePeriod.type; + instance.domainRepoId = gracePeriod.domainRepoId; + instance.expirationTime = gracePeriod.expirationTime; + instance.clientId = gracePeriod.clientId; + instance.billingEventOneTime = gracePeriod.billingEventOneTime; + instance.billingEventOneTimeHistoryId = gracePeriod.billingEventOneTimeHistoryId; + instance.billingEventRecurring = gracePeriod.billingEventRecurring; + instance.billingEventRecurringHistoryId = gracePeriod.billingEventRecurringHistoryId; + return instance; + } + } } diff --git a/core/src/main/java/google/registry/model/domain/GracePeriodBase.java b/core/src/main/java/google/registry/model/domain/GracePeriodBase.java index 64f1ede7f..c90aef084 100644 --- a/core/src/main/java/google/registry/model/domain/GracePeriodBase.java +++ b/core/src/main/java/google/registry/model/domain/GracePeriodBase.java @@ -26,21 +26,23 @@ import google.registry.persistence.VKey; import java.lang.reflect.Field; import java.util.LinkedHashMap; import java.util.Map; +import javax.persistence.Access; +import javax.persistence.AccessType; import javax.persistence.Column; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.MappedSuperclass; +import javax.persistence.Transient; import org.joda.time.DateTime; /** Base class containing common fields and methods for {@link GracePeriod}. */ @Embed @MappedSuperclass +@Access(AccessType.FIELD) public class GracePeriodBase extends ImmutableObject { /** Unique id required for hibernate representation. */ - @javax.persistence.Id - @Ignore - Long id; + @Transient Long gracePeriodId; /** Repository id for the domain which this grace period belongs to. */ @Ignore @@ -85,8 +87,8 @@ public class GracePeriodBase extends ImmutableObject { @Column(name = "billing_recurrence_history_id") Long billingEventRecurringHistoryId; - public long getId() { - return id; + public long getGracePeriodId() { + return gracePeriodId; } public GracePeriodStatus getType() { @@ -105,6 +107,12 @@ public class GracePeriodBase extends ImmutableObject { return clientId; } + /** This method is private because it is only used by Hibernate. */ + @SuppressWarnings("unused") + private void setGracePeriodId(long gracePeriodId) { + this.gracePeriodId = gracePeriodId; + } + /** Returns true if this GracePeriod has an associated BillingEvent; i.e. if it's refundable. */ public boolean hasBillingEvent() { return billingEventOneTime != null || billingEventRecurring != null; diff --git a/core/src/main/resources/META-INF/persistence.xml b/core/src/main/resources/META-INF/persistence.xml index 08ad1e9b1..5ee4ec96f 100644 --- a/core/src/main/resources/META-INF/persistence.xml +++ b/core/src/main/resources/META-INF/persistence.xml @@ -46,6 +46,7 @@ google.registry.model.domain.DomainBase google.registry.model.domain.DomainHistory google.registry.model.domain.GracePeriod + google.registry.model.domain.GracePeriod$GracePeriodHistory google.registry.model.domain.secdns.DelegationSignerData google.registry.model.domain.secdns.DomainDsDataHistory google.registry.model.domain.token.AllocationToken diff --git a/core/src/test/java/google/registry/flows/EppLifecycleDomainTest.java b/core/src/test/java/google/registry/flows/EppLifecycleDomainTest.java index 756833072..e373504c8 100644 --- a/core/src/test/java/google/registry/flows/EppLifecycleDomainTest.java +++ b/core/src/test/java/google/registry/flows/EppLifecycleDomainTest.java @@ -805,7 +805,7 @@ class EppLifecycleDomainTest extends EppTestCase { // As the losing registrar, read the request poll message, and then ack it. assertThatLoginSucceeds("NewRegistrar", "foo-BAR2"); - String messageId = "1-C-EXAMPLE-20-26-2001"; + String messageId = "1-C-EXAMPLE-18-24-2001"; assertThatCommand("poll.xml") .atTime("2001-01-01T00:01:00Z") .hasResponse("poll_response_domain_transfer_request.xml", ImmutableMap.of("ID", messageId)); @@ -814,7 +814,7 @@ class EppLifecycleDomainTest extends EppTestCase { .hasResponse("poll_ack_response_empty.xml"); // Five days in the future, expect a server approval poll message to the loser, and ack it. - messageId = "1-C-EXAMPLE-20-25-2001"; + messageId = "1-C-EXAMPLE-18-23-2001"; assertThatCommand("poll.xml") .atTime("2001-01-06T00:01:00Z") .hasResponse( @@ -826,7 +826,7 @@ class EppLifecycleDomainTest extends EppTestCase { assertThatLogoutSucceeds(); // Also expect a server approval poll message to the winner, with the transfer request trid. - messageId = "1-C-EXAMPLE-20-24-2001"; + messageId = "1-C-EXAMPLE-18-22-2001"; assertThatLoginSucceeds("TheRegistrar", "password2"); assertThatCommand("poll.xml") .atTime("2001-01-06T00:02:00Z") diff --git a/core/src/test/java/google/registry/flows/FlowTestCase.java b/core/src/test/java/google/registry/flows/FlowTestCase.java index db717530c..f110289a9 100644 --- a/core/src/test/java/google/registry/flows/FlowTestCase.java +++ b/core/src/test/java/google/registry/flows/FlowTestCase.java @@ -183,7 +183,8 @@ public abstract class FlowTestCase { entry.getKey().getDomainRepoId(), entry.getKey().getExpirationTime(), entry.getKey().getClientId(), - null), + null, + 1L), stripBillingEventId(entry.getValue())); } return builder.build(); diff --git a/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java index c4e3a6a89..3c3914757 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java @@ -436,7 +436,8 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase filterFields( - ImmutableObject original, String... ignoredFields) { + public static Map filterFields(ImmutableObject original, String... ignoredFields) { ImmutableSet ignoredFieldSet = ImmutableSet.copyOf(ignoredFields); Map originalFields = ModelUtils.getFieldValues(original); // don't use ImmutableMap or a stream->collect model since we can have nulls 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 aed19355b..b231950c6 100644 --- a/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java +++ b/core/src/test/java/google/registry/model/domain/DomainBaseSqlTest.java @@ -24,7 +24,6 @@ import static google.registry.util.DateTimeUtils.END_OF_TIME; import static google.registry.util.DateTimeUtils.START_OF_TIME; import static org.joda.money.CurrencyUnit.USD; import static org.joda.time.DateTimeZone.UTC; -import static org.junit.jupiter.api.Assertions.fail; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; @@ -118,7 +117,8 @@ public class DomainBaseSqlTest { LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setSmdId("smdid") .addGracePeriod( - GracePeriod.create(GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null)) + GracePeriod.create( + GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null, 100L)) .build(); host = @@ -240,7 +240,12 @@ public class DomainBaseSqlTest { .asBuilder() .addGracePeriod( GracePeriod.create( - GracePeriodStatus.RENEW, "4-COM", END_OF_TIME, "registrar1", null)) + GracePeriodStatus.RENEW, + "4-COM", + END_OF_TIME, + "registrar1", + null, + 200L)) .build(); jpaTm().put(modified); }); @@ -249,38 +254,12 @@ public class DomainBaseSqlTest { .transact( () -> { DomainBase persisted = jpaTm().load(domain.createVKey()); - assertThat(persisted.getGracePeriods().size()).isEqualTo(2); - persisted - .getGracePeriods() - .forEach( - gracePeriod -> { - assertThat(gracePeriod.id).isNotNull(); - if (gracePeriod.getType() == GracePeriodStatus.ADD) { - assertAboutImmutableObjects() - .that(gracePeriod) - .isEqualExceptFields( - GracePeriod.create( - GracePeriodStatus.ADD, - "4-COM", - END_OF_TIME, - "registrar1", - null), - "id"); - } else if (gracePeriod.getType() == GracePeriodStatus.RENEW) { - assertAboutImmutableObjects() - .that(gracePeriod) - .isEqualExceptFields( - GracePeriod.create( - GracePeriodStatus.RENEW, - "4-COM", - END_OF_TIME, - "registrar1", - null), - "id"); - } else { - fail("Unexpected GracePeriod: " + gracePeriod); - } - }); + assertThat(persisted.getGracePeriods()) + .containsExactly( + GracePeriod.create( + GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null, 100L), + GracePeriod.create( + GracePeriodStatus.RENEW, "4-COM", END_OF_TIME, "registrar1", null, 200L)); assertEqualDomainExcept(persisted, "gracePeriods"); }); @@ -327,7 +306,12 @@ public class DomainBaseSqlTest { .asBuilder() .addGracePeriod( GracePeriod.create( - GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null)) + GracePeriodStatus.ADD, + "4-COM", + END_OF_TIME, + "registrar1", + null, + 100L)) .build(); jpaTm().put(modified); }); @@ -336,13 +320,10 @@ public class DomainBaseSqlTest { .transact( () -> { DomainBase persisted = jpaTm().load(domain.createVKey()); - assertThat(persisted.getGracePeriods().size()).isEqualTo(1); - assertAboutImmutableObjects() - .that(persisted.getGracePeriods().iterator().next()) - .isEqualExceptFields( + assertThat(persisted.getGracePeriods()) + .containsExactly( GracePeriod.create( - GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null), - "id"); + GracePeriodStatus.ADD, "4-COM", END_OF_TIME, "registrar1", null, 100L)); assertEqualDomainExcept(persisted, "gracePeriods"); }); } diff --git a/core/src/test/java/google/registry/model/domain/DomainBaseTest.java b/core/src/test/java/google/registry/model/domain/DomainBaseTest.java index f93b720fc..90b341277 100644 --- a/core/src/test/java/google/registry/model/domain/DomainBaseTest.java +++ b/core/src/test/java/google/registry/model/domain/DomainBaseTest.java @@ -413,7 +413,8 @@ public class DomainBaseTest extends EntityTestCase { .plusDays(1) .plus(Registry.get("com").getTransferGracePeriodLength()), "winner", - transferBillingEvent.createVKey())); + transferBillingEvent.createVKey(), + afterTransfer.getGracePeriods().iterator().next().getGracePeriodId())); // If we project after the grace period expires all should be the same except the grace period. DomainBase afterGracePeriod = domain.cloneProjectedAtTime( @@ -653,7 +654,8 @@ public class DomainBaseTest extends EntityTestCase { .plusYears(2) .plus(Registry.get("com").getAutoRenewGracePeriodLength()), renewedThreeTimes.getCurrentSponsorClientId(), - renewedThreeTimes.autorenewBillingEvent)); + renewedThreeTimes.autorenewBillingEvent, + renewedThreeTimes.getGracePeriods().iterator().next().getGracePeriodId())); } @Test 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 fb554e81e..eda01d41a 100644 --- a/core/src/test/java/google/registry/model/history/DomainHistoryTest.java +++ b/core/src/test/java/google/registry/model/history/DomainHistoryTest.java @@ -24,6 +24,7 @@ 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.util.DateTimeUtils.END_OF_TIME; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableSet; @@ -33,7 +34,9 @@ import google.registry.model.contact.ContactResource; import google.registry.model.domain.DomainBase; import google.registry.model.domain.DomainContent; import google.registry.model.domain.DomainHistory; +import google.registry.model.domain.GracePeriod; import google.registry.model.domain.Period; +import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.eppcommon.Trid; import google.registry.model.host.HostResource; @@ -55,7 +58,7 @@ public class DomainHistoryTest extends EntityTestCase { @TestSqlOnly void testPersistence() { - DomainBase domain = createDomainWithContactsAndHosts(); + DomainBase domain = addGracePeriodForSql(createDomainWithContactsAndHosts()); DomainHistory domainHistory = createDomainHistory(domain); jpaTm().transact(() -> jpaTm().insert(domainHistory)); @@ -70,7 +73,7 @@ public class DomainHistoryTest extends EntityTestCase { @TestSqlOnly void testLegacyPersistence_nullResource() { - DomainBase domain = createDomainWithContactsAndHosts(); + DomainBase domain = addGracePeriodForSql(createDomainWithContactsAndHosts()); DomainHistory domainHistory = createDomainHistory(domain).asBuilder().setDomainContent(null).build(); jpaTm().transact(() -> jpaTm().insert(domainHistory)); @@ -146,6 +149,17 @@ public class DomainHistoryTest extends EntityTestCase { return domain; } + private static DomainBase addGracePeriodForSql(DomainBase domainBase) { + return domainBase + .asBuilder() + .setGracePeriods( + ImmutableSet.of( + GracePeriod.create( + GracePeriodStatus.ADD, "domainRepoId", END_OF_TIME, "clientId", null) + .cloneWithPrepopulatedId())) + .build(); + } + static void assertDomainHistoriesEqual(DomainHistory one, DomainHistory two) { assertAboutImmutableObjects() .that(one) 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 f57e63627..10c2a5bc1 100644 --- a/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java +++ b/core/src/test/java/google/registry/model/history/LegacyHistoryObjectTest.java @@ -118,7 +118,12 @@ public class LegacyHistoryObjectTest extends EntityTestCase { assertAboutImmutableObjects() .that(legacyHistoryEntry) .isEqualExceptFields( - fromObjectify, "domainContent", "domainRepoId", "nsHosts", "dsDataHistories"); + fromObjectify, + "domainContent", + "domainRepoId", + "nsHosts", + "dsDataHistories", + "gracePeriodHistories"); assertThat(fromObjectify instanceof DomainHistory).isTrue(); DomainHistory legacyDomainHistory = (DomainHistory) fromObjectify; @@ -136,7 +141,8 @@ public class LegacyHistoryObjectTest extends EntityTestCase { "domainTransactionRecords", "otherClientId", "nsHosts", - "dsDataHistories"); + "dsDataHistories", + "gracePeriodHistories"); assertThat(nullToEmpty(legacyDomainHistory.getNsHosts())) .isEqualTo(nullToEmpty(legacyHistoryFromSql.getNsHosts())); } diff --git a/core/src/test/java/google/registry/tools/DedupeRecurringBillingEventIdsCommandTest.java b/core/src/test/java/google/registry/tools/DedupeRecurringBillingEventIdsCommandTest.java index 2770c9e7c..54abb456a 100644 --- a/core/src/test/java/google/registry/tools/DedupeRecurringBillingEventIdsCommandTest.java +++ b/core/src/test/java/google/registry/tools/DedupeRecurringBillingEventIdsCommandTest.java @@ -124,19 +124,19 @@ class DedupeRecurringBillingEventIdsCommandTest @Test void testResaveAssociatedDomainAndOneTimeBillingEventCorrectly() throws Exception { assertThat(recurring1.getId()).isEqualTo(recurring2.getId()); + GracePeriod gracePeriod = + GracePeriod.createForRecurring( + GracePeriodStatus.AUTO_RENEW, + domain1.getRepoId(), + now.plusDays(45), + "a registrar", + recurring1.createVKey()); domain1 = persistResource( domain1 .asBuilder() .setAutorenewBillingEvent(recurring1.createVKey()) - .setGracePeriods( - ImmutableSet.of( - GracePeriod.createForRecurring( - GracePeriodStatus.AUTO_RENEW, - domain1.getRepoId(), - now.plusDays(45), - "a registrar", - recurring1.createVKey()))) + .setGracePeriods(ImmutableSet.of(gracePeriod)) .setTransferData( new DomainTransferData.Builder() .setServerApproveAutorenewEvent(recurring1.createVKey()) @@ -201,7 +201,8 @@ class DedupeRecurringBillingEventIdsCommandTest domain1.getRepoId(), now.plusDays(45), "a registrar", - newRecurring.createVKey())); + newRecurring.createVKey(), + gracePeriod.getGracePeriodId())); assertThat(persistedDomain.getTransferData().getServerApproveAutorenewEvent()) .isEqualTo(newRecurring.createVKey()); assertThat(persistedDomain.getTransferData().getServerApproveEntities()) diff --git a/core/src/test/java/google/registry/tools/EppLifecycleToolsTest.java b/core/src/test/java/google/registry/tools/EppLifecycleToolsTest.java index ddfc50d2d..fc5c5a190 100644 --- a/core/src/test/java/google/registry/tools/EppLifecycleToolsTest.java +++ b/core/src/test/java/google/registry/tools/EppLifecycleToolsTest.java @@ -108,7 +108,7 @@ class EppLifecycleToolsTest extends EppTestCase { .atTime("2001-06-08T00:00:00Z") .hasResponse("poll_response_unrenew.xml"); - assertThatCommand("poll_ack.xml", ImmutableMap.of("ID", "1-8-TLD-23-24-2001")) + assertThatCommand("poll_ack.xml", ImmutableMap.of("ID", "1-8-TLD-19-20-2001")) .atTime("2001-06-08T00:00:01Z") .hasResponse("poll_ack_response_empty.xml"); @@ -129,7 +129,7 @@ class EppLifecycleToolsTest extends EppTestCase { .hasResponse( "poll_response_autorenew.xml", ImmutableMap.of( - "ID", "1-8-TLD-23-26-2003", + "ID", "1-8-TLD-19-22-2003", "QDATE", "2003-06-01T00:02:00Z", "DOMAIN", "example.tld", "EXDATE", "2004-06-01T00:02:00Z")); diff --git a/core/src/test/resources/google/registry/flows/poll_response_unrenew.xml b/core/src/test/resources/google/registry/flows/poll_response_unrenew.xml index 112faf222..1591feaf3 100644 --- a/core/src/test/resources/google/registry/flows/poll_response_unrenew.xml +++ b/core/src/test/resources/google/registry/flows/poll_response_unrenew.xml @@ -3,7 +3,7 @@ Command completed successfully; ack to dequeue - + 2001-06-07T00:00:00Z Domain example.tld was unrenewed by 3 years; now expires at 2003-06-01T00:02:00.000Z. diff --git a/core/src/test/resources/google/registry/model/schema.txt b/core/src/test/resources/google/registry/model/schema.txt index f03f1a014..f91693edb 100644 --- a/core/src/test/resources/google/registry/model/schema.txt +++ b/core/src/test/resources/google/registry/model/schema.txt @@ -273,6 +273,7 @@ class google.registry.model.domain.DomainHistory { java.lang.String clientId; java.lang.String otherClientId; java.lang.String reason; + java.util.Set gracePeriodHistories; java.util.Set dsDataHistories; java.util.Set domainTransactionRecords; org.joda.time.DateTime modificationTime; @@ -281,6 +282,17 @@ class google.registry.model.domain.GracePeriod { google.registry.model.domain.rgp.GracePeriodStatus type; google.registry.persistence.VKey billingEventOneTime; google.registry.persistence.VKey billingEventRecurring; + java.lang.Long gracePeriodId; + java.lang.String clientId; + org.joda.time.DateTime expirationTime; +} +class google.registry.model.domain.GracePeriod$GracePeriodHistory { + google.registry.model.domain.rgp.GracePeriodStatus type; + google.registry.persistence.VKey billingEventOneTime; + google.registry.persistence.VKey billingEventRecurring; + java.lang.Long domainHistoryRevisionId; + java.lang.Long gracePeriodHistoryRevisionId; + java.lang.Long gracePeriodId; java.lang.String clientId; org.joda.time.DateTime expirationTime; } 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 f2f266712..8ee39313c 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,2868 +261,2930 @@ td.section { generated on - 2020-11-10 19:44:25.39289 + 2020-11-12 02:22:52.212444 last flyway file - V74__sql_replay_checkpoint.sql + V75__add_grace_period_history.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2020-11-10 19:44:25.39289 + + 2020-11-12 02:22:52.212444 - + allocationtoken_a08ccbef - - + + public.AllocationToken - - + + [table] - + token - + - + text not null - + domain_name - + - + text - + 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 - + - + text - + billing_time - + - + timestamptz - + cancellation_matching_billing_recurrence_id - + - + int8 - + synthetic_creation_time - + - + timestamptz - + 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 - + billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_billing_event_cancellation_matching_billing_recurrence_id 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->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_event_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 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 + + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - - fk_domain_transfer_gaining_registrar_id + + + + + + + + + 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 - + tld_f1fa57e2 - - + + public.Tld - - + + [table] - + tld_name - + - + text not null - + - + domain_6c51cffa:w->tld_f1fa57e2:e - - - - - - - - + + + + + + + + fk_domain_tld graceperiod_cd3b2e8f - - + + public.GracePeriod - - + + [table] - - id + + grace_period_id - + - + int8 not null - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + registrar_id - + - + text not null - + 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 + + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - - fk_contact_transfer_gaining_registrar_id + + + + + + + + + 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->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history - + 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 - + 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_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 - - 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_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] - + id - + - + bigserial not null - + - + auto-incremented - + 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 + + + graceperiodhistory_40ccc1f1 + + + public.GracePeriodHistory + + + + [table] + + + grace_period_history_revision_id + + + + + int8 not null + + + domain_repo_id + + + + + text not null + + + domain_history_revision_id + + + + + int8 + + + + + graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e + + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 + + + + graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e + + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 + - + 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 - + serversecret_6cc90f09 - - + + public.ServerSecret - - + + [table] - + secret - + - + uuid not null - + - + 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 - + sqlreplaycheckpoint_342081b3 - - + + public.SqlReplayCheckpoint - - + + [table] - + revision_id - + - + int8 not null - + - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + certificate_revocations - + - + text not null - + update_timestamp - + - + timestamptz not null - + url - + - + text not null - + - + transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + @@ -4896,6 +4958,23 @@ td.section {
+
+ fk7w3cx8d55q8bln80e716tr7b8 + [foreign key, with no action] +
+
+ + domain_repo_id ←(0..many) public.GracePeriodHistory.domain_repo_id + +
+
+ + history_revision_id ←(0..many) public.GracePeriodHistory.domain_history_revision_id + +
+
+ +
fk_poll_message_domain_history [foreign key, with no action] @@ -5091,7 +5170,7 @@ td.section {
-
id + grace_period_id int8 not null @@ -5129,7 +5208,7 @@ td.section { - id + grace_period_id @@ -5189,6 +5268,69 @@ td.section {

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
public.GracePeriodHistory [table] +
grace_period_history_revision_idint8 not null
domain_repo_idtext not null
domain_history_revision_idint8
Primary Key
GracePeriodHistory_pkey[primary key]
grace_period_history_revision_id
Foreign Keys
fk7w3cx8d55q8bln80e716tr7b8[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
+

 

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 ca9f0da2b..3e63ad727 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,5430 +261,5556 @@ td.section { - + - +
public.Host [table]
generated on2020-11-10 19:44:23.4570572020-11-12 02:22:50.323783
last flyway fileV74__sql_replay_checkpoint.sqlV75__add_grace_period_history.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2020-11-10 19:44:23.457057 + + 2020-11-12 02:22:50.323783 - + 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 - + 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 - + - + 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 - + 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 - + billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_billing_event_cancellation_matching_billing_recurrence_id domainhistory_a54cc226 - - + + public.DomainHistory - - + + [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 - + 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 - + allowed_tlds - + - + _text - + billing_account_map - + - + "hstore" - + billing_identifier - + - + int8 - + block_premium_names - + - + bool not null - + client_certificate - + - + text - + client_certificate_hash - + - + text - + 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->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_event_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 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 + + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - - fk_domain_transfer_gaining_registrar_id + + + + + + + + + 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 - + 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 - + - + domain_6c51cffa:w->tld_f1fa57e2:e - - - - - - - - + + + + + + + + fk_domain_tld graceperiod_cd3b2e8f - - + + public.GracePeriod - - + + [table] - - id + + grace_period_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->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 + + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - - fk_contact_transfer_gaining_registrar_id + + + + + + + + + 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->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history - + 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_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 - - 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_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] - + 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 - + 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 + + + graceperiodhistory_40ccc1f1 + + + public.GracePeriodHistory + + + + [table] + + + grace_period_history_revision_id + + + + + int8 not null + + + billing_event_id + + + + + int8 + + + billing_event_history_id + + + + + int8 + + + billing_recurrence_id + + + + + int8 + + + billing_recurrence_history_id + + + + + int8 + + + registrar_id + + + + + text not null + + + domain_repo_id + + + + + text not null + + + expiration_time + + + + + timestamptz not null + + + type + + + + + text not null + + + domain_history_revision_id + + + + + int8 + + + grace_period_id + + + + + int8 not null + + + + + graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e + + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 + + + + graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e + + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 + - + 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 @@ -5808,465 +5934,465 @@ td.section { - + 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 - + serversecret_6cc90f09 - - + + public.ServerSecret - - + + [table] - + secret - + - + uuid not null - + - + 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 - + sqlreplaycheckpoint_342081b3 - - + + public.SqlReplayCheckpoint - - + + [table] - + revision_id - + - + int8 not null - + last_replay_time - + - + timestamptz not null - + - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + certificate_revocations - + - + text not null - + update_timestamp - + - + timestamptz not null - + url - + - + text not null - + - + transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + contents - + - + bytea - + @@ -9754,6 +9880,23 @@ td.section {
+
+ fk7w3cx8d55q8bln80e716tr7b8 + [foreign key, with no action] +
+
+ + domain_repo_id ←(0..many) public.GracePeriodHistory.domain_repo_id + +
+
+ + history_revision_id ←(0..many) public.GracePeriodHistory.domain_history_revision_id + +
+
+ +
fk_poll_message_domain_history [foreign key, with no action] @@ -10058,7 +10201,7 @@ td.section {
-
id + grace_period_id int8 not null @@ -10116,7 +10259,7 @@ td.section { - id + grace_period_id @@ -10188,7 +10331,7 @@ td.section { - id + grace_period_id ascending @@ -10206,6 +10349,139 @@ td.section {

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
public.GracePeriodHistory [table] +
grace_period_history_revision_idint8 not null
billing_event_idint8
billing_event_history_idint8
billing_recurrence_idint8
billing_recurrence_history_idint8
registrar_idtext not null
domain_repo_idtext not null
expiration_timetimestamptz not null
typetext not null
domain_history_revision_idint8
grace_period_idint8 not null
Primary Key
GracePeriodHistory_pkey[primary key]
grace_period_history_revision_id
Foreign Keys
fk7w3cx8d55q8bln80e716tr7b8[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
GracePeriodHistory_pkey[unique index]
grace_period_history_revision_idascending
idxd01j17vrpjxaerxdmn8bwxs7s[non-unique index]
domain_repo_idascending
+

 

diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index e20235b3d..c830604b9 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -72,3 +72,4 @@ V71__create_kms_secret.sql V72__add_missing_foreign_keys.sql V73__singleton_entities.sql V74__sql_replay_checkpoint.sql +V75__add_grace_period_history.sql diff --git a/db/src/main/resources/sql/flyway/V75__add_grace_period_history.sql b/db/src/main/resources/sql/flyway/V75__add_grace_period_history.sql new file mode 100644 index 000000000..f152b44ab --- /dev/null +++ b/db/src/main/resources/sql/flyway/V75__add_grace_period_history.sql @@ -0,0 +1,37 @@ +-- 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 "GracePeriod" rename column "id" to "grace_period_id"; + +create table "GracePeriodHistory" ( + grace_period_history_revision_id int8 not null, + billing_event_id int8, + billing_event_history_id int8, + billing_recurrence_id int8, + billing_recurrence_history_id int8, + registrar_id text not null, + domain_repo_id text not null, + expiration_time timestamptz not null, + type text not null, + domain_history_revision_id int8, + grace_period_id int8 not null, + primary key (grace_period_history_revision_id) +); + +alter table if exists "GracePeriodHistory" + add constraint FK7w3cx8d55q8bln80e716tr7b8 + foreign key (domain_repo_id, domain_history_revision_id) + references "DomainHistory"; + +create index IDXd01j17vrpjxaerxdmn8bwxs7s on "GracePeriodHistory" (domain_repo_id); 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 6fa05a019..df5e373f2 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -394,7 +394,7 @@ ); create table "GracePeriod" ( - id int8 not null, + grace_period_id int8 not null, billing_event_id int8, billing_event_history_id int8, billing_recurrence_id int8, @@ -403,7 +403,22 @@ domain_repo_id text not null, expiration_time timestamptz not null, type text not null, - primary key (id) + primary key (grace_period_id) + ); + + create table "GracePeriodHistory" ( + grace_period_history_revision_id int8 not null, + billing_event_id int8, + billing_event_history_id int8, + billing_recurrence_id int8, + billing_recurrence_history_id int8, + registrar_id text not null, + domain_repo_id text not null, + expiration_time timestamptz not null, + type text not null, + domain_history_revision_id int8, + grace_period_id int8 not null, + primary key (grace_period_history_revision_id) ); create table "Host" ( @@ -749,6 +764,7 @@ create index IDXaro1omfuaxjwmotk3vo00trwm on "DomainHistory" (history_registrar_ create index IDXsu1nam10cjes9keobapn5jvxj on "DomainHistory" (history_type); create index IDX6w3qbtgce93cal2orjg1tw7b7 on "DomainHistory" (history_modification_time); create index IDXj1mtx98ndgbtb1bkekahms18w on "GracePeriod" (domain_repo_id); +create index IDXd01j17vrpjxaerxdmn8bwxs7s on "GracePeriodHistory" (domain_repo_id); create index IDXfg2nnjlujxo6cb9fha971bq2n on "HostHistory" (creation_time); create index IDX1iy7njgb7wjmj9piml4l2g0qi on "HostHistory" (history_registrar_id); create index IDXkkwbwcwvrdkkqothkiye4jiff on "HostHistory" (host_name); @@ -806,6 +822,11 @@ create index spec11threatmatch_check_date_idx on "Spec11ThreatMatch" (check_date foreign key (domain_repo_id) references "Domain"; + alter table if exists "GracePeriodHistory" + add constraint FK7w3cx8d55q8bln80e716tr7b8 + foreign key (domain_repo_id, domain_history_revision_id) + references "DomainHistory"; + alter table if exists "PremiumEntry" add constraint FKo0gw90lpo1tuee56l0nb6y6g5 foreign key (revision_id) diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 0ed172a3f..138d476a4 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -524,7 +524,7 @@ ALTER SEQUENCE public."DomainTransactionRecord_id_seq" OWNED BY public."DomainTr -- CREATE TABLE public."GracePeriod" ( - id bigint NOT NULL, + grace_period_id bigint NOT NULL, billing_event_id bigint, billing_recurrence_id bigint, registrar_id text NOT NULL, @@ -536,6 +536,25 @@ CREATE TABLE public."GracePeriod" ( ); +-- +-- Name: GracePeriodHistory; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public."GracePeriodHistory" ( + grace_period_history_revision_id bigint NOT NULL, + billing_event_id bigint, + billing_event_history_id bigint, + billing_recurrence_id bigint, + billing_recurrence_history_id bigint, + registrar_id text NOT NULL, + domain_repo_id text NOT NULL, + expiration_time timestamp with time zone NOT NULL, + type text NOT NULL, + domain_history_revision_id bigint, + grace_period_id bigint NOT NULL +); + + -- -- Name: Host; Type: TABLE; Schema: public; Owner: - -- @@ -1212,12 +1231,20 @@ ALTER TABLE ONLY public."Domain" ADD CONSTRAINT "Domain_pkey" PRIMARY KEY (repo_id); +-- +-- Name: GracePeriodHistory GracePeriodHistory_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."GracePeriodHistory" + ADD CONSTRAINT "GracePeriodHistory_pkey" PRIMARY KEY (grace_period_history_revision_id); + + -- -- Name: GracePeriod GracePeriod_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public."GracePeriod" - ADD CONSTRAINT "GracePeriod_pkey" PRIMARY KEY (id); + ADD CONSTRAINT "GracePeriod_pkey" PRIMARY KEY (grace_period_id); -- @@ -1536,6 +1563,13 @@ CREATE INDEX idxaydgox62uno9qx8cjlj5lauye ON public."PollMessage" USING btree (e CREATE INDEX idxbn8t4wp85fgxjl8q4ctlscx55 ON public."Contact" USING btree (current_sponsor_registrar_id); +-- +-- Name: idxd01j17vrpjxaerxdmn8bwxs7s; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX idxd01j17vrpjxaerxdmn8bwxs7s ON public."GracePeriodHistory" USING btree (domain_repo_id); + + -- -- Name: idxe7wu46c7wpvfmfnj4565abibp; Type: INDEX; Schema: public; Owner: - -- @@ -1816,6 +1850,14 @@ ALTER TABLE ONLY public."ClaimsEntry" ADD CONSTRAINT fk6sc6at5hedffc0nhdcab6ivuq FOREIGN KEY (revision_id) REFERENCES public."ClaimsList"(revision_id); +-- +-- Name: GracePeriodHistory fk7w3cx8d55q8bln80e716tr7b8; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."GracePeriodHistory" + ADD CONSTRAINT fk7w3cx8d55q8bln80e716tr7b8 FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id); + + -- -- Name: Contact fk93c185fx7chn68uv7nl6uv2s0; Type: FK CONSTRAINT; Schema: public; Owner: - --
public.Host [table]