List migrations.
439649
def list(database=None, directory=None, verbose=None):
    """"""
    router = get_router(directory, database, verbose)
    click.echo('Migrations are done:')
    click.echo('\n'.join(router.done))
    click.echo('')
    click.echo('Migrations are undone:')
    click.echo('\n'.join(router.diff))
338818
protected function migrateTimeslots()
    {
        $this->output->info('### Migrating timeslots ###');
        foreach ($this->timeslots() as $timeslot) {
            $timeslot->showMigratingInfo($this->output,1);
            $this->migrateTimeslot($timeslot);
        }
        $this->output->info('### END OF Migrating timeslots ###');
    }
420805
public List<Migration> getPendingMigrations() {
        List<String> appliedMigrations = getAppliedMigrationVersions();

        List<Migration> allMigrations = migrationResolver.resolve();
        List<Migration> pendingMigrations = new ArrayList<Migration>();
        for (Migration migration : allMigrations) {
            if(!appliedMigrations.contains(migration.getVersion())){
                pendingMigrations.add(migration);
            }
        }
        return pendingMigrations;
    }
517655
def list_migrations(self):
        
        connection = connections[self._database_name]
        loader = MigrationLoader(connection, ignore_no_migrations=True)
        unapplied = self._get_unapplied_migrations(loader)
        currents = self._get_current_migration_state(loader, [u[0] for u in unapplied])
        return unapplied, currents
810619
public function getUpList() {
		$list = $this->getList();
		foreach($list as $migration=>$params) {
			if(!isset($params['migrated']))
				unset($list[$migration]);
		}
		return $list;
	}
928078
def listMigrationBlocks(self, migration_request_id=""):
        

        conn = self.dbi.connection()
        try:
            return self.mgrblklist.execute(conn, migration_request_id=migration_request_id)
        finally:
            if conn: conn.close()
1326131
protected function findApplicationMigrations(): array
	{
		$migrations = [];

		foreach($this->fileSystem->glob($this->application->getPath() . '/migrations/*.php') as $migration)
		{
			$migrations[] = (object) ['package' => null, 'version' => $this->getBasename($migration)];
		}

		return $migrations;
	}
191491
def migrate(name=None, database=None, directory=None, verbose=None, fake=False):
    """"""
    router = get_router(directory, database, verbose)
    migrations = router.run(name, fake=fake)
    if migrations:
        click.echo('Migrations completed: %s' % ', '.join(migrations))
112988
public function migrateUp()
    {
        $this->builder->table(
            $this->table,
            function ($table) {
                $table->string('medium')->nullable()->index();
                $table->string('source')->nullable()->index();
                $table->string('search_terms_hash')->nullable()->index();
            }
        );

        $this->builder->table($this->foreign, function ($table) {
            $table->foreign('referer_id', 'tracker_referers_referer_id_fk')
                ->references('id')
                ->on('tracker_referers')
                ->onUpdate('cascade')
                ->onDelete('cascade');
        });
    }
669697
def listMigrationRequests(self, migration_request_id="", block_name="",
                              dataset="", user="", oldest=False):
        

        conn = self.dbi.connection()
        migratee = ""
        try:
            if block_name:
                migratee = block_name
            elif dataset:
                migratee = dataset
            result = self.mgrlist.execute(conn, migration_url="",
                    migration_input=migratee, create_by=user,
                    migration_request_id=migration_request_id, oldest=oldest)
            return result

        finally:
            if conn: conn.close()
877540
public function migrate()
	{
		$this->msg( sprintf( 'Add new type columns for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->tables as $rname => $list ) {
			$this->addColumn( $rname, $list );
		}

		$this->msg( sprintf( 'Drop old unique indexes for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->constraints as $rname => $list ) {
			$this->dropIndex( $rname, $list );
		}

		$this->msg( sprintf( 'Migrate typeid to type for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->migrations as $rname => $list ) {
			$this->migrateData( $rname, $list );
		}
	}
441706
def migrate(self):
        """"""
        with io.open(self.json_file, 'rt', encoding='utf8') as fh:
            threads = json.load(fh)
        progress = Progress(len(threads))

        for i, thread in enumerate(threads):
            progress.update(i, str(i))
            self.insert(thread)

        progress.finish("{0} threads, {1} comments".format(len(threads), self.count))
416719
def setup_migrate(app):
    """"""
    directory = path.join(path.dirname(__file__), 'migrations')
    migrate.init_app(app, db, directory=directory)
1251084
def available_migrations():
    '''
    
    '''
    migrations = []
    for filename in resource_listdir('udata', 'migrations'):
        if filename.endswith('.js'):
            migrations.append(('udata', 'udata', filename))

    plugins = entrypoints.get_enabled('udata.models', current_app)
    for plugin, module in plugins.items():
        if resource_isdir(module.__name__, 'migrations'):
            for filename in resource_listdir(module.__name__, 'migrations'):
                if filename.endswith('.js'):
                    migrations.append((plugin, module.__name__, filename))
    return sorted(migrations, key=lambda r: r[2])
1211338
def get_migrations(self):
        
        return github.PaginatedList.PaginatedList(
            github.Migration.Migration,
            self._requester,
            "/orgs/" + self.login + "/migrations",
            None,
            headers={
                "Accept": Consts.mediaTypeMigrationPreview
            }
        )
688919
def migrate(self, migrations_package_name, up_to=9999):
        '''
        
        '''
        from .migrations import MigrationHistory
        logger = logging.getLogger('migrations')
        applied_migrations = self._get_applied_migrations(migrations_package_name)
        modules = import_submodules(migrations_package_name)
        unapplied_migrations = set(modules.keys()) - applied_migrations
        for name in sorted(unapplied_migrations):
            logger.info('Applying migration %s...', name)
            for operation in modules[name].operations:
                operation.apply(self)
            self.insert([MigrationHistory(package_name=migrations_package_name, module_name=name, applied=datetime.date.today())])
            if int(name[:4]) >= up_to:
                break
32108
private List<MigrationInfo> resolved(MigrationInfo[] migrationInfos) {
        if (migrationInfos.length == 0)
            throw new NotFoundException();
        List<MigrationInfo> resolvedMigrations = Lists.newArrayList();
        for (MigrationInfo migrationInfo : migrationInfos) {
            if (migrationInfo.getState().isResolved()) {
                resolvedMigrations.add(migrationInfo);
            }
        }

        return resolvedMigrations;
    }