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


PHP Migration::up方法代码示例

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


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

示例1: action

 public function action($argv)
 {
     $command = $argv[1];
     if ($command == 'migrate' || $command == '-m') {
         $migration = new Migration();
         $migration->up();
     } elseif ($command == 'rollback' || $command == '-r') {
         $migration = new Migration();
         $migration->rollback();
     } elseif ($command == 'status' || $command == '-s') {
         $migration = new Migration();
         $migration->printStatus();
     } elseif ($command === 'help' || $command == '-h') {
         Debug::out('Command: -h (help)');
         Debug::out('migrate or -m');
         Debug::out('rollback or -r');
         Debug::out('status or -s');
     } else {
         Debug::out('Command unknown. Try -h for help.');
     }
 }
开发者ID:RobinTheHood,项目名称:php-framework,代码行数:21,代码来源:migrate_script.php

示例2: runMigration

 /**
  * Runs a single migration.
  *
  * @param Migration $migration
  *
  * @return int
  */
 protected function runMigration(Migration $migration)
 {
     $result = $migration->up();
     $class = get_class($migration);
     $this->runStack[$class] = $migration;
     return $result;
 }
开发者ID:fuelphp,项目名称:migration,代码行数:14,代码来源:Main.php

示例3: load_file

function load_file($filepath)
{
    $rootPath = getcwd() . "/..";
    if (file_exists($rootPath . $filepath)) {
        require_once $rootPath . $filepath;
        return 1;
    } else {
        return 0;
    }
}
//Migrate
load_file('/config/config_local.php');
load_file('/library/debug.php');
load_file('/library/naming_convention.php');
load_file('/app/exception/database_exception.php');
load_file('/library/db/db.php');
load_file('/library/active_record.php');
load_file('/library/migration.php');
$migration = new Migration();
$migration->up();
//Seeds
load_file('/library/object.php');
load_file('/library/db/db_obj.php');
load_file('/library/db/db_model.php');
load_file('/library/db/repository.php');
load_file('/db/seed.php');
echo '== creating seed' . "\n";
$seed = new Seed();
$seed->create();
echo '== setup done' . "\n";
开发者ID:RobinTheHood,项目名称:php-framework,代码行数:30,代码来源:setup.php


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