Smolder::Upgrade - Base class for Smolder upgrade modules
use base 'Smolder::Upgrade'; sub pre_db_upgrade {....} sub post_db_upgrade { ... }
This module is intended to be used as a parent class for Smolder upgrade modules.
The new() method is a constructor which creates a trivial object from a hash. Your upgrade modules may use this to store state information.
This method looks at the current db_version of the database being used and then decides which upgrade modules should be run. Upgrade modules are children of this module and have the following naming pattern: Smolder::Upgrade::VX_YZ where X.YZ is the version number.
Smolder::Upgrade::VX_YZ
X.YZ
So for example if the current version is at 1.35 and we are upgrading to 1.67, then any Smolder::Upgrade::VX_YZ modules between those 2 versions are run.
This method is called by upgrade() for each upgrade version module. It shouldn't be called directly from anyway else except for testing.
upgrade()
It performs the following steps:
Call the pre_db_upgrade method .
Run the SQL upgrade file found in sql/upgrade/ that has the same version which is named for this same version. So an upgrade module named V1_23 will run the upgrade/V1_23.sql file if it exists.
Call the post_db_upgrade method.
This method must be implemented in your subclass. It is called before the SQL upgrade file is run. It receives the Smolder::Platform class for the given platform.
This method must be implemented in your subclass. It is called after the SQL upgrade file is run. It receives the Smolder::Platform class for the given platform.
This method will take a given string and add it to the end of the current configuration file. This is useful for adding new required directives with a reasonable default.
To install Smolder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Smolder
CPAN shell
perl -MCPAN -e shell install Smolder
For more information on module installation, please visit the detailed CPAN module installation guide.