src/Db/Migration.php
public function up()
    {
        $transaction = $this->db->createTransaction();
        return $transaction->begin()->thenLazy(
            function($connection) {
                //Set transaction connection
                $this->_connection = $connection;
                $promise = $this->safeUp($connection);
                return is_array($promise) ? allInOrder($promise) : $promise;
            }
        )->thenLazy(
            function() use ($transaction) {
                return $transaction->commit();
            },
            function($error) use ($transaction) {
                $this->printException($error);
                return $transaction->rollBack()
                    ->always(function() {
                        //Remove transaction connection
                        $this->_connection = null;
                    })
                    ->then(
                    function() use ($error) { throw $error; },
                    function($e) { throw $e; }
                );
            }
        );
    }
public function up()
    {
        $transaction = $this->db->createTransaction();
        return $transaction->begin()->thenLazy(
            function($connection) {
                //Set transaction connection
                $this->_connection = $connection;
                $promise = $this->safeUp($connection);
                return is_array($promise) ? allInOrder($promise) : $promise;
            }
        )->thenLazy(
            function() use ($transaction) {
                return $transaction->commit();
            },
            function($error) use ($transaction) {
                $this->printException($error);
                return $transaction->rollBack()
                    ->always(function() {
                        //Remove transaction connection
                        $this->_connection = null;
                    })
                    ->then(
                    function() use ($error) { throw $error; },
                    function($e) { throw $e; }
                );
            }
        );
    }
This method contains the logic to be executed when applying this migration.
Child classes may override this method to provide actual migration logic.
@return ExtendedPromiseInterface
Resolved promise mean the migration succeeds and rejected - not.