Rename some Schema* classes to ReviewDbSchema*

In preparation for creating NoteDb analogues, which may share names.

Change-Id: I1969d1a00636ba2894f943f19ff18a4956585b44
This commit is contained in:
Dave Borowitz 2018-11-13 12:18:47 -08:00
parent 13975fa2ae
commit 8d58a9ab17
114 changed files with 180 additions and 177 deletions

View File

@ -428,11 +428,12 @@ public abstract class AbstractDaemonTest {
db = reviewDbProvider.open();
// All groups which were added during the server start (e.g. in SchemaCreator) aren't contained
// in the instance of the group index which is available here and in tests. There are two
// reasons:
// 1) No group index is available in SchemaCreator when using an in-memory database. (This could
// be fixed by using the IndexManagerOnInit in InMemoryDatabase similar as BaseInit uses it.)
// All groups which were added during the server start (e.g. in ReviewDbSchemaCreator) aren't
// contained in the instance of the group index which is available here and in tests. There are
// two reasons:
// 1) No group index is available in ReviewDbSchemaCreator when using an in-memory database.
// (This could be fixed by using the IndexManagerOnInit in InMemoryDatabase similar as BaseInit
// uses it.)
// 2) During the on-init part of the server start, we use another instance of the index than
// later on. As test indexes are non-permanent, closing an instance and opening another one
// removes all indexed data.

View File

@ -34,8 +34,8 @@ import com.google.gerrit.server.notedb.NotesMigration;
import com.google.gerrit.server.schema.DataSourceType;
import com.google.gerrit.server.schema.NotesMigrationSchemaFactory;
import com.google.gerrit.server.schema.ReviewDbFactory;
import com.google.gerrit.server.schema.SchemaModule;
import com.google.gerrit.server.schema.SchemaVersion;
import com.google.gerrit.server.schema.ReviewDbSchemaModule;
import com.google.gerrit.server.schema.ReviewDbSchemaVersion;
import com.google.gerrit.testing.InMemoryDatabase;
import com.google.gerrit.testing.InMemoryH2Type;
import com.google.gerrit.testing.InMemoryRepositoryManager;
@ -101,8 +101,8 @@ class InMemoryTestingDatabaseModule extends LifecycleModule {
bind(SitePaths.class);
bind(TrackingFooters.class).toProvider(TrackingFootersProvider.class).in(SINGLETON);
install(new SchemaModule());
bind(SchemaVersion.class).to(SchemaVersion.C);
install(new ReviewDbSchemaModule());
bind(ReviewDbSchemaVersion.class).to(ReviewDbSchemaVersion.C);
install(new SshdModule());
}

View File

@ -88,8 +88,8 @@ import com.google.gerrit.server.schema.DataSourceProvider;
import com.google.gerrit.server.schema.DataSourceType;
import com.google.gerrit.server.schema.DatabaseModule;
import com.google.gerrit.server.schema.JdbcAccountPatchReviewStore;
import com.google.gerrit.server.schema.SchemaModule;
import com.google.gerrit.server.schema.SchemaVersionCheck;
import com.google.gerrit.server.schema.ReviewDbSchemaModule;
import com.google.gerrit.server.schema.ReviewDbSchemaVersionCheck;
import com.google.gerrit.server.securestore.SecureStoreClassName;
import com.google.gerrit.server.ssh.NoSshModule;
import com.google.gerrit.server.ssh.SshAddressesModule;
@ -317,8 +317,8 @@ public class WebAppInitializer extends GuiceServletContextListener implements Fi
private Injector createCfgInjector() {
final List<Module> modules = new ArrayList<>();
modules.add(new SchemaModule());
modules.add(SchemaVersionCheck.module());
modules.add(new ReviewDbSchemaModule());
modules.add(ReviewDbSchemaVersionCheck.module());
modules.add(new AuthConfigModule());
return dbInjector.createChildInjector(modules);
}

View File

@ -97,7 +97,7 @@ import com.google.gerrit.server.restapi.RestApiModule;
import com.google.gerrit.server.schema.DataSourceProvider;
import com.google.gerrit.server.schema.InMemoryAccountPatchReviewStore;
import com.google.gerrit.server.schema.JdbcAccountPatchReviewStore;
import com.google.gerrit.server.schema.SchemaVersionCheck;
import com.google.gerrit.server.schema.ReviewDbSchemaVersionCheck;
import com.google.gerrit.server.securestore.DefaultSecureStore;
import com.google.gerrit.server.securestore.SecureStore;
import com.google.gerrit.server.securestore.SecureStoreClassName;
@ -289,7 +289,7 @@ public class Daemon extends SiteProgram {
JythonShell shell = new JythonShell();
shell.set("m", manager);
shell.set("ds", dbInjector.getInstance(DataSourceProvider.class));
shell.set("schk", dbInjector.getInstance(SchemaVersionCheck.class));
shell.set("schk", dbInjector.getInstance(ReviewDbSchemaVersionCheck.class));
shell.set("d", this);
shell.run();
} else {
@ -391,7 +391,7 @@ public class Daemon extends SiteProgram {
private Injector createSysInjector() {
final List<Module> modules = new ArrayList<>();
modules.add(SchemaVersionCheck.module());
modules.add(ReviewDbSchemaVersionCheck.module());
modules.add(new DropWizardMetricMaker.RestModule());
modules.add(new LogFileCompressor.Module());

View File

@ -29,7 +29,7 @@ import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.index.account.AccountSchemaDefinitions;
import com.google.gerrit.server.schema.SchemaVersionCheck;
import com.google.gerrit.server.schema.ReviewDbSchemaVersionCheck;
import com.google.gwtorm.server.OrmDuplicateKeyException;
import com.google.inject.Inject;
import com.google.inject.Injector;
@ -55,7 +55,7 @@ public class LocalUsernamesToLowerCase extends SiteProgram {
@Override
public int run() throws Exception {
Injector dbInjector = createDbInjector(MULTI_USER);
manager.add(dbInjector, dbInjector.createChildInjector(SchemaVersionCheck.module()));
manager.add(dbInjector, dbInjector.createChildInjector(ReviewDbSchemaVersionCheck.module()));
manager.start();
dbInjector
.createChildInjector(

View File

@ -43,7 +43,7 @@ import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.index.IndexModule;
import com.google.gerrit.server.plugins.JarScanner;
import com.google.gerrit.server.schema.ReviewDbFactory;
import com.google.gerrit.server.schema.SchemaUpdater;
import com.google.gerrit.server.schema.ReviewDbSchemaUpdater;
import com.google.gerrit.server.schema.UpdateUI;
import com.google.gerrit.server.securestore.SecureStore;
import com.google.gerrit.server.securestore.SecureStoreClassName;
@ -358,7 +358,7 @@ public class BaseInit extends SiteProgram {
public final ConsoleUI ui;
public final SitePaths site;
public final InitFlags flags;
final SchemaUpdater schemaUpdater;
final ReviewDbSchemaUpdater schemaUpdater;
final SchemaFactory<ReviewDb> schema;
final GitRepositoryManager repositoryManager;
@ -367,7 +367,7 @@ public class BaseInit extends SiteProgram {
ConsoleUI ui,
SitePaths site,
InitFlags flags,
SchemaUpdater schemaUpdater,
ReviewDbSchemaUpdater schemaUpdater,
@ReviewDbFactory SchemaFactory<ReviewDb> schema,
GitRepositoryManager repositoryManager) {
this.ui = ui;

View File

@ -34,7 +34,7 @@ import com.google.gerrit.server.schema.DataSourceModule;
import com.google.gerrit.server.schema.DataSourceProvider;
import com.google.gerrit.server.schema.DataSourceType;
import com.google.gerrit.server.schema.DatabaseModule;
import com.google.gerrit.server.schema.SchemaModule;
import com.google.gerrit.server.schema.ReviewDbSchemaModule;
import com.google.gerrit.server.securestore.SecureStoreClassName;
import com.google.gwtorm.server.OrmException;
import com.google.inject.AbstractModule;
@ -188,7 +188,7 @@ public abstract class SiteProgram extends AbstractProgram {
}
});
modules.add(new DatabaseModule());
modules.add(new SchemaModule());
modules.add(new ReviewDbSchemaModule());
modules.add(cfgInjector.getInstance(GitRepositoryManagerModule.class));
modules.add(new NotesMigration.Module());

View File

@ -35,7 +35,7 @@ import com.google.gwtorm.server.Sequence;
* </ul>
*/
public interface ReviewDb extends Schema {
/* If you change anything, update SchemaVersion.C to use a new version. */
/* If you change anything, update ReviewDbSchemaVersion.C to use a new version. */
@Relation(id = 1)
SchemaVersionAccess schemaVersion();

View File

@ -59,7 +59,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
/** Creates the current database schema and populates initial code rows. */
public class SchemaCreator {
public class ReviewDbSchemaCreator {
@SitePath private final Path site_path;
private final GitRepositoryManager repoManager;
@ -77,7 +77,7 @@ public class SchemaCreator {
private final AllProjectsName allProjectsName;
@Inject
public SchemaCreator(
public ReviewDbSchemaCreator(
SitePaths site,
GitRepositoryManager repoManager,
AllProjectsCreator ap,
@ -107,7 +107,7 @@ public class SchemaCreator {
apName);
}
public SchemaCreator(
public ReviewDbSchemaCreator(
@SitePath Path site,
GitRepositoryManager repoManager,
AllProjectsCreator ap,
@ -144,7 +144,7 @@ public class SchemaCreator {
}
final CurrentSchemaVersion sVer = CurrentSchemaVersion.create();
sVer.versionNbr = SchemaVersion.getBinaryVersion();
sVer.versionNbr = ReviewDbSchemaVersion.getBinaryVersion();
db.schemaVersion().insert(Collections.singleton(sVer));
GroupReference admins = createGroupReference("Administrators");

View File

@ -30,7 +30,7 @@ import com.google.gerrit.server.config.GerritServerIdProvider;
import org.eclipse.jgit.lib.PersonIdent;
/** Validate the schema and connect to Git. */
public class SchemaModule extends FactoryModule {
public class ReviewDbSchemaModule extends FactoryModule {
@Override
protected void configure() {
bind(PersonIdent.class)

View File

@ -44,22 +44,22 @@ import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.PersonIdent;
/** Creates or updates the current database schema. */
public class SchemaUpdater {
public class ReviewDbSchemaUpdater {
private final SchemaFactory<ReviewDb> schema;
private final SitePaths site;
private final SchemaCreator creator;
private final Provider<SchemaVersion> updater;
private final ReviewDbSchemaCreator creator;
private final Provider<ReviewDbSchemaVersion> updater;
@Inject
SchemaUpdater(
ReviewDbSchemaUpdater(
@ReviewDbFactory SchemaFactory<ReviewDb> schema,
SitePaths site,
SchemaCreator creator,
ReviewDbSchemaCreator creator,
Injector parent) {
this.schema = schema;
this.site = site;
this.creator = creator;
this.updater = buildInjector(parent).getProvider(SchemaVersion.class);
this.updater = buildInjector(parent).getProvider(ReviewDbSchemaVersion.class);
}
private static Injector buildInjector(Injector parent) {
@ -71,7 +71,7 @@ public class SchemaUpdater {
new AbstractModule() {
@Override
protected void configure() {
bind(SchemaVersion.class).to(SchemaVersion.C);
bind(ReviewDbSchemaVersion.class).to(ReviewDbSchemaVersion.C);
for (Key<?> k :
new Key<?>[] {
@ -104,7 +104,7 @@ public class SchemaUpdater {
public void update(UpdateUI ui) throws OrmException {
try (ReviewDb db = ReviewDbUtil.unwrapDb(schema.open())) {
final SchemaVersion u = updater.get();
final ReviewDbSchemaVersion u = updater.get();
final CurrentSchemaVersion version = getSchemaVersion(db);
if (version == null) {
try {
@ -126,7 +126,7 @@ public class SchemaUpdater {
}
@VisibleForTesting
public SchemaVersion getLatestSchemaVersion() {
public ReviewDbSchemaVersion getLatestSchemaVersion() {
return updater.get();
}

View File

@ -34,7 +34,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
/** A version of the database schema. */
public abstract class SchemaVersion {
public abstract class ReviewDbSchemaVersion {
/** The current schema version. */
public static final Class<Schema_169> C = Schema_169.class;
@ -42,10 +42,10 @@ public abstract class SchemaVersion {
return guessVersion(C);
}
private final Provider<? extends SchemaVersion> prior;
private final Provider<? extends ReviewDbSchemaVersion> prior;
private final int versionNbr;
protected SchemaVersion(Provider<? extends SchemaVersion> prior) {
protected ReviewDbSchemaVersion(Provider<? extends ReviewDbSchemaVersion> prior) {
this.prior = prior;
this.versionNbr = guessVersion(getClass());
}
@ -66,7 +66,7 @@ public abstract class SchemaVersion {
}
@VisibleForTesting
public final SchemaVersion getPrior() {
public final ReviewDbSchemaVersion getPrior() {
return prior.get();
}
@ -89,7 +89,7 @@ public abstract class SchemaVersion {
/** Runs check on the prior schema version, and then upgrades. */
private void upgradeFrom(UpdateUI ui, CurrentSchemaVersion curr, ReviewDb db)
throws OrmException, SQLException {
List<SchemaVersion> pending = pending(curr.versionNbr);
List<ReviewDbSchemaVersion> pending = pending(curr.versionNbr);
updateSchema(pending, ui, db);
migrateData(pending, ui, curr, db);
@ -115,18 +115,18 @@ public abstract class SchemaVersion {
}
}
private List<SchemaVersion> pending(int curr) {
List<SchemaVersion> r = Lists.newArrayListWithCapacity(versionNbr - curr);
for (SchemaVersion v = this; curr < v.getVersionNbr(); v = v.prior.get()) {
private List<ReviewDbSchemaVersion> pending(int curr) {
List<ReviewDbSchemaVersion> r = Lists.newArrayListWithCapacity(versionNbr - curr);
for (ReviewDbSchemaVersion v = this; curr < v.getVersionNbr(); v = v.prior.get()) {
r.add(v);
}
Collections.reverse(r);
return r;
}
private void updateSchema(List<SchemaVersion> pending, UpdateUI ui, ReviewDb db)
private void updateSchema(List<ReviewDbSchemaVersion> pending, UpdateUI ui, ReviewDb db)
throws OrmException, SQLException {
for (SchemaVersion v : pending) {
for (ReviewDbSchemaVersion v : pending) {
ui.message(String.format("Upgrading schema to %d ...", v.getVersionNbr()));
v.preUpdateSchema(db);
}
@ -147,9 +147,9 @@ public abstract class SchemaVersion {
protected void preUpdateSchema(ReviewDb db) throws OrmException, SQLException {}
private void migrateData(
List<SchemaVersion> pending, UpdateUI ui, CurrentSchemaVersion curr, ReviewDb db)
List<ReviewDbSchemaVersion> pending, UpdateUI ui, CurrentSchemaVersion curr, ReviewDb db)
throws OrmException, SQLException {
for (SchemaVersion v : pending) {
for (ReviewDbSchemaVersion v : pending) {
Stopwatch sw = Stopwatch.createStarted();
ui.message(String.format("Migrating data to schema %d ...", v.getVersionNbr()));
v.migrateData(db, ui);

View File

@ -26,12 +26,12 @@ import com.google.inject.Module;
import com.google.inject.ProvisionException;
/** Validates the current schema version. */
public class SchemaVersionCheck implements LifecycleListener {
public class ReviewDbSchemaVersionCheck implements LifecycleListener {
public static Module module() {
return new LifecycleModule() {
@Override
protected void configure() {
listener().to(SchemaVersionCheck.class);
listener().to(ReviewDbSchemaVersionCheck.class);
}
};
}
@ -40,7 +40,7 @@ public class SchemaVersionCheck implements LifecycleListener {
private final SitePaths site;
@Inject
public SchemaVersionCheck(SchemaFactory<ReviewDb> schemaFactory, SitePaths site) {
public ReviewDbSchemaVersionCheck(SchemaFactory<ReviewDb> schemaFactory, SitePaths site) {
this.schema = schemaFactory;
this.site = site;
}
@ -49,7 +49,7 @@ public class SchemaVersionCheck implements LifecycleListener {
public void start() {
try (ReviewDb db = schema.open()) {
final CurrentSchemaVersion currentVer = getSchemaVersion(db);
final int expectedVer = SchemaVersion.getBinaryVersion();
final int expectedVer = ReviewDbSchemaVersion.getBinaryVersion();
if (currentVer == null) {
throw new ProvisionException(

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_100 extends SchemaVersion {
public class Schema_100 extends ReviewDbSchemaVersion {
@Inject
Schema_100(Provider<Schema_99> prior) {
super(prior);

View File

@ -38,7 +38,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class Schema_101 extends SchemaVersion {
public class Schema_101 extends ReviewDbSchemaVersion {
private static class PrimaryKey {
String oldNameInDb;

View File

@ -26,7 +26,7 @@ import java.sql.SQLException;
import java.util.Set;
import java.util.regex.Pattern;
public class Schema_102 extends SchemaVersion {
public class Schema_102 extends ReviewDbSchemaVersion {
@Inject
Schema_102(Provider<Schema_101> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_103 extends SchemaVersion {
public class Schema_103 extends ReviewDbSchemaVersion {
@Inject
Schema_103(Provider<Schema_102> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_104 extends SchemaVersion {
public class Schema_104 extends ReviewDbSchemaVersion {
@Inject
Schema_104(Provider<Schema_103> prior) {
super(prior);

View File

@ -28,7 +28,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class Schema_105 extends SchemaVersion {
public class Schema_105 extends ReviewDbSchemaVersion {
private static final String TABLE = "changes";
@Inject

View File

@ -40,7 +40,7 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_106 extends SchemaVersion {
public class Schema_106 extends ReviewDbSchemaVersion {
// we can use multiple threads per CPU as we can expect that threads will be
// waiting for IO
private static final int THREADS_PER_CPU = 4;

View File

@ -21,7 +21,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_107 extends SchemaVersion {
public class Schema_107 extends ReviewDbSchemaVersion {
@Inject
Schema_107(Provider<Schema_106> prior) {

View File

@ -48,7 +48,7 @@ import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevSort;
import org.eclipse.jgit.revwalk.RevWalk;
public class Schema_108 extends SchemaVersion {
public class Schema_108 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
@Inject

View File

@ -20,7 +20,7 @@ import com.google.gwtorm.server.StatementExecutor;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_109 extends SchemaVersion {
public class Schema_109 extends ReviewDbSchemaVersion {
@Inject
Schema_109(Provider<Schema_108> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_110 extends SchemaVersion {
public class Schema_110 extends ReviewDbSchemaVersion {
@Inject
Schema_110(Provider<Schema_109> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_111 extends SchemaVersion {
public class Schema_111 extends ReviewDbSchemaVersion {
@Inject
Schema_111(Provider<Schema_110> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_112 extends SchemaVersion {
public class Schema_112 extends ReviewDbSchemaVersion {
@Inject
Schema_112(Provider<Schema_111> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_113 extends SchemaVersion {
public class Schema_113 extends ReviewDbSchemaVersion {
@Inject
Schema_113(Provider<Schema_112> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_114 extends SchemaVersion {
public class Schema_114 extends ReviewDbSchemaVersion {
@Inject
Schema_114(Provider<Schema_113> prior) {
super(prior);

View File

@ -51,7 +51,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
public class Schema_115 extends SchemaVersion {
public class Schema_115 extends ReviewDbSchemaVersion {
private final GitRepositoryManager mgr;
private final AllUsersName allUsersName;
private final PersonIdent serverUser;

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_116 extends SchemaVersion {
public class Schema_116 extends ReviewDbSchemaVersion {
@Inject
Schema_116(Provider<Schema_115> prior) {
super(prior);

View File

@ -24,7 +24,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.Set;
public class Schema_117 extends SchemaVersion {
public class Schema_117 extends ReviewDbSchemaVersion {
@Inject
Schema_117(Provider<Schema_116> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_118 extends SchemaVersion {
public class Schema_118 extends ReviewDbSchemaVersion {
@Inject
Schema_118(Provider<Schema_117> prior) {
super(prior);

View File

@ -58,7 +58,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
public class Schema_119 extends SchemaVersion {
public class Schema_119 extends ReviewDbSchemaVersion {
private static final ImmutableMap<String, String> LEGACY_DISPLAYNAME_MAP =
ImmutableMap.<String, String>of(
"ANON_GIT", ANON_GIT,

View File

@ -39,7 +39,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.RefSpec;
public class Schema_120 extends SchemaVersion {
public class Schema_120 extends ReviewDbSchemaVersion {
private final GitRepositoryManager mgr;
private final ProjectConfig.Factory projectConfigFactory;

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_121 extends SchemaVersion {
public class Schema_121 extends ReviewDbSchemaVersion {
@Inject
Schema_121(Provider<Schema_120> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_122 extends SchemaVersion {
public class Schema_122 extends ReviewDbSchemaVersion {
@Inject
Schema_122(Provider<Schema_121> prior) {
super(prior);

View File

@ -40,7 +40,7 @@ import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.ReceiveCommand;
public class Schema_123 extends SchemaVersion {
public class Schema_123 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;

View File

@ -50,7 +50,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
public class Schema_124 extends SchemaVersion {
public class Schema_124 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;
private final PersonIdent serverUser;

View File

@ -44,7 +44,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_125 extends SchemaVersion {
public class Schema_125 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG =
"Assign default permissions on user branches\n"
+ "\n"

View File

@ -38,7 +38,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_126 extends SchemaVersion {
public class Schema_126 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG = "Fix default permissions on user branches";
private final GitRepositoryManager repoManager;

View File

@ -28,7 +28,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import org.eclipse.jgit.lib.Config;
public class Schema_127 extends SchemaVersion {
public class Schema_127 extends ReviewDbSchemaVersion {
private static final int MAX_BATCH_SIZE = 1000;
private final SitePaths sitePaths;

View File

@ -36,7 +36,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_128 extends SchemaVersion {
public class Schema_128 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG = "Add addPatchSet permission to all projects";
private final GitRepositoryManager repoManager;

View File

@ -22,7 +22,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_129 extends SchemaVersion {
public class Schema_129 extends ReviewDbSchemaVersion {
@Inject
Schema_129(Provider<Schema_128> prior) {

View File

@ -32,7 +32,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_130 extends SchemaVersion {
public class Schema_130 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG =
"Remove force option from 'Push Annotated Tag' permission\n"
+ "\n"

View File

@ -33,7 +33,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_131 extends SchemaVersion {
public class Schema_131 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG =
"Rename 'Push Annotated/Signed Tag' permission to 'Create Annotated/Signed Tag'";

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_132 extends SchemaVersion {
public class Schema_132 extends ReviewDbSchemaVersion {
@Inject
Schema_132(Provider<Schema_131> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_133 extends SchemaVersion {
public class Schema_133 extends ReviewDbSchemaVersion {
@Inject
Schema_133(Provider<Schema_132> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_134 extends SchemaVersion {
public class Schema_134 extends ReviewDbSchemaVersion {
@Inject
Schema_134(Provider<Schema_133> prior) {
super(prior);

View File

@ -41,7 +41,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_135 extends SchemaVersion {
public class Schema_135 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG =
"Allow admins and project owners to create refs/meta/config";

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_136 extends SchemaVersion {
public class Schema_136 extends ReviewDbSchemaVersion {
@Inject
Schema_136(Provider<Schema_135> prior) {
super(prior);

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/* change the type of SystemConfig#sitePath to CLOB */
public class Schema_137 extends SchemaVersion {
public class Schema_137 extends ReviewDbSchemaVersion {
@Inject
Schema_137(Provider<Schema_136> prior) {
super(prior);

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/* Add resolved field to PatchLineComment */
public class Schema_138 extends SchemaVersion {
public class Schema_138 extends ReviewDbSchemaVersion {
@Inject
Schema_138(Provider<Schema_137> prior) {
super(prior);

View File

@ -54,7 +54,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
public class Schema_139 extends SchemaVersion {
public class Schema_139 extends ReviewDbSchemaVersion {
private static final String MSG = "Migrate project watches to git";
private final GitRepositoryManager repoManager;

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Remove ChangeMessage sequence. */
public class Schema_140 extends SchemaVersion {
public class Schema_140 extends ReviewDbSchemaVersion {
@Inject
Schema_140(Provider<Schema_139> prior) {
super(prior);

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Add status field to account. */
public class Schema_141 extends SchemaVersion {
public class Schema_141 extends ReviewDbSchemaVersion {
@Inject
Schema_141(Provider<Schema_140> prior) {
super(prior);

View File

@ -29,7 +29,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_142 extends SchemaVersion {
public class Schema_142 extends ReviewDbSchemaVersion {
private static final int MAX_BATCH_SIZE = 1000;
@Inject

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Add isPrivate field to change. */
public class Schema_143 extends SchemaVersion {
public class Schema_143 extends ReviewDbSchemaVersion {
@Inject
Schema_143(Provider<Schema_142> prior) {
super(prior);

View File

@ -37,7 +37,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_144 extends SchemaVersion {
public class Schema_144 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG = "Import external IDs from ReviewDb";
private final GitRepositoryManager repoManager;

View File

@ -24,7 +24,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
/** Create account_external_ids_byEmail index. */
public class Schema_145 extends SchemaVersion {
public class Schema_145 extends ReviewDbSchemaVersion {
@Inject
Schema_145(Provider<Schema_144> prior) {

View File

@ -54,7 +54,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
* commit with the registration date as commit time is inserted (if such a commit doesn't exist
* yet).
*/
public class Schema_146 extends SchemaVersion {
public class Schema_146 extends ReviewDbSchemaVersion {
private static final String CREATE_ACCOUNT_MSG = "Create Account";
private final GitRepositoryManager repoManager;

View File

@ -38,7 +38,7 @@ import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.lib.Repository;
/** Delete user branches for which no account exists. */
public class Schema_147 extends SchemaVersion {
public class Schema_147 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;

View File

@ -33,7 +33,7 @@ import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_148 extends SchemaVersion {
public class Schema_148 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG = "Make account IDs of external IDs human-readable";
private final GitRepositoryManager repoManager;

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Add workInProgress field to change. */
public class Schema_149 extends SchemaVersion {
public class Schema_149 extends ReviewDbSchemaVersion {
@Inject
Schema_149(Provider<Schema_148> prior) {
super(prior);

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Drop ACCOUNT_EXTERNAL_IDS table. */
public class Schema_150 extends SchemaVersion {
public class Schema_150 extends ReviewDbSchemaVersion {
@Inject
Schema_150(Provider<Schema_149> prior) {
super(prior);

View File

@ -29,7 +29,7 @@ import java.util.List;
import java.util.Optional;
/** A schema which adds the 'created on' field to groups. */
public class Schema_151 extends SchemaVersion {
public class Schema_151 extends ReviewDbSchemaVersion {
@Inject
protected Schema_151(Provider<Schema_150> prior) {
super(prior);

View File

@ -24,7 +24,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
/** Drop unused indexes from accounts table. */
public class Schema_152 extends SchemaVersion {
public class Schema_152 extends ReviewDbSchemaVersion {
@Inject
Schema_152(Provider<Schema_151> prior) {
super(prior);

View File

@ -21,7 +21,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Add reviewStarted field to change. */
public class Schema_153 extends SchemaVersion {
public class Schema_153 extends ReviewDbSchemaVersion {
@Inject
Schema_153(Provider<Schema_152> prior) {
super(prior);

View File

@ -47,7 +47,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.TextProgressMonitor;
/** Migrate accounts to NoteDb. */
public class Schema_154 extends SchemaVersion {
public class Schema_154 extends ReviewDbSchemaVersion {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final String TABLE = "accounts";

View File

@ -26,7 +26,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
/** Create account sequence in NoteDb */
public class Schema_155 extends SchemaVersion {
public class Schema_155 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Add revertOf field to change. */
public class Schema_156 extends SchemaVersion {
public class Schema_156 extends ReviewDbSchemaVersion {
@Inject
Schema_156(Provider<Schema_155> prior) {
super(prior);

View File

@ -24,7 +24,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
/** Drop unused indexes from accounts table. */
public class Schema_157 extends SchemaVersion {
public class Schema_157 extends ReviewDbSchemaVersion {
@Inject
Schema_157(Provider<Schema_156> prior) {
super(prior);

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Drop ACCOUNTS table. */
public class Schema_158 extends SchemaVersion {
public class Schema_158 extends ReviewDbSchemaVersion {
@Inject
Schema_158(Provider<Schema_157> prior) {
super(prior);

View File

@ -21,7 +21,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Migrate draft changes to private or wip changes. */
public class Schema_159 extends SchemaVersion {
public class Schema_159 extends ReviewDbSchemaVersion {
private enum DraftWorkflowMigrationStrategy {
PRIVATE,

View File

@ -60,7 +60,7 @@ import org.eclipse.jgit.lib.TextProgressMonitor;
* <p>Other menus containing {@code is:draft} in other positions are not affected; this is still a
* valid predicate that matches no changes.
*/
public class Schema_160 extends SchemaVersion {
public class Schema_160 extends ReviewDbSchemaVersion {
@VisibleForTesting static final ImmutableList<String> DEFAULT_DRAFT_ITEMS;
static {

View File

@ -39,7 +39,7 @@ import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.ReceiveCommand;
public class Schema_161 extends SchemaVersion {
public class Schema_161 extends ReviewDbSchemaVersion {
private static final String MUTE_LABEL = "mute";
private final GitRepositoryManager repoManager;

View File

@ -30,7 +30,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
public class Schema_162 extends SchemaVersion {
public class Schema_162 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllProjectsName allProjectsName;
private final AllUsersName allUsersName;

View File

@ -26,7 +26,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
/** Create group sequence in NoteDb */
public class Schema_163 extends SchemaVersion {
public class Schema_163 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;

View File

@ -38,7 +38,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
/** Grant read on group branches */
public class Schema_164 extends SchemaVersion {
public class Schema_164 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG = "Grant read permissions on group branches";
private final GitRepositoryManager repoManager;

View File

@ -41,7 +41,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
/** Make default Label-Code-Review permission on user branches exclusive. */
public class Schema_165 extends SchemaVersion {
public class Schema_165 extends ReviewDbSchemaVersion {
private static final String COMMIT_MSG =
"Make default Label-Code-Review permission on user branches exclusive";

View File

@ -28,7 +28,7 @@ import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.Repository;
/** Set HEAD for All-Users to refs/meta/config. */
public class Schema_166 extends SchemaVersion {
public class Schema_166 extends ReviewDbSchemaVersion {
private final GitRepositoryManager repoManager;
private final AllUsersName allUsersName;

View File

@ -60,7 +60,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
/** Migrate groups from ReviewDb to NoteDb. */
public class Schema_167 extends SchemaVersion {
public class Schema_167 extends ReviewDbSchemaVersion {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final GitRepositoryManager repoManager;

View File

@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
/** Drop group tables. */
public class Schema_168 extends SchemaVersion {
public class Schema_168 extends ReviewDbSchemaVersion {
@Inject
Schema_168(Provider<Schema_167> prior) {
super(prior);

View File

@ -35,7 +35,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.TextProgressMonitor;
/** Migrate NoteDb inline comments to JSON format. */
public class Schema_169 extends SchemaVersion {
public class Schema_169 extends ReviewDbSchemaVersion {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final CommentJsonMigrator migrator;
private final GitRepositoryManager repoManager;

View File

@ -18,14 +18,14 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.ProvisionException;
public class Schema_83 extends SchemaVersion {
public class Schema_83 extends ReviewDbSchemaVersion {
@Inject
Schema_83() {
super(
new Provider<SchemaVersion>() {
new Provider<ReviewDbSchemaVersion>() {
@Override
public SchemaVersion get() {
public ReviewDbSchemaVersion get() {
throw new ProvisionException("Upgrade first to 2.8 or 2.9");
}
});

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_84 extends SchemaVersion {
public class Schema_84 extends ReviewDbSchemaVersion {
@Inject
Schema_84(Provider<Schema_83> prior) {

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_85 extends SchemaVersion {
public class Schema_85 extends ReviewDbSchemaVersion {
@Inject
Schema_85(Provider<Schema_84> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_86 extends SchemaVersion {
public class Schema_86 extends ReviewDbSchemaVersion {
@Inject
Schema_86(Provider<Schema_85> prior) {
super(prior);

View File

@ -28,7 +28,7 @@ import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
public class Schema_87 extends SchemaVersion {
public class Schema_87 extends ReviewDbSchemaVersion {
@Inject
Schema_87(Provider<Schema_86> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_88 extends SchemaVersion {
public class Schema_88 extends ReviewDbSchemaVersion {
@Inject
Schema_88(Provider<Schema_87> prior) {
super(prior);

View File

@ -23,7 +23,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import java.sql.SQLException;
public class Schema_89 extends SchemaVersion {
public class Schema_89 extends ReviewDbSchemaVersion {
@Inject
Schema_89(Provider<Schema_88> prior) {
super(prior);

View File

@ -20,7 +20,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_90 extends SchemaVersion {
public class Schema_90 extends ReviewDbSchemaVersion {
@Inject
Schema_90(Provider<Schema_89> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_91 extends SchemaVersion {
public class Schema_91 extends ReviewDbSchemaVersion {
@Inject
Schema_91(Provider<Schema_90> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_92 extends SchemaVersion {
public class Schema_92 extends ReviewDbSchemaVersion {
@Inject
Schema_92(Provider<Schema_91> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_93 extends SchemaVersion {
public class Schema_93 extends ReviewDbSchemaVersion {
@Inject
Schema_93(Provider<Schema_92> prior) {
super(prior);

View File

@ -20,7 +20,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_94 extends SchemaVersion {
public class Schema_94 extends ReviewDbSchemaVersion {
@Inject
Schema_94(Provider<Schema_93> prior) {
super(prior);

View File

@ -22,7 +22,7 @@ import java.io.IOException;
import java.sql.SQLException;
import org.eclipse.jgit.errors.ConfigInvalidException;
public class Schema_95 extends SchemaVersion {
public class Schema_95 extends ReviewDbSchemaVersion {
private final AllUsersCreator allUsersCreator;
@Inject

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_96 extends SchemaVersion {
public class Schema_96 extends ReviewDbSchemaVersion {
@Inject
Schema_96(Provider<Schema_95> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_97 extends SchemaVersion {
public class Schema_97 extends ReviewDbSchemaVersion {
@Inject
Schema_97(Provider<Schema_96> prior) {
super(prior);

View File

@ -20,7 +20,7 @@ import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_98 extends SchemaVersion {
public class Schema_98 extends ReviewDbSchemaVersion {
@Inject
Schema_98(Provider<Schema_97> prior) {
super(prior);

View File

@ -17,7 +17,7 @@ package com.google.gerrit.server.schema;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class Schema_99 extends SchemaVersion {
public class Schema_99 extends ReviewDbSchemaVersion {
@Inject
Schema_99(Provider<Schema_98> prior) {
super(prior);

Some files were not shown because too many files have changed in this diff Show More