Class MigrationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.codename1.migration.MigrationException
A migration run that was refused or failed.
getCode() says which, so a caller can tell
a database that is newer than the application from a script that did not run.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMigrator.clean()was called while clean is disabled.static final intA previous run left a migration marked failed; callMigrator.repair()after cleaning up.static final intThe database was migrated by a newer build than this one.static final intThe migration set itself is wrong: a duplicate version, a script missing for this engine.static final intAnother process held the migration lock for longer than this run was willing to wait.static final intThe database has tables and no history, and no baseline was requested.static final intA migration script or Java migration threw.static final intThe applied history does not match the migrations this build carries. -
Constructor Summary
ConstructorsConstructorDescriptionMigrationException(int code, String message) Creates a failure of the given kind.MigrationException(int code, String message, Throwable cause) Creates a failure of the given kind, keeping the database error that caused it. -
Method Summary
Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
VALIDATE_FAILED
public static final int VALIDATE_FAILEDThe applied history does not match the migrations this build carries.- See Also:
-
FAILED_MIGRATION_PRESENT
public static final int FAILED_MIGRATION_PRESENTA previous run left a migration marked failed; callMigrator.repair()after cleaning up.- See Also:
-
FUTURE_SCHEMA
public static final int FUTURE_SCHEMAThe database was migrated by a newer build than this one.- See Also:
-
CLEAN_DISABLED
public static final int CLEAN_DISABLEDMigrator.clean()was called while clean is disabled.- See Also:
-
LOCK_TIMEOUT
public static final int LOCK_TIMEOUTAnother process held the migration lock for longer than this run was willing to wait.- See Also:
-
SCRIPT_FAILED
public static final int SCRIPT_FAILEDA migration script or Java migration threw.- See Also:
-
NON_EMPTY_SCHEMA
public static final int NON_EMPTY_SCHEMAThe database has tables and no history, and no baseline was requested.- See Also:
-
INVALID_SET
public static final int INVALID_SETThe migration set itself is wrong: a duplicate version, a script missing for this engine.- See Also:
-
-
Constructor Details
-
MigrationException
Creates a failure of the given kind.- Parameters:
code- one of the constants of this classmessage- what was refused and what to do about it
-
MigrationException
-
-
Method Details
-
getCode
public int getCode()The kind of failure.- Returns:
- one of the constants of this class
-