Package com.jalios.jcms.db.update
Class SchemaUpdater
- java.lang.Object
-
- com.jalios.jcms.db.update.SchemaUpdater
-
public class SchemaUpdater extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CORE_SCOPE
static java.lang.String
JALIOS_SQL_SEPARATOR
static java.lang.String
SCOPE_FIELD
static java.lang.String
VERSION_FIELD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doSchemaUpdate()
Do schema update from sql files.SchemaVersion
getCoreVersion()
get the current Core schema version from dBstatic SchemaUpdater
getInstance()
protected static SchemaUpdater
getInstance(java.lang.String coreBaseDir, java.lang.String pluginsBaseDir, java.lang.String scopeSuffix)
To be only used by unit testSchemaVersion
getPluginVersion(java.lang.String pluginName)
get the current plugin schema version from dB
-
-
-
Field Detail
-
JALIOS_SQL_SEPARATOR
public static final java.lang.String JALIOS_SQL_SEPARATOR
- See Also:
- Constant Field Values
-
CORE_SCOPE
public static final java.lang.String CORE_SCOPE
- See Also:
- Constant Field Values
-
SCOPE_FIELD
public static final java.lang.String SCOPE_FIELD
- See Also:
- Constant Field Values
-
VERSION_FIELD
public static final java.lang.String VERSION_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static SchemaUpdater getInstance()
-
getInstance
protected static SchemaUpdater getInstance(java.lang.String coreBaseDir, java.lang.String pluginsBaseDir, java.lang.String scopeSuffix)
To be only used by unit test
-
getCoreVersion
public SchemaVersion getCoreVersion()
get the current Core schema version from dB- Returns:
- the
SchemaVersion
(null if not yet present in db)
-
getPluginVersion
public SchemaVersion getPluginVersion(java.lang.String pluginName)
get the current plugin schema version from dB- Parameters:
pluginName
- the name of the plugin- Returns:
- the
SchemaVersion
(null if not yet present in db)
-
doSchemaUpdate
public void doSchemaUpdate() throws java.lang.Exception
Do schema update from sql files. each schema version are done in distinct transaction- Throws:
java.lang.Exception
- Exception thrown if an update cannot be done
-
-