mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Index the allocation token's redemption history entry field
We need this to efficiently query which tokens have and have not been redeemed. I'm also marking it as nullable for consistency with the domain name field (it's already null for unredeemed tokens). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=214366534
This commit is contained in:
@@ -41,7 +41,7 @@ public class AllocationToken extends BackupGroupRoot implements Buildable {
|
||||
@Id String token;
|
||||
|
||||
/** The key of the history entry for which the token was used. Null if not yet used. */
|
||||
Key<HistoryEntry> redemptionHistoryEntry;
|
||||
@Nullable @Index Key<HistoryEntry> redemptionHistoryEntry;
|
||||
|
||||
/** The fully-qualified domain name that this token is limited to, if any. */
|
||||
@Nullable @Index String domainName;
|
||||
|
||||
@@ -48,10 +48,12 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setRedemptionHistoryEntry(Key.create(HistoryEntry.class, 1L))
|
||||
.setDomainName("blahdomain.fake")
|
||||
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
||||
.build()),
|
||||
"token",
|
||||
"redemptionHistoryEntry",
|
||||
"domainName");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user