public function recordMigration($file, $scope, $hash, $direction, $status = 'success')
	{
		// Catch instances where we don't have a status field yet
		// and mimic prior behavior where these runs were not logged
		if (!$this->db->tableHasField($this->get('tbl_name'), 'status') && $status != 'success')
		{
			return true;
		}

		// Try inserting a migration record into the database
		try
		{
			$date = new \Hubzero\Utility\Date();

			// Craete our object to insert
			$obj = (object) array(
				'file'      => $file,
				'hash'      => $hash,
				'direction' => $direction,
				'date'      => $date->toSql(),
				'action_by' => (php_sapi_name() == 'cli') ? exec("whoami") : \User::get('id')
			);

			if ($this->db->tableHasField($this->get('tbl_name'), 'scope'))
			{
				$obj->scope = $scope;
			}

			if ($this->db->tableHasField($this->get('tbl_name'), 'status'))
			{
				$obj->status = $status;
			}

			$this->db->insertObject($this->get('tbl_name'), $obj);
			return true;
		}
		catch (\Hubzero\Database\Exception\QueryFailedException $e)
		{
			$this->log("Failed inserting migration record: {$e->getMessage()}", 'error');
			return false;
		}
	}
public function recordMigration($file, $scope, $hash, $direction, $status = 'success')
	{
		// Catch instances where we don't have a status field yet
		// and mimic prior behavior where these runs were not logged
		if (!$this->db->tableHasField($this->get('tbl_name'), 'status') && $status != 'success')
		{
			return true;
		}

		// Try inserting a migration record into the database
		try
		{
			$date = new \Hubzero\Utility\Date();

			// Craete our object to insert
			$obj = (object) array(
				'file'      => $file,
				'hash'      => $hash,
				'direction' => $direction,
				'date'      => $date->toSql(),
				'action_by' => (php_sapi_name() == 'cli') ? exec("whoami") : \User::get('id')
			);

			if ($this->db->tableHasField($this->get('tbl_name'), 'scope'))
			{
				$obj->scope = $scope;
			}

			if ($this->db->tableHasField($this->get('tbl_name'), 'status'))
			{
				$obj->status = $status;
			}

			$this->db->insertObject($this->get('tbl_name'), $obj);
			return true;
		}
		catch (\Hubzero\Database\Exception\QueryFailedException $e)
		{
			$this->log("Failed inserting migration record: {$e->getMessage()}", 'error');
			return false;
		}
	}
public function recordMigration ( $ file , $ scope , $ hash , $ direction , $ status = 'success' ) { // Catch instances where we don't have a status field yet // and mimic prior behavior where these runs were not logged if ( ! $ this -> db -> tableHasField ( $ this -> get ( 'tbl_name' ) , 'status' ) && $ status != 'success' ) { return true ; } // Try inserting a migration record into the database try { $ date = new \ Hubzero \ Utility \ Date ( ) ; // Craete our object to insert $ obj = ( object ) array ( 'file' => $ file , 'hash' => $ hash , 'direction' => $ direction , 'date' => $ date -> toSql ( ) , 'action_by' => ( php_sapi_name ( ) == 'cli' ) ? exec ( "whoami" ) : \ User :: get ( 'id' ) ) ; if ( $ this -> db -> tableHasField ( $ this -> get ( 'tbl_name' ) , 'scope' ) ) { $ obj -> scope = $ scope ; } if ( $ this -> db -> tableHasField ( $ this -> get ( 'tbl_name' ) , 'status' ) ) { $ obj -> status = $ status ; } $ this -> db -> insertObject ( $ this -> get ( 'tbl_name' ) , $ obj ) ; return true ; } catch ( \ Hubzero \ Database \ Exception \ QueryFailedException $ e ) { $ this -> log ( "Failed inserting migration record: {$e->getMessage()}" , 'error' ) ; return false ; } }
Record migration in migrations table

@param   string  $file       The path to file being recorded
@param   string  $scope      The folder of migration
@param   string  $hash       The hash of file
@param   string  $direction  Up or down
@param   string  $status     The status of the run
@return  bool
Record migration in migrations table