示例#1
0
function migrate($migration, $connection)
{
    echo 'importing ' . $migration . '... ';
    $connection->query(utf8_decode(Filesystem::read('db/migrations/' . $migration)));
    $connection->create(array('table' => 'schema_migrations', 'values' => array('version' => get_migration_version($migration))));
    echo 'done' . PHP_EOL;
}
示例#2
0
function migrate($migration, $connection)
{
    echo 'importing ' . $migration . '... ';
    $ext = Filesystem::extension($migration);
    if ($ext == 'php') {
        require_once 'db/migrations/' . $migration;
        $classname = get_migration_name($migration);
        $classname::migrate($connection);
    } else {
        $connection->query(utf8_decode(Filesystem::read('db/migrations/' . $migration)));
    }
    $connection->create(array('table' => 'schema_migrations', 'values' => array('version' => get_migration_version($migration))));
    echo 'done' . PHP_EOL;
}