migrations/Migration.php
public function up()
    {
        $transaction = $this->authManager->db->beginTransaction();

        try {
            if ($this->safeUp() === false) {
                $transaction->rollBack();
                return false;
            }
            $transaction->commit();
            $this->authManager->invalidateCache();
            return true;
        } catch (\Exception $e) {
            echo "Rolling transaction back\n";
            echo 'Exception: ' . $e->getMessage() . ' (' . $e->getFile() . ':' . $e->getLine() . ")\n";
            echo $e->getTraceAsString() . "\n";
            $transaction->rollBack();
            return false;
        }
    }
public function up()
    {
        $transaction = $this->authManager->db->beginTransaction();

        try {
            if ($this->safeUp() === false) {
                $transaction->rollBack();
                return false;
            }
            $transaction->commit();
            $this->authManager->invalidateCache();
            return true;
        } catch (\Exception $e) {
            echo "Rolling transaction back\n";
            echo 'Exception: ' . $e->getMessage() . ' (' . $e->getFile() . ':' . $e->getLine() . ")\n";
            echo $e->getTraceAsString() . "\n";
            $transaction->rollBack();
            return false;
        }
    }
public function up ( ) { $ transaction = $ this -> authManager -> db -> beginTransaction ( ) ; try { if ( $ this -> safeUp ( ) === false ) { $ transaction -> rollBack ( ) ; return false ; } $ transaction -> commit ( ) ; $ this -> authManager -> invalidateCache ( ) ; return true ; } catch ( \ Exception $ e ) { echo "Rolling transaction back\n" ; echo 'Exception: ' . $ e -> getMessage ( ) . ' (' . $ e -> getFile ( ) . ':' . $ e -> getLine ( ) . ")\n" ; echo $ e -> getTraceAsString ( ) . "\n" ; $ transaction -> rollBack ( ) ; return false ; } }
This method contains the logic to be executed when applying this migration.
Child classes should not override this method, but use safeUp instead.

@return boolean return a false value to indicate the migration fails
and should not proceed further. All other return values mean the migration succeeds.
This method contains the logic to be executed when applying this migration . Child classes should not override this method but use safeUp instead .