This method contains the logic to be executed when removing this migration.
Child classes may override this method if the corresponding migrations can be removed.
@return boolean Returning false means, the migration will not be applied.
166994
public function down()
	{
		$transaction=$this->getDbConnection()->beginTransaction();
		try
		{
			if($this->safeDown()===false)
			{
				$transaction->rollback();
				return false;
			}
			$transaction->commit();
		}
		catch(Exception $e)
		{
			echo "Exception: ".$e->getMessage().' ('.$e->getFile().':'.$e->getLine().")\n";
			echo $e->getTraceAsString()."\n";
			$transaction->rollback();
			return false;
		}
	}
920947
public function rollback(): bool {
        if ($this->transactionExists) {
            $rolledBack = $this->pdo->rollBack();
            $this->transactionExists = !$rolledBack;
            return $rolledBack;
        }
        return false;
    }
1183903
protected function alreadyExecutedMigrations()
    {
        $results = $this->db->query(
            'SELECT * FROM `app_migrations`',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        return (array) iterator_to_array($results, true);
    }
203162
public function clear()
    {
        try {
            $this->db->from($this->table)->delete();
        } catch (PDOException $e) {
            return false;
        }

        return true;
    }
537228
public function delete(): bool
    {
        /**
         * Execute pre-DELETE logic
         */
        $this->beforeDelete();

        $primaryKey = $this->getPrimaryKey();

        /**
         * Execute the DELETE (this may throw an exception)
         */
        $table = $this->getTable();
        $result = $table::delete($primaryKey);

        /**
         * Execute post-DELETE logic
         */
        $this->afterDelete();

        /**
         * Reset all fields to null to indicate that the row is not there
         */
        $this->resetArray();

        return $result > 0;
    }
1208244
private function isDatabaseAlreadyMigrated()
    {
        if (!is_null($this->isDatabaseAlreadyMigrated)) {
            return $this->isDatabaseAlreadyMigrated;
        }

        return ($this->isDatabaseAlreadyMigrated = Schema::hasTable('squanto_lines'));
    }
1170425
public function migrate($destroy = false): bool
    {
        if ($destroy) {
            $this->getHandler()->destroy($this->getId());
        }
        $this->setId($this->generateSessionId());
        return true;
    }
478080
private function importMigrations()
	{
		$databaseFolder = base_path( 'resources/database/migrations/' );
		if( ! file_exists( $databaseFolder ) ) {
			return $this->line( 'no migrations to move' );
		}
		$this->moveFilesToDatabaseMigrations( $databaseFolder );
	}
1368203
public function remove()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_diff($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
783555
private function _removeDisabledRelations()
    {
        if (!$this->attrActive) {
            return false;
        }

        foreach ($this->_relationsToSave as $key => $rel) {

            if (!isset($rel->{$this->attrActive})) {
                continue;
            }

            if (!$rel->validate() && !$rel->{$this->attrActive}) {
                ArrayHelper::remove($this->_relationsToSave, $key);
            }
        }

        return true;
    }
217674
public function remove()
    {
        if (!isset($this->_pkValue)) {
            return false;
        }
        if (self::delete($this->_pkValue) > 0) {
            $this->_pkValue = null;
            return true;
        }
        return false;
    }
886728
public function down()
    {
        if (Schema::hasColumn('permissions', 'table_name')) {
            return false;
        }

        Schema::table('permissions', function (Blueprint $table) {
            $table->renameColumn('slug', 'table_name');
        });

        $dataTypes = DataType::all();
        $permissions = Permission::whereNotNull('table_name')->get();

        foreach ($permissions as $permission) {
            $dataType = $dataTypes->where('slug', $permission->table_name)->first();

            if ($dataType && $dataType->slug) {
                $permission->key = str_replace($dataType->slug, $dataType->name, $permission->key);
                $permission->table_name = $dataType->name;
                $permission->save();
            }
        }
    }
759653
public function delete(): bool
	{
		if($this->isPersisted)
		{
			$deleted = $this->deleteRecord($this->builder());

			if($deleted)
			{
				$this->isPersisted = false;
				$this->original    = [];
				$this->related     = [];
			}

			return $deleted;
		}

		return false;
	}
1195366
public function createMigration()
    {
        $migration = $this->laravel->path . '/database/migrations/' . date('Y_m_d_His') . '_drawbridge_migrations_tables.php';
        $view = $this->laravel->make('view')->make('drawbridge::migration')->render();

        if (! file_exists($migration))
        {
            $fs = fopen($migration, 'x');
            if ($fs)
            {
                fwrite($fs, $view);
                fclose($fs);
                return true;
            }
        }

        return false;
    }
112265
public function uninstall()
    {
        /*
         * Rollback plugins
         */
        $plugins = $this->pluginManager->getPlugins();
        foreach ($plugins as $name => $plugin) {
            $this->rollbackPlugin($name);
        }

        /*
         * Register module migration files
         */
        $paths = [];
        $modules = Config::get('cms.loadModules', []);

        foreach ($modules as $module) {
            $paths[] = $path = base_path() . '/modules/'.strtolower($module).'/database/migrations';
        }

        /*
         * Rollback modules
         */
        while (true) {
            $rolledBack = $this->migrator->rollback($paths, ['pretend' => false]);

            foreach ($this->migrator->getNotes() as $note) {
                $this->note($note);
            }

            if (count($rolledBack) == 0) {
                break;
            }
        }

        Schema::dropIfExists($this->getMigrationTableName());

        return $this;
    }
1163370
public function delete()
    {
        $return = false;
        if (isset($this->tokenId)) {
            $return = $this->apiCall->delete(
                $this->endpoint.'/delete',
                array('tokenId'=>$this->tokenId)
            );
        }
        return $return;
    }
343226
public function remove()
    {
        $returnValue = (bool) false;

        
        $db = core_kernel_classes_DbWrapper::singleton();
        if (false === $db->exec("DELETE FROM statements WHERE modelid = ?", array($this->getModelId()))){
        	$returnValue = false;
        }
        else{
        	if (false === $db->exec("DELETE FROM models WHERE modelid = ?", array($this->getModelId()))){
        		$returnValue = false;
        	}
        	else{
        		$returnValue = true;
        	}
        }
        
        

        return (bool) $returnValue;
    }