mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02: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:
parent
c89cb6a3f3
commit
9faf7181c3
2 changed files with 3 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue