public abstract class SchemaVersion
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Class<Schema_161> |
C
The current schema version.
|
Modifier | Constructor and Description |
---|---|
protected |
SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior) |
Modifier and Type | Method and Description |
---|---|
void |
check(UpdateUI ui,
CurrentSchemaVersion curr,
ReviewDb db) |
protected static void |
execute(ReviewDb db,
java.lang.String sql)
Execute an SQL statement.
|
protected void |
finish(CurrentSchemaVersion curr,
ReviewDb db)
Mark the current schema version.
|
static int |
getBinaryVersion() |
SchemaVersion |
getPrior() |
int |
getVersionNbr() |
static int |
guessVersion(java.lang.Class<?> c) |
protected void |
migrateData(ReviewDb db,
UpdateUI ui)
Invoked between updateSchema (adds new columns/tables) and pruneSchema (removes deleted
columns/tables).
|
protected static com.google.gwtorm.jdbc.JdbcExecutor |
newExecutor(ReviewDb db)
Open a new statement executor.
|
protected static java.sql.Statement |
newStatement(ReviewDb db)
Open a new single statement.
|
protected static java.sql.PreparedStatement |
prepareStatement(ReviewDb db,
java.lang.String sql)
Open a new prepared statement.
|
protected void |
preUpdateSchema(ReviewDb db)
Invoked before updateSchema adds new columns/tables.
|
protected static void |
renameColumn(ReviewDb db,
java.lang.String table,
java.lang.String from,
java.lang.String to)
Rename an existing column.
|
protected static void |
renameTable(ReviewDb db,
java.lang.String from,
java.lang.String to)
Rename an existing table.
|
public static final java.lang.Class<Schema_161> C
protected SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior)
public static int getBinaryVersion()
public static int guessVersion(java.lang.Class<?> c)
public final int getVersionNbr()
CurrentSchemaVersion.versionNbr
this step targets.public final SchemaVersion getPrior()
public final void check(UpdateUI ui, CurrentSchemaVersion curr, ReviewDb db) throws com.google.gwtorm.server.OrmException, java.sql.SQLException
com.google.gwtorm.server.OrmException
java.sql.SQLException
protected void preUpdateSchema(ReviewDb db) throws com.google.gwtorm.server.OrmException, java.sql.SQLException
db
- open database handle.com.google.gwtorm.server.OrmException
- if a Gerrit-specific exception occurred.java.sql.SQLException
- if an underlying SQL exception occurred.protected void migrateData(ReviewDb db, UpdateUI ui) throws com.google.gwtorm.server.OrmException, java.sql.SQLException
db
- open database handle.ui
- interface for interacting with the user.com.google.gwtorm.server.OrmException
- if a Gerrit-specific exception occurred.java.sql.SQLException
- if an underlying SQL exception occurred.protected void finish(CurrentSchemaVersion curr, ReviewDb db) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected static void renameTable(ReviewDb db, java.lang.String from, java.lang.String to) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected static void renameColumn(ReviewDb db, java.lang.String table, java.lang.String from, java.lang.String to) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected static void execute(ReviewDb db, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected static java.sql.Statement newStatement(ReviewDb db) throws java.sql.SQLException
java.sql.SQLException
protected static java.sql.PreparedStatement prepareStatement(ReviewDb db, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected static com.google.gwtorm.jdbc.JdbcExecutor newExecutor(ReviewDb db) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException