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
Implementation of
UpgradeOperation 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final Stringprotected StringFilename of the script.protected org.craftercms.commons.entitlements.validator.DbIntegrityValidatorThe database integrity validator.protected StringPath of the folder to search the script file.static final Stringprotected booleanIndicates 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, studioConfigurationFields inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
applicationContext, currentVersion, enabled, nextVersion -
Constructor Summary
ConstructorsConstructorDescriptionDbScriptUpgradeOperation(StudioConfiguration studioConfiguration, String scriptFolder, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoExecute(StudioUpgradeContext context) voiddoInit(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, trackDeletedFilesMethods inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
execute, setApplicationContext, setEnabled
-
Field Details
-
CONFIG_KEY_FILENAME
- See Also:
-
CONFIG_KEY_INTEGRITY
- See Also:
-
SQL_DELIMITER
- See Also:
-
CRAFTER_SCHEMA_NAME
- See Also:
-
scriptFolder
Path of the folder to search the script file. -
fileName
Filename of the script. -
updateIntegrity
protected boolean updateIntegrityIndicates if the integrity value should be updated after executing the script. -
integrityValidator
protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidatorThe database integrity validator.
-
-
Constructor Details
-
DbScriptUpgradeOperation
@ConstructorProperties({"studioConfiguration","scriptFolder","integrityValidator"}) public DbScriptUpgradeOperation(StudioConfiguration studioConfiguration, String scriptFolder, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator)
-
-
Method Details
-
doInit
public void doInit(org.apache.commons.configuration2.HierarchicalConfiguration config) - Overrides:
doInitin classorg.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
doExecute
public void doExecute(StudioUpgradeContext context) throws org.craftercms.commons.upgrade.exception.UpgradeException - Specified by:
doExecutein classAbstractUpgradeOperation- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException
-