classes/MigrationModel.php
public function save($executeOnSave = true)
    {
        $this->validate();

        if (!strlen($this->scriptFileName) || !$this->isNewModel()) {
            $this->assignFileName();
        }

        $originalFileContents = $this->saveScriptFile();

        try {
            $originalVersionData = $this->insertOrUpdateVersion();
        } catch (Exception $ex) {
            // Remove the script file, but don't rollback 
            // the version.yaml.
            $this->rollbackSaving(null, $originalFileContents);

            throw $ex;
        }

        try {
            if ($executeOnSave) {
                VersionManager::instance()->updatePlugin($this->getPluginCodeObj()->toCode(), $this->version);
            }
        }
        catch (Exception $ex) {
            // Remove the script file, and rollback 
            // the version.yaml.
            $this->rollbackSaving($originalVersionData, $originalFileContents);

            throw $ex;
        }

        $this->originalVersion = $this->version;
        $this->exists = true;
    }
public function save($executeOnSave = true)
    {
        $this->validate();

        if (!strlen($this->scriptFileName) || !$this->isNewModel()) {
            $this->assignFileName();
        }

        $originalFileContents = $this->saveScriptFile();

        try {
            $originalVersionData = $this->insertOrUpdateVersion();
        } catch (Exception $ex) {
            // Remove the script file, but don't rollback 
            // the version.yaml.
            $this->rollbackSaving(null, $originalFileContents);

            throw $ex;
        }

        try {
            if ($executeOnSave) {
                VersionManager::instance()->updatePlugin($this->getPluginCodeObj()->toCode(), $this->version);
            }
        }
        catch (Exception $ex) {
            // Remove the script file, and rollback 
            // the version.yaml.
            $this->rollbackSaving($originalVersionData, $originalFileContents);

            throw $ex;
        }

        $this->originalVersion = $this->version;
        $this->exists = true;
    }
public function save ( $ executeOnSave = true ) { $ this -> validate ( ) ; if ( ! strlen ( $ this -> scriptFileName ) || ! $ this -> isNewModel ( ) ) { $ this -> assignFileName ( ) ; } $ originalFileContents = $ this -> saveScriptFile ( ) ; try { $ originalVersionData = $ this -> insertOrUpdateVersion ( ) ; } catch ( Exception $ ex ) { // Remove the script file, but don't rollback  // the version.yaml. $ this -> rollbackSaving ( null , $ originalFileContents ) ; throw $ ex ; } try { if ( $ executeOnSave ) { VersionManager :: instance ( ) -> updatePlugin ( $ this -> getPluginCodeObj ( ) -> toCode ( ) , $ this -> version ) ; } } catch ( Exception $ ex ) { // Remove the script file, and rollback  // the version.yaml. $ this -> rollbackSaving ( $ originalVersionData , $ originalFileContents ) ; throw $ ex ; } $ this -> originalVersion = $ this -> version ; $ this -> exists = true ; }
Saves the migration and applies all outstanding migrations for the plugin.
Saves the migration and applies all outstanding migrations for the plugin .