Migrate schema to meet 30 char length of database id limitation
Some databases restrict the id of database objects to be max 30 char long. Migrate the ReviewDB to meet this requirement. This change changes two tables, that were introduced in Schema 74: ACCOUNT_GROUP_INCLUDES_BY_UUID => ACCOUNT_GROUP_BY_ID ACCOUNT_GROUP_INCLUDES_BY_UUID_AUDIT => ACCOUNT_GROUP_BY_ID_AUD one column: ACCOUNTS.SHOW_USERNAME_IN_REVIEW_CATEGORY => SHOW_USER_IN_REVIEW and three indexes: account_project_watches_byProject => account_project_watches_byP patch_set_approvals_closedByUser => patch_set_approvals_closedByU submodule_subscription_access_bySubscription => submodule_subscr_acc_byS Change-Id: I93589a406274b952350174a4e79a7602ea57d05a
This commit is contained in:
@@ -32,7 +32,7 @@ import com.google.gerrit.acceptance.TestAccount;
|
||||
import com.google.gerrit.acceptance.rest.account.AccountInfo;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupById;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupMember;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
@@ -223,9 +223,9 @@ public class AddRemoveGroupMembersIT extends AbstractDaemonTest {
|
||||
throws OrmException {
|
||||
AccountGroup g = groupCache.get(new AccountGroup.NameKey(group));
|
||||
Set<AccountGroup.UUID> ids = Sets.newHashSet();
|
||||
ResultSet<AccountGroupIncludeByUuid> all =
|
||||
db.accountGroupIncludesByUuid().byGroup(g.getId());
|
||||
for (AccountGroupIncludeByUuid m : all) {
|
||||
ResultSet<AccountGroupById> all =
|
||||
db.accountGroupById().byGroup(g.getId());
|
||||
for (AccountGroupById m : all) {
|
||||
ids.add(m.getIncludeUUID());
|
||||
}
|
||||
assertTrue(ids.size() == includes.length);
|
||||
@@ -252,8 +252,8 @@ public class AddRemoveGroupMembersIT extends AbstractDaemonTest {
|
||||
|
||||
private void assertNoIncludes(String group) throws OrmException {
|
||||
AccountGroup g = groupCache.get(new AccountGroup.NameKey(group));
|
||||
Iterator<AccountGroupIncludeByUuid> it =
|
||||
db.accountGroupIncludesByUuid().byGroup(g.getId()).iterator();
|
||||
Iterator<AccountGroupById> it =
|
||||
db.accountGroupById().byGroup(g.getId()).iterator();
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user