当前位置: 首页>>代码示例>>PHP>>正文


PHP Migrator::rollback方法代码示例

本文整理汇总了PHP中Illuminate\Database\Migrations\Migrator::rollback方法的典型用法代码示例。如果您正苦于以下问题:PHP Migrator::rollback方法的具体用法?PHP Migrator::rollback怎么用?PHP Migrator::rollback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\Migrations\Migrator的用法示例。


在下文中一共展示了Migrator::rollback方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->migrator->setConnection($this->input->getOption('database'));
     $pretend = $this->input->getOption('pretend');
     while ($this->migrator->rollback($this->output, $pretend)) {
     }
 }
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:12,代码来源:ResetCommand.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->migrator->setConnection($this->input->getOption('database'));
     $pretend = $this->input->getOption('pretend');
     $this->migrator->rollback($pretend);
     // Once the migrator has run we will grab the note output and send it out to
     // the console screen, since the migrator itself functions without having
     // any instances of the OutputInterface contract passed into the class.
     foreach ($this->migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
开发者ID:defra91,项目名称:levecchiecredenze.it,代码行数:17,代码来源:RollbackCommand.php

示例3: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->migrator->setConnection($this->option('database'));
     $paths = $this->getMigrationPaths();
     $this->migrator->rollback($paths, ['pretend' => $this->option('pretend'), 'step' => (int) $this->option('step')]);
     foreach ($this->migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
开发者ID:caffeinated,项目名称:modules,代码行数:17,代码来源:ModuleMigrateRollbackCommand.php

示例4: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->migrator->setConnection($this->option('database'));
     $this->migrator->rollback($this->getMigrationPaths(), ['pretend' => $this->option('pretend'), 'step' => (int) $this->option('step')]);
     // Once the migrator has run we will grab the note output and send it out to
     // the console screen, since the migrator itself functions without having
     // any instances of the OutputInterface contract passed into the class.
     foreach ($this->migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
开发者ID:mark86092,项目名称:laravel-framework,代码行数:19,代码来源:RollbackCommand.php

示例5: rollbackModules

 /**
  * @return $this
  */
 public function rollbackModules()
 {
     while (true) {
         $count = $this->migrator->rollback();
         foreach ($this->migrator->getNotes() as $note) {
             $this->output($note);
         }
         if ($count == 0) {
             break;
         }
     }
     return $this;
 }
开发者ID:aselushat,项目名称:module-loader,代码行数:16,代码来源:ModulesInstaller.php

示例6: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $config = (require __DIR__ . '/../config.php');
     $capsule = new Manager();
     $capsule->addConnection($config);
     $capsule->bootEloquent();
     Schema::setConnection($capsule->getConnection('default'));
     DB::setConnection($capsule->getConnection('default'));
     // run the migrations
     $migration_repo = new DatabaseMigrationRepository(Model::getConnectionResolver(), 'migrations');
     if (!$migration_repo->repositoryExists()) {
         $migration_repo->createRepository();
     }
     $migrator = new Migrator($migration_repo, Model::getConnectionResolver(), new Filesystem());
     $migrator->rollback();
     $migrator->run(__DIR__ . '/../../src/migrations');
     static::loadFixtures();
 }
开发者ID:dadleyy,项目名称:lvpress,代码行数:19,代码来源:TestCase.php

示例7: resetModules

 /**
  * @return $this
  */
 public function resetModules()
 {
     $this->output('Starting process of reseting...');
     foreach ($this->_modules as $module) {
         $this->resetModule($module);
     }
     /*
      * Rollback modules
      */
     while (true) {
         $count = $this->_migrator->rollback();
         foreach ($this->_migrator->getNotes() as $note) {
             $this->output($note);
         }
         if ($count == 0) {
             break;
         }
     }
     return $this;
 }
开发者ID:BlueCatTAT,项目名称:kodicms-laravel,代码行数:23,代码来源:ModuleInstaller.php

示例8: rollback

 /**
  * Rollback the last migration operation. Overridden from parent to allow loading of files from the appropriate paths
  *
  * @param  bool  $pretend
  * @return int
  */
 public function rollback($pretend = false)
 {
     $migrations = $this->repository->getLast();
     $this->requireFilesFromMigrations($migrations);
     parent::rollback($pretend);
 }
开发者ID:Zingle,项目名称:laravel5-migrator,代码行数:12,代码来源:Migrator.php

示例9: rollback

 /**
  * Rollback the last migration operation.
  *
  * @param  array|string $paths
  * @param  array        $options
  * @return array
  */
 public function rollback($paths = [], array $options = [])
 {
     $this->repository->setAddon($this->getAddon());
     return parent::rollback($paths, $options);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:12,代码来源:Migrator.php


注:本文中的Illuminate\Database\Migrations\Migrator::rollback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。