Documentation ¶
Overview ¶
As the loading process for change log
Index ¶
Constants ¶
View Source
const ESCAPED_DELIMITER = "!DBPATCH!ESCAPED_DELIMITER!"
Variables ¶
This section is empty.
Functions ¶
func ExecutePatches ¶
func ExecutePatches(changeLogConfig *ChangeLogConfig) (err error)
Executes the patches in change log
Types ¶
type ChangeLogConfig ¶
type ChangeLogConfig struct { DriverName string Dsn string ChangeLog string PatchFileBase string Delimiter string }
*
- The full configuration for running patches
func (*ChangeLogConfig) String ¶
func (changeLogConfig *ChangeLogConfig) String() string
The string representation of ChangeLogConfig
type PatchConfig ¶
type PatchConfig struct { // The id of patch Id string `yaml:"id"` // The file name of patch Filename string `yaml:"filename"` // The comment of patch Comment string `yaml:"comment"` }
As the patch configuration
func LoadChangeLog ¶
func LoadChangeLog(changeLogOfYaml []byte) (configOfPatches []PatchConfig, err error)
Loads configurations of patches from a string
func LoadChangeLogFromFile ¶
func LoadChangeLogFromFile(changeLogFile string) (configOfPatches []PatchConfig, err error)
Loads configurations of patches from a file name(path) The file would be auto-closed by this method
func LoadChangeLogFromReader ¶
func LoadChangeLogFromReader(readerOfchangeLog io.Reader) (configOfPatches []PatchConfig, err error)
Loads configurations of patches from a reader
Click to show internal directories.
Click to hide internal directories.