public class MigrationTable extends Object
| Constructor and Description |
|---|
MigrationTable(MigrationConfig config,
Connection connection,
boolean checkState)
Construct with server, configuration and jdbc connection (DB admin user).
|
| Modifier and Type | Method and Description |
|---|---|
void |
createIfNeededAndLock(MigrationPlatform platform)
Create the table is it does not exist.
|
Set<String> |
getVersions()
Returns the versions that are already applied.
|
boolean |
isEmpty()
Return true if there are no migrations.
|
List<LocalMigrationResource> |
runAll(List<LocalMigrationResource> localVersions)
Run all the migrations in order as needed.
|
List<LocalMigrationResource> |
runInit(LocalMigrationResource initVersion,
List<LocalMigrationResource> localVersions)
Run using an init migration.
|
int |
size()
Return the number of migrations in the DB migration table.
|
public MigrationTable(MigrationConfig config, Connection connection, boolean checkState)
public int size()
public Set<String> getVersions()
public void createIfNeededAndLock(MigrationPlatform platform) throws SQLException, IOException
Also holds DB lock on migration table and loads existing migrations.
SQLExceptionIOExceptionpublic boolean isEmpty()
public List<LocalMigrationResource> runAll(List<LocalMigrationResource> localVersions) throws SQLException
SQLExceptionpublic List<LocalMigrationResource> runInit(LocalMigrationResource initVersion, List<LocalMigrationResource> localVersions) throws SQLException
SQLExceptionCopyright © 2019. All rights reserved.