Class LiquibaseRunnerContext
java.lang.Object
fr.paris.lutece.plugins.liquibase.LiquibaseRunnerContext
Static context holder for shared data during a liquibase run.
This class offers a static API so that filters instantiated by liquibase can access its state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBecause Function<ResultSet, T> does not throw -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic fr.paris.lutece.utils.sql.PluginVersioncomponentVersion(fr.paris.lutece.utils.sql.SqlPathInfo info) Looks the component version in the DB.static Connectionstatic booleanstatic booleanstatic booleanstatic booleanMigration mode is enabled when the property "liquibase.migration.mode" is set to truestatic booleanstatic StringpluginLastRunScriptType(String pluginName) Looks the type of the last run script (create/init or update) in the DB.static voidsetComponentVersion(String componentName, String version, boolean isTheme) Sets the plugin version in the datastore (later, when all SQL files have been executed)static voidsetPluginLastRunScriptType(String pluginName, String strLastRunTypeScript) Sets the type of the last run script (create/init or update) in the datastore (later, when all SQL files have been executed)static voidsetThemeLastRunScriptType(String themeName, String strLastRunTypeScript) Sets the type of the last run script (create/init or update) in the datastore (later, when all SQL files have been executed)
-
Field Details
-
LAST_RUN_SCRIPT_TYPE_CREATE
Last run script type (create/init)- See Also:
-
LAST_RUN_SCRIPT_TYPE_UPDATE
Last run script type (update)- See Also:
-
-
Constructor Details
-
LiquibaseRunnerContext
public LiquibaseRunnerContext()
-
-
Method Details
-
isEmptyDb
public static boolean isEmptyDb() -
isLiquibaseNeverRan
public static boolean isLiquibaseNeverRan() -
isAcceptSnapshotVersion
public static boolean isAcceptSnapshotVersion() -
isAcceptUnstableVersion
public static boolean isAcceptUnstableVersion() -
isEnableMigrationMode
public static boolean isEnableMigrationMode()Migration mode is enabled when the property "liquibase.migration.mode" is set to true -
getConnection
-
componentVersion
public static fr.paris.lutece.utils.sql.PluginVersion componentVersion(fr.paris.lutece.utils.sql.SqlPathInfo info) throws SQLException Looks the component version in the DB. "core" is a special case and always has a version : Integer.MAX_VALUE if no true version can be found, which is newer than all other versions and ensures that no attempt to run any core scripts is attempted when running liquibase for the first time on a existing DB.- Returns:
- the version as a string (for example "1.0.1"), or null if not found
- Throws:
SQLException
-
pluginLastRunScriptType
Looks the type of the last run script (create/init or update) in the DB.- Parameters:
pluginName- a name such as 'forms'- Returns:
- the type of the last run script as a string ("create/init" or "update"), or null if not found
- Throws:
SQLException
-
setComponentVersion
Sets the plugin version in the datastore (later, when all SQL files have been executed)- Parameters:
pluginName-version-
-
setPluginLastRunScriptType
Sets the type of the last run script (create/init or update) in the datastore (later, when all SQL files have been executed)- Parameters:
pluginName-version-
-
setThemeLastRunScriptType
Sets the type of the last run script (create/init or update) in the datastore (later, when all SQL files have been executed)- Parameters:
pluginName-version-
-