Rollback migration from the specified component.

@param $component
429414
public function reset($component)
    {
        if (is_string($component)) {
            $component = $this->laravel['components']->findOrFail($component);
        }

        $migrator = new Migrator($component);

        $database = $this->option('database');

        if (!empty($database)) {
            $migrator->setDatabase($database);
        }

        $migrated = $migrator->reset();

        if (count($migrated)) {
            foreach ($migrated as $migration) {
                $this->line("Rollback: <info>{$migration}</info>");
            }

            return;
        }

        $this->comment('Nothing to rollback.');
    }
556208
public function migrate($plugin = null)
    {
        $plugin = ($plugin === null)? '' : ' -p ' . $plugin;
        $this->dispatchShell('migrations migrate' . $plugin);
    }
7756
protected function addComponent($component, $value)
    {
        $this->validateComponentExists($component);

        // We need to make sure the value we're given isn't empty before adding it into our components.
        if (! empty($value)) {
            $this->components[$component][] = $value;
        }
    }
895237
public function update(Component $component)
    {
        try {
            execute(new UpdateComponentCommand(
                $component,
                Binput::get('name'),
                Binput::get('description'),
                Binput::get('status'),
                Binput::get('link'),
                Binput::get('order'),
                Binput::get('group_id'),
                Binput::get('enabled', $component->enabled),
                Binput::get('meta', null),
                (bool) Binput::get('silent', false)
            ));
        } catch (QueryException $e) {
            throw new BadRequestHttpException();
        }

        if (Binput::has('tags')) {
            $component->tags()->delete();

            // The component was added successfully, so now let's deal with the tags.
            Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
                return trim($tag);
            })->map(function ($tag) {
                return execute(new CreateTagCommand($tag));
            })->each(function ($tag) use ($component) {
                execute(new ApplyTagCommand($component, $tag));
            });
        }

        return $this->item($component);
    }
731871
public function down(SessionInterface $session)
    {
        $this->session = $session;
        $this->iterateStructures(false);
        $this->upgradeExternalLinks(false);
    }
1217220
public function replaceBy (array $components = null)
  {
    $p = $this->getIndex ();
    if ($p !== false) {
      array_splice ($this->parent->children, $p, 1, $components);
      $this->parent->attach ($components);
    }
    else {
      $t = ComponentInspector::inspectSet ($this->parent->children);
      throw new ComponentException($this,
        "The component was not found on the parent's children.<h3>The children are:</h3><fieldset>$t</fieldset>");
    }
  }
439175
private function setRootComponent( common_configuration_Component $component)
    {
        
        $this->rootComponent = $component;
        $components = $this->getComponents();
        $components[] = $component;
        $this->setComponents($components);
        $this->silent($component);
        
    }
1172749
public function rollback($e) {
        if ($this->is_disposed()) {
            throw new dml_transaction_exception('Transactions already disposed', $this);
        }
        $this->database->rollback_delegated_transaction($this, $e);
    }
460781
public function set_component($component) {
        $this->areacache = null;
        list($type, $name) = core_component::normalize_component($component);
        $this->component = $type.'_'.$name;
    }
1314907
protected function runDown($file, $migration)
    {
        $file     = $this->migrator->getMigrationName($file);
        $instance = $this->migrator->resolve($file);

        $instance->down();

        $this->migrator->getRepository()->delete($migration);

        $this->info("Rolledback: ".$file);
    }
1107415
public function migrates($migrate)
    {
        $token = $this->addTokenCallback($migrate['callback']);
        sd_call_user_func($migrate['callback'], new CoroutineChangeToken($token));
        unset($migrate['callback']);
        $migrate['token'] = $token;
        $this->execute($migrate);
    }
168292
protected function rollback()
    {
        if (!$this->isUpdate() || ($this->isUpdate() && $this->renamed)) {
            gplcart_file_delete_recursive($this->destination);
        }

        if (isset($this->tempname)) {
            rename($this->tempname, $this->destination);
        }
    }
576143
public function rollback()
    {
        $this->initConnect(true);

        if (1 == $this->transTimes) {
            $this->linkID->rollBack();
        } elseif ($this->transTimes > 1 && $this->supportSavepoint()) {
            $this->linkID->exec(
                $this->parseSavepointRollBack('trans' . $this->transTimes)
            );
        }

        $this->transTimes = max(0, $this->transTimes - 1);
    }
888818
public function rollback(?int $batches = null): void
	{
		$migrations = $this->getMigrated($batches);

		if($migrations->isEmpty())
		{
			$this->write('<blue>There are no migrations to roll back.</blue>');

			return;
		}

		foreach($migrations as $migration)
		{
			$this->runMigration($migration, 'down');
		}

		$this->write('Rolled back the following migrations:' . PHP_EOL);

		$this->outputMigrationList($migrations->getItems());
	}
400266
public function addComponent(ComponentInterface $component)
    {
        $component->preMergeParams($this);
        return $this->overwriteWith($component->toArray());
    }
359970
private function updateComponentVersionFile($version, array $component)
    {
        $path = $this->rootPath() .'/'. $component['path'] .'/VERSION';
        $result = file_put_contents($path, $version);

        if (!$result) {
            throw new \RuntimeException('File write failed');
        }

        return true;
    }
456827
public function reset_components( array $components )
    {
        foreach( $components as $component )
        {
            $this->reset_component($component);
        }
        return $this->final_instance;
    }