Perform forward migration.
174438
def database_forwards(self, app_label, schema_editor, from_state, to_state):
        """"""
        Process = from_state.apps.get_model('flow', 'Process')  # pylint: disable=invalid-name

        # Validate process types to ensure consistency.
        errors = validate_process_types(Process.objects.all())
        if errors:
            raise ValueError("Process type consistency check failed after migration: {}".format(errors))
706509
public function up()
	{
		if(! Schema::hasTable('001_006_profile'))
		{
			Schema::create('001_006_profile', function (Blueprint $table) {
				$table->engine = 'InnoDB';
				
				$table->increments('id_006')->unsigned();
				$table->string('name_006');
			});
		}
	}
1023801
public function up()
    {
        Schema::table($this->getTableName(), function (Blueprint $table) {
            $table->dropColumn('reserved');
            $table->index(['queue', 'reserved_at']);
        });

        Schema::table($this->getFailedTableName(), function (Blueprint $table) {
            $table->longText('exception')->nullable()->after('payload');
        });
    }
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))
532683
public function migrateUp()
    {
        $this->builder->table(
            $this->table,
            function ($table) {
                $table->bigInteger('language_id')->unsigned()->nullable()->index();
            }
        );
    }
158776
public function up()
    {
        Schema::table($this->tablename, function (Blueprint $table) {
            $table->dropIndex($this->tablename . '_' . $this->keyColumn . '_index');
            $table->unique($this->keyColumn, 'settings_key_unique');
        });
    }
106350
private function executeMigrations()
    {
        if ($this->migrator->needsToRun()) {
            $latestVersion = $this->migrator->migrate();
            $this->logger->info('Migrate all migrations up to version ' . $latestVersion . '.');
        }
    }
125842
protected function migrate()
    {
        if (! $this->container['migrator']->repositoryExists()) {
            throw new Exception('Migration table not found.');
        }

        $this->container['migrator']->run($this->getAttribute('path').'/database/migrations');
    }
246256
def forward(self, is_train=False):
        """"""
        for texec in self.train_execs:
            texec.forward(is_train=is_train)
385563
def run_all(self, direction):
        
        for key in sorted(migration_registry.keys):
            self.run(key, direction)
151347
def forwards(self, orm):
        ""
        samples = orm['samples.Sample'].objects.select_related('batch__project')
        for sample in samples:
            sample.project = sample.batch.project
            sample.save()
304739
def forwards(self, orm):
        ""
        for node in orm.FileNode.objects.all():
            node.save()
839270
def database_forwards(self, app_label, schema_editor, from_state, to_state):
        """"""
        from resolwe.flow.models.data import DataQuerySet
        # pylint: disable=protected-access

        Data = from_state.apps.get_model('flow', 'Data')  # pylint: disable=invalid-name
        DataQuerySet._delete_chunked(Data.objects.filter(process__slug=self.process))

        Process = from_state.apps.get_model('flow', 'Process')  # pylint: disable=invalid-name
        Process.objects.filter(slug=self.process).delete()
278434
def migrate(self, host, port, key, dest_db, timeout, *,
                copy=False, replace=False):
        """"""
        if not isinstance(host, str):
            raise TypeError("host argument must be str")
        if not isinstance(timeout, int):
            raise TypeError("timeout argument must be int")
        if not isinstance(dest_db, int):
            raise TypeError("dest_db argument must be int")
        if not host:
            raise ValueError("Got empty host")
        if dest_db < 0:
            raise ValueError("dest_db must be greater equal 0")
        if timeout < 0:
            raise ValueError("timeout must be greater equal 0")

        flags = []
        if copy:
            flags.append(b'COPY')
        if replace:
            flags.append(b'REPLACE')
        fut = self.execute(b'MIGRATE', host, port,
                           key, dest_db, timeout, *flags)
        return wait_ok(fut)
540348
public function up()
    {
        Schema::table('assets', function (Blueprint $table) {
            $table->timestamp('published_at')->useCurrent();
            $table->index('published_at');
        });

        DB::statement('update assets set published_at = from_unixtime(created_at)');
    }
920227
def load_migrations(self):  # pragma: no cover
        
        executor = MigrationExecutor(connection=None)

        # create the forwards plan Django would follow on an empty database
        plan = executor.migration_plan(executor.loader.graph.leaf_nodes(), clean_start=True)

        if self.verbosity >= 2:
            for migration, _ in plan:
                self.stdout.write(" > %s" % migration)

        return [m[0] for m in plan]
1364812
public function up()
    {
        Schema::create('languages', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100);
            $table->string('flag', 100)->nullable();
            $table->string('abbr', 3);
            $table->tinyInteger('active')->unsigned()->default('1');
            $table->tinyInteger('default')->unsigned()->default('0');
            $table->timestamps();
            $table->softDeletes();
        });
    }