Class DbScriptUpgradeOperation
- java.lang.Object
-
- org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
- org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
-
- org.craftercms.studio.impl.v2.upgrade.operations.db.DbScriptUpgradeOperation
-
- All Implemented Interfaces:
org.craftercms.commons.upgrade.UpgradeOperation<String>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
- Direct Known Subclasses:
MigrateWorkflowUpgradeOperation
,PopulateItemTableUpgradeOperation
public class DbScriptUpgradeOperation extends AbstractUpgradeOperation
Implementation ofUpgradeOperation
that executes a database script.Supported YAML properties:
- filename: (required) the name of the db script file
- updateIntegrity: (optional) indicates if the db integrity should be updated, defaults to true
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_KEY_FILENAME
static String
CONFIG_KEY_INTEGRITY
protected static String
CRAFTER_SCHEMA_NAME
protected String
fileName
Filename of the script.protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator
integrityValidator
The database integrity validator.protected String
scriptFolder
Path of the folder to search the script file.static String
SQL_DELIMITER
protected boolean
updateIntegrity
Indicates if the integrity value should be updated after executing the script.-
Fields inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
changedFiles, commitDetails, CONFIG_KEY_COMMIT_DETAILS, deletedFiles, servletContext, studioConfiguration
-
-
Constructor Summary
Constructors Constructor Description DbScriptUpgradeOperation(StudioConfiguration studioConfiguration, String scriptFolder, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doExecute(StudioUpgradeContext context)
void
doInit(org.apache.commons.configuration2.HierarchicalConfiguration config)
-
Methods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
commitAllChanges, doExecute, getCommitMessage, init, loadResource, setServletContext, trackChangedFiles, trackDeletedFiles
-
-
-
-
Field Detail
-
CONFIG_KEY_FILENAME
public static final String CONFIG_KEY_FILENAME
- See Also:
- Constant Field Values
-
CONFIG_KEY_INTEGRITY
public static final String CONFIG_KEY_INTEGRITY
- See Also:
- Constant Field Values
-
SQL_DELIMITER
public static final String SQL_DELIMITER
- See Also:
- Constant Field Values
-
CRAFTER_SCHEMA_NAME
protected static final String CRAFTER_SCHEMA_NAME
- See Also:
- Constant Field Values
-
scriptFolder
protected String scriptFolder
Path of the folder to search the script file.
-
fileName
protected String fileName
Filename of the script.
-
updateIntegrity
protected boolean updateIntegrity
Indicates if the integrity value should be updated after executing the script.
-
integrityValidator
protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator
The database integrity validator.
-
-
Constructor Detail
-
DbScriptUpgradeOperation
@ConstructorProperties({"studioConfiguration","scriptFolder","integrityValidator"}) public DbScriptUpgradeOperation(StudioConfiguration studioConfiguration, String scriptFolder, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator)
-
-
Method Detail
-
doInit
public void doInit(org.apache.commons.configuration2.HierarchicalConfiguration config)
- Overrides:
doInit
in classorg.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
doExecute
public void doExecute(StudioUpgradeContext context) throws org.craftercms.commons.upgrade.exception.UpgradeException
- Specified by:
doExecute
in classAbstractUpgradeOperation
- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException
-
-