Beispiel #1
0
 function undo($filename, $name)
 {
     include_once getcwd() . '/migrations/' . $filename;
     $className = 'Migration_' . str_replace('.', '_', $name);
     $migration = new $className();
     $migration->down();
     //	mark it as applied
     SqlUpsertRow('migration', array('name' => $name), array('applied' => 0));
     print_r($migration);
 }
Beispiel #2
0
 static function undo($filename, $name, $type)
 {
     if ($type != 'migration' && $type != 'seed') {
         trigger_error("invalid migration type: {$type}");
     }
     $dirname = self::getDirName($type);
     include_once app_dir . '/' . $dirname . '/' . $filename;
     $className = ucfirst($type);
     $className = $className . '_' . str_replace('.', '_', $name);
     $migration = new $className();
     $migration->down();
     //	mark it as applied
     SqlUpsertRow($type, array('name' => $name), array('applied' => 0));
     print_r($migration);
 }