diff --git a/core/src/main/java/google/registry/flows/contact/ContactTransferApproveFlow.java b/core/src/main/java/google/registry/flows/contact/ContactTransferApproveFlow.java index d6d8c8e63..affdf9836 100644 --- a/core/src/main/java/google/registry/flows/contact/ContactTransferApproveFlow.java +++ b/core/src/main/java/google/registry/flows/contact/ContactTransferApproveFlow.java @@ -22,9 +22,9 @@ import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership; import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage; import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse; import static google.registry.model.ResourceTransferUtils.approvePendingTransfer; -import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; import google.registry.flows.EppException; import google.registry.flows.ExtensionManager; @@ -94,7 +94,8 @@ public final class ContactTransferApproveFlow implements TransactionalFlow { // Create a poll message for the gaining client. PollMessage gainingPollMessage = createGainingTransferPollMessage(targetId, newContact.getTransferData(), historyEntry); - ofy().save().entities(newContact, historyEntry, gainingPollMessage); + tm().insertAll(ImmutableSet.of(historyEntry.toChildHistoryEntity(), gainingPollMessage)); + tm().update(newContact); // Delete the billing event and poll messages that were written in case the transfer would have // been implicitly server approved. tm().delete(existingContact.getTransferData().getServerApproveEntities()); diff --git a/core/src/main/java/google/registry/flows/contact/ContactTransferCancelFlow.java b/core/src/main/java/google/registry/flows/contact/ContactTransferCancelFlow.java index aba875007..7824f936d 100644 --- a/core/src/main/java/google/registry/flows/contact/ContactTransferCancelFlow.java +++ b/core/src/main/java/google/registry/flows/contact/ContactTransferCancelFlow.java @@ -22,9 +22,9 @@ import static google.registry.flows.ResourceFlowUtils.verifyTransferInitiator; import static google.registry.flows.contact.ContactFlowUtils.createLosingTransferPollMessage; import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse; import static google.registry.model.ResourceTransferUtils.denyPendingTransfer; -import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; import google.registry.flows.EppException; import google.registry.flows.ExtensionManager; @@ -90,7 +90,8 @@ public final class ContactTransferCancelFlow implements TransactionalFlow { // Create a poll message for the losing client. PollMessage losingPollMessage = createLosingTransferPollMessage(targetId, newContact.getTransferData(), historyEntry); - ofy().save().entities(newContact, historyEntry, losingPollMessage); + tm().insertAll(ImmutableSet.of(historyEntry.toChildHistoryEntity(), losingPollMessage)); + tm().update(newContact); // Delete the billing event and poll messages that were written in case the transfer would have // been implicitly server approved. tm().delete(existingContact.getTransferData().getServerApproveEntities()); diff --git a/core/src/main/java/google/registry/flows/contact/ContactTransferRejectFlow.java b/core/src/main/java/google/registry/flows/contact/ContactTransferRejectFlow.java index 6b7af9fa9..52d5b288d 100644 --- a/core/src/main/java/google/registry/flows/contact/ContactTransferRejectFlow.java +++ b/core/src/main/java/google/registry/flows/contact/ContactTransferRejectFlow.java @@ -22,9 +22,9 @@ import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership; import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage; import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse; import static google.registry.model.ResourceTransferUtils.denyPendingTransfer; -import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; import google.registry.flows.EppException; import google.registry.flows.ExtensionManager; @@ -87,7 +87,8 @@ public final class ContactTransferRejectFlow implements TransactionalFlow { .build(); PollMessage gainingPollMessage = createGainingTransferPollMessage(targetId, newContact.getTransferData(), historyEntry); - ofy().save().entities(newContact, historyEntry, gainingPollMessage); + tm().insertAll(ImmutableSet.of(historyEntry.toChildHistoryEntity(), gainingPollMessage)); + tm().update(newContact); // Delete the billing event and poll messages that were written in case the transfer would have // been implicitly server approved. tm().delete(existingContact.getTransferData().getServerApproveEntities()); diff --git a/core/src/main/java/google/registry/flows/contact/ContactTransferRequestFlow.java b/core/src/main/java/google/registry/flows/contact/ContactTransferRequestFlow.java index 1f8f5b2f8..bcf4b59db 100644 --- a/core/src/main/java/google/registry/flows/contact/ContactTransferRequestFlow.java +++ b/core/src/main/java/google/registry/flows/contact/ContactTransferRequestFlow.java @@ -23,7 +23,6 @@ import static google.registry.flows.contact.ContactFlowUtils.createGainingTransf import static google.registry.flows.contact.ContactFlowUtils.createLosingTransferPollMessage; import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse; import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACTION_PENDING; -import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; import com.google.common.collect.ImmutableSet; @@ -145,12 +144,13 @@ public final class ContactTransferRequestFlow implements TransactionalFlow { .setTransferData(pendingTransferData) .addStatusValue(StatusValue.PENDING_TRANSFER) .build(); - ofy().save().entities( - newContact, - historyEntry, - requestPollMessage, - serverApproveGainingPollMessage, - serverApproveLosingPollMessage); + tm().update(newContact); + tm().insertAll( + ImmutableSet.of( + historyEntry.toChildHistoryEntity(), + requestPollMessage, + serverApproveGainingPollMessage, + serverApproveLosingPollMessage)); return responseBuilder .setResultFromCode(SUCCESS_WITH_ACTION_PENDING) .setResData(createTransferResponse(targetId, newContact.getTransferData())) diff --git a/core/src/main/java/google/registry/model/poll/PollMessage.java b/core/src/main/java/google/registry/model/poll/PollMessage.java index 40d1a19a1..fc641b76b 100644 --- a/core/src/main/java/google/registry/model/poll/PollMessage.java +++ b/core/src/main/java/google/registry/model/poll/PollMessage.java @@ -16,6 +16,7 @@ package google.registry.model.poll; import static com.google.common.collect.ImmutableList.toImmutableList; import static google.registry.util.CollectionUtils.forceEmptyToNull; +import static google.registry.util.CollectionUtils.isNullOrEmpty; import static google.registry.util.CollectionUtils.nullToEmpty; import static google.registry.util.DateTimeUtils.END_OF_TIME; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; @@ -378,6 +379,47 @@ public abstract class PollMessage extends ImmutableObject .build(); } + @Override + @OnLoad + void onLoad() { + super.onLoad(); + if (!isNullOrEmpty(contactPendingActionNotificationResponses)) { + pendingActionNotificationResponse = contactPendingActionNotificationResponses.get(0); + } + if (!isNullOrEmpty(contactTransferResponses)) { + contactId = contactTransferResponses.get(0).getContactId(); + transferResponse = contactTransferResponses.get(0); + } + } + + @Override + @PostLoad + void postLoad() { + super.postLoad(); + if (pendingActionNotificationResponse != null) { + contactPendingActionNotificationResponses = + ImmutableList.of( + ContactPendingActionNotificationResponse.create( + pendingActionNotificationResponse.nameOrId.value, + pendingActionNotificationResponse.getActionResult(), + pendingActionNotificationResponse.getTrid(), + pendingActionNotificationResponse.processedDate)); + } + if (contactId != null && transferResponse != null) { + contactTransferResponses = + ImmutableList.of( + new ContactTransferResponse.Builder() + .setContactId(contactId) + .setGainingClientId(transferResponse.getGainingClientId()) + .setLosingClientId(transferResponse.getLosingClientId()) + .setTransferStatus(transferResponse.getTransferStatus()) + .setTransferRequestTime(transferResponse.getTransferRequestTime()) + .setPendingTransferExpirationTime( + transferResponse.getPendingTransferExpirationTime()) + .build()); + } + } + /** A builder for {@link OneTime} since it is immutable. */ public static class Builder extends PollMessage.Builder { @@ -396,6 +438,10 @@ public abstract class PollMessage extends ImmutableObject .filter(ContactPendingActionNotificationResponse.class::isInstance) .map(ContactPendingActionNotificationResponse.class::cast) .collect(toImmutableList())); + if (getInstance().contactPendingActionNotificationResponses != null) { + getInstance().pendingActionNotificationResponse = + getInstance().contactPendingActionNotificationResponses.get(0); + } getInstance().contactTransferResponses = forceEmptyToNull( responseData @@ -403,6 +449,11 @@ public abstract class PollMessage extends ImmutableObject .filter(ContactTransferResponse.class::isInstance) .map(ContactTransferResponse.class::cast) .collect(toImmutableList())); + if (getInstance().contactTransferResponses != null) { + getInstance().contactId = getInstance().contactTransferResponses.get(0).getContactId(); + getInstance().transferResponse = getInstance().contactTransferResponses.get(0); + } + getInstance().domainPendingActionNotificationResponses = forceEmptyToNull( responseData diff --git a/core/src/main/java/google/registry/model/transfer/TransferData.java b/core/src/main/java/google/registry/model/transfer/TransferData.java index c17054f7e..5ca29497a 100644 --- a/core/src/main/java/google/registry/model/transfer/TransferData.java +++ b/core/src/main/java/google/registry/model/transfer/TransferData.java @@ -14,15 +14,25 @@ package google.registry.model.transfer; +import static com.google.common.collect.ImmutableList.toImmutableList; +import static google.registry.util.CollectionUtils.isNullOrEmpty; +import static google.registry.util.CollectionUtils.nullToEmpty; import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.googlecode.objectify.Key; +import com.googlecode.objectify.annotation.AlsoLoad; import com.googlecode.objectify.annotation.Ignore; import com.googlecode.objectify.annotation.IgnoreSave; import com.googlecode.objectify.condition.IfNull; import google.registry.model.Buildable; import google.registry.model.EppResource; +import google.registry.model.contact.ContactResource; +import google.registry.model.domain.DomainBase; import google.registry.model.eppcommon.Trid; +import google.registry.model.poll.PollMessage; +import google.registry.model.reporting.HistoryEntry; import google.registry.persistence.VKey; import google.registry.util.TypeUtils.TypeInstantiator; import java.util.Set; @@ -32,6 +42,7 @@ import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.MappedSuperclass; +import javax.persistence.PostLoad; import javax.persistence.Transient; /** @@ -68,15 +79,27 @@ public abstract class TransferData< @IgnoreSave(IfNull.class) Set> serverApproveEntities; - // The following 3 fields are the replacement for serverApproveEntities in Cloud SQL. - // TODO(b/177589157): Make transfer flows work with Cloud SQL. @Ignore - @Column(name = "transfer_gaining_poll_message_id") - Long gainingTransferPollMessageId; + @Column(name = "transfer_repo_id") + String repoId; @Ignore - @Column(name = "transfer_losing_poll_message_id") - Long losingTransferPollMessageId; + @Column(name = "transfer_history_entry_id") + Long historyEntryId; + + // The pollMessageId1 and pollMessageId2 are used to store the IDs for gaining and losing poll + // messages in Cloud SQL, and they are added to replace the VKeys in serverApproveEntities. + // Although we can distinguish which is which when we construct the TransferData instance from + // the transfer request flow, when the instance is loaded from Datastore, we cannot make this + // distinction because they are just VKeys. Also, the only way we use serverApproveEntities is to + // just delete all the entities referenced by the VKeys, so we don't need to make the distinction. + @Ignore + @Column(name = "transfer_poll_message_id_1") + Long pollMessageId1; + + @Ignore + @Column(name = "transfer_poll_message_id_2") + Long pollMessageId2; public abstract boolean isEmpty(); @@ -116,6 +139,83 @@ public abstract class TransferData< return newBuilder; } + void onLoad( + @AlsoLoad("serverApproveEntities") + Set> serverApproveEntities) { + mapServerApproveEntitiesToFields(serverApproveEntities, this); + } + + @PostLoad + void postLoad() { + mapFieldsToServerApproveEntities(); + } + + /** + * Reconstructs serverApproveEntities set from the individual fields, e.g. repoId, historyEntryId, + * pollMessageId1. + */ + void mapFieldsToServerApproveEntities() { + if (repoId == null) { + return; + } + Key eppKey; + if (getClass().equals(DomainBase.class)) { + eppKey = Key.create(DomainBase.class, repoId); + } else { + eppKey = Key.create(ContactResource.class, repoId); + } + Key historyEntryKey = Key.create(eppKey, HistoryEntry.class, historyEntryId); + ImmutableSet.Builder> entityKeysBuilder = + new ImmutableSet.Builder<>(); + if (pollMessageId1 != null) { + Key ofyKey = Key.create(historyEntryKey, PollMessage.class, pollMessageId1); + entityKeysBuilder.add(PollMessage.createVKey(ofyKey)); + } + if (pollMessageId2 != null) { + Key ofyKey = Key.create(historyEntryKey, PollMessage.class, pollMessageId2); + entityKeysBuilder.add(PollMessage.createVKey(ofyKey)); + } + serverApproveEntities = entityKeysBuilder.build(); + } + + /** Maps serverApproveEntities set to the individual fields. */ + static void mapServerApproveEntitiesToFields( + Set> serverApproveEntities, + TransferData transferData) { + if (isNullOrEmpty(serverApproveEntities)) { + transferData.historyEntryId = null; + transferData.repoId = null; + transferData.pollMessageId1 = null; + transferData.pollMessageId2 = null; + return; + } + // Each element in serverApproveEntities should have the exact same Key as its + // parent. So, we can use any to set historyEntryId and repoId. + Key key = serverApproveEntities.iterator().next().getOfyKey(); + transferData.historyEntryId = key.getParent().getId(); + transferData.repoId = key.getParent().getParent().getName(); + + ImmutableList sortedPollMessageIds = getSortedPollMessageIds(serverApproveEntities); + if (sortedPollMessageIds.size() >= 1) { + transferData.pollMessageId1 = sortedPollMessageIds.get(0); + } + if (sortedPollMessageIds.size() >= 2) { + transferData.pollMessageId2 = sortedPollMessageIds.get(1); + } + } + + /** + * Gets poll message IDs from the given serverApproveEntities and sorted the IDs in natural order. + */ + private static ImmutableList getSortedPollMessageIds( + Set> serverApproveEntities) { + return nullToEmpty(serverApproveEntities).stream() + .filter(vKey -> PollMessage.class.isAssignableFrom(vKey.getKind())) + .map(vKey -> (long) vKey.getSqlKey()) + .sorted() + .collect(toImmutableList()); + } + /** Builder for {@link TransferData} because it is immutable. */ public abstract static class Builder> extends BaseTransferObject.Builder { @@ -141,6 +241,7 @@ public abstract class TransferData< @Override public T build() { + mapServerApproveEntitiesToFields(getInstance().serverApproveEntities, getInstance()); return super.build(); } } diff --git a/core/src/test/java/google/registry/flows/contact/ContactTransferApproveFlowTest.java b/core/src/test/java/google/registry/flows/contact/ContactTransferApproveFlowTest.java index 0cf3d0ba3..35d00b4df 100644 --- a/core/src/test/java/google/registry/flows/contact/ContactTransferApproveFlowTest.java +++ b/core/src/test/java/google/registry/flows/contact/ContactTransferApproveFlowTest.java @@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat; import static google.registry.testing.ContactResourceSubject.assertAboutContacts; import static google.registry.testing.DatabaseHelper.assertNoBillingEvents; import static google.registry.testing.DatabaseHelper.createTld; -import static google.registry.testing.DatabaseHelper.deleteResource; import static google.registry.testing.DatabaseHelper.getOnlyPollMessage; import static google.registry.testing.DatabaseHelper.getPollMessages; import static google.registry.testing.DatabaseHelper.persistResource; @@ -41,10 +40,12 @@ import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferData; import google.registry.model.transfer.TransferResponse; import google.registry.model.transfer.TransferStatus; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link ContactTransferApproveFlow}. */ +@DualDatabaseTest class ContactTransferApproveFlowTest extends ContactTransferFlowTestCase { @@ -121,24 +122,24 @@ class ContactTransferApproveFlowTest runFlow(); } - @Test + @TestOfyAndSql void testDryRun() throws Exception { setEppInput("contact_transfer_approve.xml"); dryRunFlowAssertResponse(loadFile("contact_transfer_approve_response.xml")); } - @Test + @TestOfyAndSql void testSuccess() throws Exception { doSuccessfulTest("contact_transfer_approve.xml", "contact_transfer_approve_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_withAuthinfo() throws Exception { doSuccessfulTest("contact_transfer_approve_with_authinfo.xml", "contact_transfer_approve_response.xml"); } - @Test + @TestOfyAndSql void testFailure_badContactPassword() { // Change the contact's password so it does not match the password in the file. contact = persistResource( @@ -152,7 +153,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_neverBeenTransferred() { changeTransferStatus(null); EppException thrown = @@ -161,7 +162,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientApproved() { changeTransferStatus(TransferStatus.CLIENT_APPROVED); EppException thrown = @@ -170,7 +171,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientRejected() { changeTransferStatus(TransferStatus.CLIENT_REJECTED); EppException thrown = @@ -179,7 +180,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientCancelled() { changeTransferStatus(TransferStatus.CLIENT_CANCELLED); EppException thrown = @@ -188,7 +189,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverApproved() { changeTransferStatus(TransferStatus.SERVER_APPROVED); EppException thrown = @@ -197,7 +198,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverCancelled() { changeTransferStatus(TransferStatus.SERVER_CANCELLED); EppException thrown = @@ -206,7 +207,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_gainingClient() { setClientIdForFlow("NewRegistrar"); EppException thrown = @@ -215,7 +216,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_unrelatedClient() { setClientIdForFlow("ClientZ"); EppException thrown = @@ -224,7 +225,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_deletedContact() throws Exception { contact = persistResource( contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); @@ -236,9 +237,9 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_nonexistentContact() throws Exception { - deleteResource(contact); + persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); contact = persistResource( contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); ResourceDoesNotExistException thrown = @@ -249,7 +250,7 @@ class ContactTransferApproveFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testIcannActivityReportField_getsLogged() throws Exception { runFlow(); assertIcannReportingActivityFieldLogged("srs-cont-transfer-approve"); diff --git a/core/src/test/java/google/registry/flows/contact/ContactTransferCancelFlowTest.java b/core/src/test/java/google/registry/flows/contact/ContactTransferCancelFlowTest.java index 7f77bc02e..80718a736 100644 --- a/core/src/test/java/google/registry/flows/contact/ContactTransferCancelFlowTest.java +++ b/core/src/test/java/google/registry/flows/contact/ContactTransferCancelFlowTest.java @@ -18,7 +18,6 @@ import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; import static google.registry.testing.ContactResourceSubject.assertAboutContacts; import static google.registry.testing.DatabaseHelper.assertNoBillingEvents; -import static google.registry.testing.DatabaseHelper.deleteResource; import static google.registry.testing.DatabaseHelper.getOnlyPollMessage; import static google.registry.testing.DatabaseHelper.getPollMessages; import static google.registry.testing.DatabaseHelper.persistResource; @@ -38,10 +37,12 @@ import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferData; import google.registry.model.transfer.TransferResponse; import google.registry.model.transfer.TransferStatus; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link ContactTransferCancelFlow}. */ +@DualDatabaseTest class ContactTransferCancelFlowTest extends ContactTransferFlowTestCase { @@ -105,24 +106,24 @@ class ContactTransferCancelFlowTest runFlow(); } - @Test + @TestOfyAndSql void testDryRun() throws Exception { setEppInput("contact_transfer_cancel.xml"); dryRunFlowAssertResponse(loadFile("contact_transfer_cancel_response.xml")); } - @Test + @TestOfyAndSql void testSuccess() throws Exception { doSuccessfulTest("contact_transfer_cancel.xml", "contact_transfer_cancel_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_withAuthinfo() throws Exception { doSuccessfulTest("contact_transfer_cancel_with_authinfo.xml", "contact_transfer_cancel_response.xml"); } - @Test + @TestOfyAndSql void testFailure_badContactPassword() { // Change the contact's password so it does not match the password in the file. contact = @@ -138,7 +139,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_neverBeenTransferred() { changeTransferStatus(null); EppException thrown = @@ -147,7 +148,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientApproved() { changeTransferStatus(TransferStatus.CLIENT_APPROVED); EppException thrown = @@ -156,7 +157,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientRejected() { changeTransferStatus(TransferStatus.CLIENT_REJECTED); EppException thrown = @@ -165,7 +166,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientCancelled() { changeTransferStatus(TransferStatus.CLIENT_CANCELLED); EppException thrown = @@ -174,7 +175,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverApproved() { changeTransferStatus(TransferStatus.SERVER_APPROVED); EppException thrown = @@ -183,7 +184,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverCancelled() { changeTransferStatus(TransferStatus.SERVER_CANCELLED); EppException thrown = @@ -192,7 +193,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_sponsoringClient() { setClientIdForFlow("TheRegistrar"); EppException thrown = @@ -202,7 +203,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_unrelatedClient() { setClientIdForFlow("ClientZ"); EppException thrown = @@ -212,7 +213,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_deletedContact() throws Exception { contact = persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); @@ -224,9 +225,9 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_nonexistentContact() throws Exception { - deleteResource(contact); + persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); ResourceDoesNotExistException thrown = assertThrows( ResourceDoesNotExistException.class, @@ -235,7 +236,7 @@ class ContactTransferCancelFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testIcannActivityReportField_getsLogged() throws Exception { runFlow(); assertIcannReportingActivityFieldLogged("srs-cont-transfer-cancel"); diff --git a/core/src/test/java/google/registry/flows/contact/ContactTransferQueryFlowTest.java b/core/src/test/java/google/registry/flows/contact/ContactTransferQueryFlowTest.java index 61b51f1e9..960c9b42a 100644 --- a/core/src/test/java/google/registry/flows/contact/ContactTransferQueryFlowTest.java +++ b/core/src/test/java/google/registry/flows/contact/ContactTransferQueryFlowTest.java @@ -17,7 +17,6 @@ package google.registry.flows.contact; import static com.google.common.truth.Truth.assertThat; import static google.registry.testing.ContactResourceSubject.assertAboutContacts; import static google.registry.testing.DatabaseHelper.assertNoBillingEvents; -import static google.registry.testing.DatabaseHelper.deleteResource; import static google.registry.testing.DatabaseHelper.persistResource; import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -32,11 +31,13 @@ import google.registry.model.contact.ContactResource; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferStatus; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; import org.joda.time.DateTime; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link ContactTransferQueryFlow}. */ +@DualDatabaseTest class ContactTransferQueryFlowTest extends ContactTransferFlowTestCase { @@ -68,65 +69,65 @@ class ContactTransferQueryFlowTest runFlow(); } - @Test + @TestOfyAndSql void testSuccess() throws Exception { doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_withContactRoid() throws Exception { doSuccessfulTest("contact_transfer_query_with_roid.xml", "contact_transfer_query_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_sponsoringClient() throws Exception { setClientIdForFlow("TheRegistrar"); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_withAuthinfo() throws Exception { setClientIdForFlow("ClientZ"); doSuccessfulTest("contact_transfer_query_with_authinfo.xml", "contact_transfer_query_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_clientApproved() throws Exception { changeTransferStatus(TransferStatus.CLIENT_APPROVED); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response_client_approved.xml"); } - @Test + @TestOfyAndSql void testSuccess_clientRejected() throws Exception { changeTransferStatus(TransferStatus.CLIENT_REJECTED); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response_client_rejected.xml"); } - @Test + @TestOfyAndSql void testSuccess_clientCancelled() throws Exception { changeTransferStatus(TransferStatus.CLIENT_CANCELLED); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response_client_cancelled.xml"); } - @Test + @TestOfyAndSql void testSuccess_serverApproved() throws Exception { changeTransferStatus(TransferStatus.SERVER_APPROVED); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response_server_approved.xml"); } - @Test + @TestOfyAndSql void testSuccess_serverCancelled() throws Exception { changeTransferStatus(TransferStatus.SERVER_CANCELLED); doSuccessfulTest("contact_transfer_query.xml", "contact_transfer_query_response_server_cancelled.xml"); } - @Test + @TestOfyAndSql void testFailure_pendingDeleteContact() throws Exception { changeTransferStatus(TransferStatus.SERVER_CANCELLED); contact = persistResource( @@ -135,7 +136,7 @@ class ContactTransferQueryFlowTest "contact_transfer_query_response_server_cancelled.xml"); } - @Test + @TestOfyAndSql void testFailure_badContactPassword() { // Change the contact's password so it does not match the password in the file. contact = @@ -151,7 +152,7 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_badContactRoid() { // Set the contact to a different ROID, but don't persist it; this is just so the substitution // code above will write the wrong ROID into the file. @@ -163,7 +164,7 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_neverBeenTransferred() { changeTransferStatus(null); EppException thrown = @@ -173,7 +174,7 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_unrelatedClient() { setClientIdForFlow("ClientZ"); EppException thrown = @@ -183,7 +184,7 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_deletedContact() throws Exception { contact = persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); @@ -194,9 +195,9 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_nonexistentContact() throws Exception { - deleteResource(contact); + persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); ResourceDoesNotExistException thrown = assertThrows( ResourceDoesNotExistException.class, () -> doFailingTest("contact_transfer_query.xml")); @@ -204,7 +205,7 @@ class ContactTransferQueryFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testIcannActivityReportField_getsLogged() throws Exception { runFlow(); assertIcannReportingActivityFieldLogged("srs-cont-transfer-query"); diff --git a/core/src/test/java/google/registry/flows/contact/ContactTransferRejectFlowTest.java b/core/src/test/java/google/registry/flows/contact/ContactTransferRejectFlowTest.java index 57f6cebad..9aa96d537 100644 --- a/core/src/test/java/google/registry/flows/contact/ContactTransferRejectFlowTest.java +++ b/core/src/test/java/google/registry/flows/contact/ContactTransferRejectFlowTest.java @@ -18,7 +18,6 @@ import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; import static google.registry.testing.ContactResourceSubject.assertAboutContacts; import static google.registry.testing.DatabaseHelper.assertNoBillingEvents; -import static google.registry.testing.DatabaseHelper.deleteResource; import static google.registry.testing.DatabaseHelper.getOnlyPollMessage; import static google.registry.testing.DatabaseHelper.getPollMessages; import static google.registry.testing.DatabaseHelper.persistResource; @@ -40,10 +39,12 @@ import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferData; import google.registry.model.transfer.TransferResponse; import google.registry.model.transfer.TransferStatus; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link ContactTransferRejectFlow}. */ +@DualDatabaseTest class ContactTransferRejectFlowTest extends ContactTransferFlowTestCase { @@ -120,24 +121,24 @@ class ContactTransferRejectFlowTest runFlow(); } - @Test + @TestOfyAndSql void testDryRun() throws Exception { setEppInput("contact_transfer_reject.xml"); dryRunFlowAssertResponse(loadFile("contact_transfer_reject_response.xml")); } - @Test + @TestOfyAndSql void testSuccess() throws Exception { doSuccessfulTest("contact_transfer_reject.xml", "contact_transfer_reject_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_domainAuthInfo() throws Exception { doSuccessfulTest("contact_transfer_reject_with_authinfo.xml", "contact_transfer_reject_response.xml"); } - @Test + @TestOfyAndSql void testFailure_badPassword() { // Change the contact's password so it does not match the password in the file. contact = @@ -153,7 +154,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_neverBeenTransferred() { changeTransferStatus(null); EppException thrown = @@ -162,7 +163,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientApproved() { changeTransferStatus(TransferStatus.CLIENT_APPROVED); EppException thrown = @@ -171,7 +172,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientRejected() { changeTransferStatus(TransferStatus.CLIENT_REJECTED); EppException thrown = @@ -180,7 +181,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientCancelled() { changeTransferStatus(TransferStatus.CLIENT_CANCELLED); EppException thrown = @@ -189,7 +190,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverApproved() { changeTransferStatus(TransferStatus.SERVER_APPROVED); EppException thrown = @@ -198,7 +199,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverCancelled() { changeTransferStatus(TransferStatus.SERVER_CANCELLED); EppException thrown = @@ -207,7 +208,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_gainingClient() { setClientIdForFlow("NewRegistrar"); EppException thrown = @@ -216,7 +217,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_unrelatedClient() { setClientIdForFlow("ClientZ"); EppException thrown = @@ -225,7 +226,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_deletedContact() throws Exception { contact = persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); @@ -237,9 +238,9 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_nonexistentContact() throws Exception { - deleteResource(contact); + persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); ResourceDoesNotExistException thrown = assertThrows( ResourceDoesNotExistException.class, @@ -248,7 +249,7 @@ class ContactTransferRejectFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testIcannActivityReportField_getsLogged() throws Exception { runFlow(); assertIcannReportingActivityFieldLogged("srs-cont-transfer-reject"); diff --git a/core/src/test/java/google/registry/flows/contact/ContactTransferRequestFlowTest.java b/core/src/test/java/google/registry/flows/contact/ContactTransferRequestFlowTest.java index 28c251134..a62952693 100644 --- a/core/src/test/java/google/registry/flows/contact/ContactTransferRequestFlowTest.java +++ b/core/src/test/java/google/registry/flows/contact/ContactTransferRequestFlowTest.java @@ -20,7 +20,8 @@ import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; import static google.registry.config.RegistryConfig.getContactAutomaticTransferLength; -import static google.registry.model.ofy.ObjectifyService.ofy; +import static google.registry.persistence.transaction.TransactionManagerFactory.tm; +import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm; import static google.registry.testing.ContactResourceSubject.assertAboutContacts; import static google.registry.testing.DatabaseHelper.assertNoBillingEvents; import static google.registry.testing.DatabaseHelper.assertPollMessagesEqual; @@ -29,11 +30,11 @@ import static google.registry.testing.DatabaseHelper.getPollMessages; import static google.registry.testing.DatabaseHelper.persistActiveContact; import static google.registry.testing.DatabaseHelper.persistResource; import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions; +import static google.registry.util.CollectionUtils.forceEmptyToNull; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import com.googlecode.objectify.Key; import google.registry.flows.EppException; import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException; import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException; @@ -50,12 +51,13 @@ import google.registry.model.poll.PollMessage; import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.ContactTransferData; import google.registry.model.transfer.TransferStatus; -import google.registry.persistence.VKey; +import google.registry.testing.DualDatabaseTest; +import google.registry.testing.TestOfyAndSql; import org.joda.time.DateTime; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; /** Unit tests for {@link ContactTransferRequestFlow}. */ +@DualDatabaseTest class ContactTransferRequestFlowTest extends ContactTransferFlowTestCase { @@ -102,7 +104,8 @@ class ContactTransferRequestFlowTest .setPendingTransferExpirationTime(afterTransfer) // Make the server-approve entities field a no-op comparison; it's easier to // do this comparison separately below. - .setServerApproveEntities(contact.getTransferData().getServerApproveEntities()) + .setServerApproveEntities( + forceEmptyToNull(contact.getTransferData().getServerApproveEntities())) .build()); assertNoBillingEvents(); assertThat(getPollMessages("TheRegistrar", clock.nowUtc())).hasSize(1); @@ -126,13 +129,8 @@ class ContactTransferRequestFlowTest // poll messages, the approval notice ones for gaining and losing registrars. assertPollMessagesEqual( Iterables.filter( - ofy() - .load() - // Use toArray() to coerce the type to something keys() will accept. - .keys( - contact.getTransferData().getServerApproveEntities().stream() - .map(VKey::getOfyKey) - .toArray(Key[]::new)) + transactIfJpaTm( + () -> tm().loadByKeys(contact.getTransferData().getServerApproveEntities())) .values(), PollMessage.class), ImmutableList.of(gainingApproveMessage, losingApproveMessage)); @@ -145,18 +143,18 @@ class ContactTransferRequestFlowTest runFlow(); } - @Test + @TestOfyAndSql void testDryRun() throws Exception { setEppInput("contact_transfer_request.xml"); dryRunFlowAssertResponse(loadFile("contact_transfer_request_response.xml")); } - @Test + @TestOfyAndSql void testSuccess() throws Exception { doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testFailure_noAuthInfo() { EppException thrown = assertThrows( @@ -165,7 +163,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_badPassword() { // Change the contact's password so it does not match the password in the file. contact = @@ -181,37 +179,37 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testSuccess_clientApproved() throws Exception { changeTransferStatus(TransferStatus.CLIENT_APPROVED); doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_clientRejected() throws Exception { changeTransferStatus(TransferStatus.CLIENT_REJECTED); doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_clientCancelled() throws Exception { changeTransferStatus(TransferStatus.CLIENT_CANCELLED); doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_serverApproved() throws Exception { changeTransferStatus(TransferStatus.SERVER_APPROVED); doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testSuccess_serverCancelled() throws Exception { changeTransferStatus(TransferStatus.SERVER_CANCELLED); doSuccessfulTest("contact_transfer_request.xml", "contact_transfer_request_response.xml"); } - @Test + @TestOfyAndSql void testFailure_pending() { contact = persistResource( @@ -232,7 +230,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_sponsoringClient() { setClientIdForFlow("TheRegistrar"); EppException thrown = @@ -242,7 +240,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_deletedContact() throws Exception { contact = persistResource(contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build()); @@ -254,7 +252,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_nonexistentContact() throws Exception { deleteResource(contact); ResourceDoesNotExistException thrown = @@ -265,7 +263,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_clientTransferProhibited() { contact = persistResource( @@ -278,7 +276,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_serverTransferProhibited() { contact = persistResource( @@ -291,7 +289,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testFailure_pendingDelete() { contact = persistResource(contact.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build()); @@ -303,7 +301,7 @@ class ContactTransferRequestFlowTest assertAboutEppExceptions().that(thrown).marshalsToXml(); } - @Test + @TestOfyAndSql void testIcannActivityReportField_getsLogged() throws Exception { runFlow(); assertIcannReportingActivityFieldLogged("srs-cont-transfer-request"); diff --git a/core/src/test/java/google/registry/model/transfer/TransferDataTest.java b/core/src/test/java/google/registry/model/transfer/TransferDataTest.java index d5a62cad9..294ee4e80 100644 --- a/core/src/test/java/google/registry/model/transfer/TransferDataTest.java +++ b/core/src/test/java/google/registry/model/transfer/TransferDataTest.java @@ -54,28 +54,28 @@ public class TransferDataTest { transferBillingEventKey = VKey.create( BillingEvent.OneTime.class, - 12345, - Key.create(historyEntryKey, BillingEvent.OneTime.class, 12345)); + 12345L, + Key.create(historyEntryKey, BillingEvent.OneTime.class, 12345L)); otherServerApproveBillingEventKey = VKey.create( BillingEvent.Cancellation.class, - 2468, - Key.create(historyEntryKey, BillingEvent.Cancellation.class, 2468)); + 2468L, + Key.create(historyEntryKey, BillingEvent.Cancellation.class, 2468L)); recurringBillingEventKey = VKey.create( BillingEvent.Recurring.class, - 13579, - Key.create(historyEntryKey, BillingEvent.Recurring.class, 13579)); + 13579L, + Key.create(historyEntryKey, BillingEvent.Recurring.class, 13579L)); autorenewPollMessageKey = VKey.create( PollMessage.Autorenew.class, - 67890, - Key.create(historyEntryKey, PollMessage.Autorenew.class, 67890)); + 67890L, + Key.create(historyEntryKey, PollMessage.Autorenew.class, 67890L)); otherServerApprovePollMessageKey = VKey.create( PollMessage.OneTime.class, - 314159, - Key.create(historyEntryKey, PollMessage.OneTime.class, 314159)); + 314159L, + Key.create(historyEntryKey, PollMessage.OneTime.class, 314159L)); } @Test diff --git a/core/src/test/java/google/registry/testing/DatabaseHelper.java b/core/src/test/java/google/registry/testing/DatabaseHelper.java index a62267865..b3d177900 100644 --- a/core/src/test/java/google/registry/testing/DatabaseHelper.java +++ b/core/src/test/java/google/registry/testing/DatabaseHelper.java @@ -109,6 +109,7 @@ import google.registry.model.transfer.TransferStatus; import google.registry.persistence.VKey; import google.registry.tmch.LordnTaskUtils; import java.util.Arrays; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Set; @@ -116,7 +117,6 @@ import javax.annotation.Nullable; import org.joda.money.CurrencyUnit; import org.joda.money.Money; import org.joda.time.DateTime; -import org.joda.time.DateTimeComparator; import org.joda.time.DateTimeZone; /** Static utils for setting up test resources. */ @@ -532,11 +532,14 @@ public class DatabaseHelper { DateTime requestTime, DateTime expirationTime, DateTime now) { - HistoryEntry historyEntryContactTransfer = persistResource( - new HistoryEntry.Builder() - .setType(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST) - .setParent(contact) - .build()); + HistoryEntry historyEntryContactTransfer = + persistResource( + new HistoryEntry.Builder() + .setType(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST) + .setParent(persistResource(contact)) + .setModificationTime(now) + .build() + .toChildHistoryEntity()); return persistResource( contact .asBuilder() @@ -1115,7 +1118,8 @@ public class DatabaseHelper { historyEntry -> historyEntry.getParent().getName().equals(resource.getRepoId())) .collect(toImmutableList()); - return ImmutableList.sortedCopyOf(DateTimeComparator.getInstance(), filtered); + return ImmutableList.sortedCopyOf( + Comparator.comparing(HistoryEntry::getModificationTime), filtered); }); } 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 35bd2983a..b269f7961 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,11 +261,11 @@ td.section { generated on - 2021-01-14 16:15:22.842637 + 2021-01-21 00:11:27.19594 last flyway file - V84__add_vkey_columns_in_billing_cancellation.sql + V85__add_required_columns_in_transfer_data.sql @@ -274,19 +274,19 @@ td.section { SchemaCrawler_Diagram - + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2021-01-14 16:15:22.842637 + + 2021-01-21 00:11:27.19594 - + allocationtoken_a08ccbef 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 c8697154c..bb299a5cf 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,5462 +261,5526 @@ td.section {
generated on - 2021-01-14 16:15:20.755734 + 2021-01-21 00:11:25.41194
last flyway file - V84__add_vkey_columns_in_billing_cancellation.sql + V85__add_required_columns_in_transfer_data.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2021-01-14 16:15:20.755734 + + 2021-01-21 00:11:25.41194 - + 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_domain_repo_id - + - + text - + token_status_transitions - + - + "hstore" - + token_type - + - + text - + redemption_domain_history_id - + - + int8 - + billingevent_a57d1815 - - + + public.BillingEvent - - + + [table] - + billing_event_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + flags - + - + _text - + reason - + - + text not null - + domain_name - + - + text not null - + allocation_token - + - + 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 - + history_client_transaction_id - + - + text - + history_server_transaction_id - + - + text - + history_type - + - + text not null - + history_xml_bytes - + - + bytea - + 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 + + transfer_poll_message_id_1 - + - + int8 - - transfer_losing_poll_message_id + + transfer_poll_message_id_2 - + - + 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 - + + transfer_history_entry_id + + + + + int8 + + + transfer_repo_id + + + + + text + + 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 - + billing_event_history_id - + - + int8 - + billing_event_domain_repo_id - + - + text - + billing_recurrence_history_id - + - + int8 - + billing_recurrence_domain_repo_id - + - + text - + 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 + + transfer_poll_message_id_1 - + - + int8 - - transfer_losing_poll_message_id + + transfer_poll_message_id_2 - + - + 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 - + + transfer_history_entry_id + + + + + int8 + + + transfer_repo_id + + + + + text + + 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 + + transfer_poll_message_id_1 - + - + int8 - - transfer_losing_poll_message_id + + transfer_poll_message_id_2 - + - + 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 - + + transfer_history_entry_id + + + + + int8 + + + transfer_repo_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 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2u3srsfbei272093m3b3xwj23 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkjc0r9r5y1lfbt4gpbqw4wsuvq domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_gaining_registrar_id domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_losing_registrar_id 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] - + 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 - + billing_event_domain_repo_id - + - + text - + billing_recurrence_domain_repo_id - + - + text - + 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->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk93c185fx7chn68uv7nl6uv2s0 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkmb7tdiv85863134w1wogtxrb2 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_gaining_registrar_id contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_losing_registrar_id contacthistory_d2964f8a - - + + public.ContactHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_by_superuser - + - + bool not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_reason - + - + text - + history_requested_by_registrar - + - + bool - + history_client_transaction_id - + - + text - + history_server_transaction_id - + - + text - + history_type - + - + text not null - + history_xml_bytes - + - + bytea - + 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 + + transfer_poll_message_id_1 - + - + int8 - - transfer_losing_poll_message_id + + transfer_poll_message_id_2 - + - + 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 - + + transfer_history_entry_id + + + + + int8 + + + transfer_repo_id + + + + + text + + 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 - - + + 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 - + 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 - + history_client_transaction_id - + - + text - + history_server_transaction_id - + - + text - + history_type - + - + text not null - + history_xml_bytes - + - + bytea - + host_name - + - + text - + inet_addresses - + - + _text - + last_superordinate_change - + - + timestamptz - + last_transfer_time - + - + timestamptz - + superordinate_domain - + - + text - + creation_registrar_id - + - + text - + creation_time - + - + timestamptz - + current_sponsor_registrar_id - + - + text - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + last_epp_update_time - + - + timestamptz - + statuses - + - + _text - + host_repo_id - + - + text not null - + update_timestamp - + - + timestamptz - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_gaining_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - + + + + + + + fk_poll_message_transfer_response_losing_registrar_id cursor_6af40e8c - - + + public."Cursor" - - + + [table] - + "scope" - + - + text not null - + type - + - + text not null - + cursor_time - + - + timestamptz not null - + last_update_time - + - + timestamptz not null - + delegationsignerdata_e542a872 - - + + public.DelegationSignerData - - + + [table] - + domain_repo_id - + - + text not null - + key_tag - + - + int4 not null - + algorithm - + - + int4 not null - + digest - + - + bytea not null - + digest_type - + - + int4 not null - + delegationsignerdata_e542a872:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fktr24j9v14ph2mfuw2gsmt12kq domainhistory_a54cc226:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_domain_history_domain_repo_id domainhistory_a54cc226:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_history_registrar_id domainhost_1ea127c2 - - + + public.DomainHost - - + + [table] - + domain_repo_id - + - + text not null - + host_repo_id - + - + text - + domainhost_1ea127c2:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fkfmi7bdink53swivs390m2btxg domainhost_1ea127c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_domainhost_host_valid host_f21b78de:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_host_superordinate_domain 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 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 - + billing_event_domain_repo_id - + - + text - + billing_recurrence_domain_repo_id - + - + text - + 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 - + 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 @@ -5844,536 +5908,536 @@ 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 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 - + 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 - + @@ -7648,12 +7712,12 @@ td.section {
- transfer_gaining_poll_message_id + transfer_poll_message_id_1 int8
- transfer_losing_poll_message_id + transfer_poll_message_id_2 int8
@@ -7696,6 +7760,16 @@ td.section { update_timestamp timestamptz
+
+ + transfer_history_entry_id + int8 +
+
+ + transfer_repo_id + text +
@@ -8164,12 +8238,12 @@ td.section {
- transfer_gaining_poll_message_id + transfer_poll_message_id_1 int8
- transfer_losing_poll_message_id + transfer_poll_message_id_2 int8
@@ -8262,6 +8336,16 @@ td.section { update_timestamp timestamptz
+
+ + transfer_history_entry_id + int8 +
+
+ + transfer_repo_id + text +
@@ -8748,12 +8832,12 @@ td.section {
- transfer_gaining_poll_message_id + transfer_poll_message_id_1 int8
- transfer_losing_poll_message_id + transfer_poll_message_id_2 int8
@@ -8881,6 +8965,16 @@ td.section { transfer_billing_event_history_id int8
+
+ + transfer_history_entry_id + int8 +
+
+ + transfer_repo_id + text +
@@ -9530,12 +9624,12 @@ td.section {
- transfer_gaining_poll_message_id + transfer_poll_message_id_1 int8
- transfer_losing_poll_message_id + transfer_poll_message_id_2 int8
@@ -9668,6 +9762,16 @@ td.section { transfer_billing_event_history_id int8
+
+ + transfer_history_entry_id + int8 +
+
+ + transfer_repo_id + text +
diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index 72ca9686b..6927056be 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -82,3 +82,4 @@ V81__drop_spec11_fkeys.sql V82__add_columns_to_restore_symmetric_billing_vkey.sql V83__add_indexes_on_domainhost.sql V84__add_vkey_columns_in_billing_cancellation.sql +V85__add_required_columns_in_transfer_data.sql diff --git a/db/src/main/resources/sql/flyway/V85__add_required_columns_in_transfer_data.sql b/db/src/main/resources/sql/flyway/V85__add_required_columns_in_transfer_data.sql new file mode 100644 index 000000000..2f2d9b167 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V85__add_required_columns_in_transfer_data.sql @@ -0,0 +1,57 @@ +-- Copyright 2021 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 "Contact" + add column if not exists "transfer_history_entry_id" int8; +alter table "Contact" + add column if not exists "transfer_repo_id" text; +alter table "Contact" + rename column "transfer_gaining_poll_message_id" + to "transfer_poll_message_id_1"; +alter table "Contact" + rename column "transfer_losing_poll_message_id" + to "transfer_poll_message_id_2"; + +alter table "ContactHistory" + add column if not exists "transfer_history_entry_id" int8; +alter table "ContactHistory" + add column if not exists "transfer_repo_id" text; +alter table "ContactHistory" + rename column "transfer_gaining_poll_message_id" + to "transfer_poll_message_id_1"; +alter table "ContactHistory" + rename column "transfer_losing_poll_message_id" + to "transfer_poll_message_id_2"; + +alter table "Domain" + add column if not exists "transfer_history_entry_id" int8; +alter table "Domain" + add column if not exists "transfer_repo_id" text; +alter table "Domain" + rename column "transfer_gaining_poll_message_id" + to "transfer_poll_message_id_1"; +alter table "Domain" + rename column "transfer_losing_poll_message_id" + to "transfer_poll_message_id_2"; + +alter table "DomainHistory" + add column if not exists "transfer_history_entry_id" int8; +alter table "DomainHistory" + add column if not exists "transfer_repo_id" text; +alter table "DomainHistory" + rename column "transfer_gaining_poll_message_id" + to "transfer_poll_message_id_1"; +alter table "DomainHistory" + rename column "transfer_losing_poll_message_id" + to "transfer_poll_message_id_2"; 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 d3e8bf2e3..0adc93e9d 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -140,8 +140,10 @@ addr_local_org text, addr_local_type text, search_name text, - transfer_gaining_poll_message_id int8, - transfer_losing_poll_message_id int8, + transfer_history_entry_id int8, + transfer_poll_message_id_1 int8, + transfer_poll_message_id_2 int8, + transfer_repo_id text, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -201,8 +203,10 @@ addr_local_org text, addr_local_type text, search_name text, - transfer_gaining_poll_message_id int8, - transfer_losing_poll_message_id int8, + transfer_history_entry_id int8, + transfer_poll_message_id_1 int8, + transfer_poll_message_id_2 int8, + transfer_repo_id text, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -284,8 +288,10 @@ 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_history_entry_id int8, + transfer_poll_message_id_1 int8, + transfer_poll_message_id_2 int8, + transfer_repo_id text, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -353,8 +359,10 @@ 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_history_entry_id int8, + transfer_poll_message_id_1 int8, + transfer_poll_message_id_2 int8, + transfer_repo_id text, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 5a3854ec7..119a8db20 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -210,8 +210,8 @@ CREATE TABLE public."Contact" ( search_name text, voice_phone_extension text, voice_phone_number text, - transfer_gaining_poll_message_id bigint, - transfer_losing_poll_message_id bigint, + transfer_poll_message_id_1 bigint, + transfer_poll_message_id_2 bigint, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -219,7 +219,9 @@ CREATE TABLE public."Contact" ( transfer_pending_expiration_time timestamp with time zone, transfer_request_time timestamp with time zone, transfer_status text, - update_timestamp timestamp with time zone + update_timestamp timestamp with time zone, + transfer_history_entry_id bigint, + transfer_repo_id text ); @@ -273,8 +275,8 @@ CREATE TABLE public."ContactHistory" ( addr_local_org text, addr_local_type text, search_name text, - transfer_gaining_poll_message_id bigint, - transfer_losing_poll_message_id bigint, + transfer_poll_message_id_1 bigint, + transfer_poll_message_id_2 bigint, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -292,7 +294,9 @@ CREATE TABLE public."ContactHistory" ( last_epp_update_time timestamp with time zone, statuses text[], contact_repo_id text NOT NULL, - update_timestamp timestamp with time zone + update_timestamp timestamp with time zone, + transfer_history_entry_id bigint, + transfer_repo_id text ); @@ -351,8 +355,8 @@ CREATE TABLE public."Domain" ( billing_contact text, registrant_contact text, tech_contact text, - transfer_gaining_poll_message_id bigint, - transfer_losing_poll_message_id bigint, + transfer_poll_message_id_1 bigint, + transfer_poll_message_id_2 bigint, transfer_billing_cancellation_id bigint, transfer_billing_event_id bigint, transfer_billing_recurrence_id bigint, @@ -377,7 +381,9 @@ CREATE TABLE public."Domain" ( deletion_poll_message_history_id bigint, transfer_billing_recurrence_history_id bigint, transfer_autorenew_poll_message_history_id bigint, - transfer_billing_event_history_id bigint + transfer_billing_event_history_id bigint, + transfer_history_entry_id bigint, + transfer_repo_id text ); @@ -438,8 +444,8 @@ CREATE TABLE public."DomainHistory" ( transfer_renew_period_unit text, transfer_renew_period_value integer, transfer_registration_expiration_time timestamp with time zone, - transfer_gaining_poll_message_id bigint, - transfer_losing_poll_message_id bigint, + transfer_poll_message_id_1 bigint, + transfer_poll_message_id_2 bigint, transfer_client_txn_id text, transfer_server_txn_id text, transfer_gaining_registrar_id text, @@ -465,7 +471,9 @@ CREATE TABLE public."DomainHistory" ( deletion_poll_message_history_id bigint, transfer_billing_recurrence_history_id bigint, transfer_autorenew_poll_message_history_id bigint, - transfer_billing_event_history_id bigint + transfer_billing_event_history_id bigint, + transfer_history_entry_id bigint, + transfer_repo_id text );