public abstract class SchemaVersion extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaVersion.Module |
Modifier and Type | Field and Description |
---|---|
static Class<Schema_98> |
C
The current schema version.
|
Modifier | Constructor and Description |
---|---|
protected |
SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior) |
protected |
SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior,
int versionNbr) |
Modifier and Type | Method and Description |
---|---|
void |
check(UpdateUI ui,
com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr,
com.google.gerrit.reviewdb.server.ReviewDb db) |
protected void |
execute(com.google.gerrit.reviewdb.server.ReviewDb db,
String sql)
Execute an SQL statement.
|
protected void |
finish(com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr,
com.google.gerrit.reviewdb.server.ReviewDb db)
Mark the current schema version.
|
int |
getVersionNbr() |
static int |
guessVersion(Class<?> c) |
protected void |
migrateData(com.google.gerrit.reviewdb.server.ReviewDb db,
UpdateUI ui)
Invoked between updateSchema (adds new columns/tables) and pruneSchema
(removes deleted columns/tables).
|
protected void |
preUpdateSchema(com.google.gerrit.reviewdb.server.ReviewDb db)
Invoke before updateSchema adds new columns/tables.
|
protected void |
renameColumn(com.google.gerrit.reviewdb.server.ReviewDb db,
String table,
String from,
String to)
Rename an existing column.
|
protected void |
renameTable(com.google.gerrit.reviewdb.server.ReviewDb db,
String from,
String to)
Rename an existing table.
|
protected SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior)
protected SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior, int versionNbr)
public static int guessVersion(Class<?> c)
public final int getVersionNbr()
CurrentSchemaVersion.versionNbr
this step targets.public final void check(UpdateUI ui, com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr, com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException, SQLException
com.google.gwtorm.server.OrmException
SQLException
protected void preUpdateSchema(com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException, SQLException
com.google.gwtorm.server.OrmException
SQLException
protected void migrateData(com.google.gerrit.reviewdb.server.ReviewDb db, UpdateUI ui) throws com.google.gwtorm.server.OrmException, SQLException
com.google.gwtorm.server.OrmException
SQLException
protected void finish(com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr, com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected void renameTable(com.google.gerrit.reviewdb.server.ReviewDb db, String from, String to) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected void renameColumn(com.google.gerrit.reviewdb.server.ReviewDb db, String table, String from, String to) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected void execute(com.google.gerrit.reviewdb.server.ReviewDb db, String sql) throws SQLException
SQLException