Build :class:`MigrationOption` and
        :class:`MigrationBackupOption` instances.
338204
def _parse_options(self, migration):
        """"""
        options = migration.get('options', {})
        install_command = options.get('install_command')
        backup = options.get('backup')
        if backup:
            self.check_dict_expected_keys(
                {'command', 'ignore_if', 'stop_on_failure'},
                options['backup'], 'backup',
            )
            backup = MigrationBackupOption(
                command=backup.get('command'),
                ignore_if=backup.get('ignore_if'),
                stop_on_failure=backup.get('stop_on_failure', True),
            )
        return MigrationOption(
            install_command=install_command,
            backup=backup,
        )
764589
def create_migrations
      Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath|
        name = File.basename(filepath)
        template "migrations/#{name}", "db/migrate/#{name}"
        sleep 1
      end
    end
456467
def collect(package='perch.migrations'):
    
    package = importlib.import_module(package)

    for loader, name, is_pkg in pkgutil.walk_packages(package.__path__):
        importlib.import_module(package.__name__ + '.' + name)

    return _migrations
1363399
public function buildRelations()
    {
        $this->command->buildMethod($this->model, 'morphTo', null, $this->options);

        foreach ($this->toModels as $key => $toModel) {
            $options = $this->options;
            $options['primary_key'] = $this->options['primary_key'][$key];
            $this->command->buildMethod($toModel, 'morphMany', $this->model, $options);
        }
    }
983388
protected function createMigration()
    {
        $table = Str::plural(Str::snake(class_basename($this->argument('name'))));

        $this->call('make:migration', [
            'name' => "create_{$table}_table",
            '--create' => $table,
        ]);
    }
886011
function create(){
        var cmd = (migrateBinPath + " create " + grunt.option('name')).trim();

        grunt.log.write('Creating a new migration named "' + grunt.option('name') + '"...').ok();
        run(cmd);
    }
362705
def list_migration_choice(cls, datacenter):
        """"""
        datacenter_id = cls.usable_id(datacenter)
        dc_list = cls.list()
        available_dcs = [dc for dc in dc_list
                         if dc['id'] == datacenter_id][0]['can_migrate_to']
        choices = [dc for dc in dc_list
                   if dc['id'] in available_dcs]
        return choices
441471
def build(options = {})
      @stack.reverse.inject(nil) do |backend, (klass, opts)|
        klass.new backend, @options.merge(opts).merge(options)
      end
    end
1052346
public RolloutOptions withFallback(final RolloutOptions that) {
    return RolloutOptions.newBuilder()
        .setTimeout(firstNonNull(timeout, that.timeout))
        .setParallelism(firstNonNull(parallelism, that.parallelism))
        .setMigrate(firstNonNull(migrate, that.migrate))
        .setOverlap(firstNonNull(overlap, that.overlap))
        .setToken(firstNonNull(token, that.token))
        .setIgnoreFailures(firstNonNull(ignoreFailures, that.ignoreFailures))
        .build();
  }
214473
def _parse_migrations(self):
        """"""
        migration = self.parsed['migration']
        options = self._parse_options(migration)
        versions = self._parse_versions(migration, options)
        return Migration(versions, options)
211852
def initiate_migration(self):
        
        self._client.post('{}/migrate'.format(Instance.api_endpoint), model=self)
154268
def _migrate_single(self, conn, migration):
        """"""
        with contextlib.ExitStack() as stack:
            for wrapper in self._wrappers:
                stack.enter_context(wrapper(conn))
            migration.func(conn)
1049018
def execute_migration(self, migration_file_relative):
        
        migration_file = os.path.join(self.db_config['migrations_dir'], migration_file_relative)
        m_type = self.repository.migration_type(migration_file)
        if m_type == 'native':
            return self.execute_native_migration(migration_file)
        if m_type == 'py':
            module = imp.load_source('migration_module', migration_file)
            return self.execute_python_migration(migration_file, module)
        assert False, 'Unknown migration type %s' % migration_file
521101
public function reloadFixtures()
    {
        if ( ! $this->useBackup) {
            $this->loadFixtures();

            return;
        }

        if ($this->hasBackup()) {
            $this->restoreBackup();

            $this->getReferenceRepository()
                 ->load($this->getBackupFile());

            return;
        }

        if ($this->migrations === null) {
            $this->dropDatabase();
            $this->createDatabase();
        }

        $this->loadFixtures();
        $this->createBackup();

        $this->getReferenceRepository()
             ->save($this->getBackupFile());
    }
993984
@SuppressWarnings("static-access")
    private static synchronized Options buildOptions() {
        Options options = new Options();
        options.addOption(OptionBuilder.hasArg().withArgName("path").withDescription("Specify where to find the class files - must be first argument").create("classpath"));
        options.addOption(OptionBuilder.withLongOpt("classpath").hasArg().withArgName("path").withDescription("Aliases for '-classpath'").create("cp"));

        options.addOption(
            OptionBuilder.withLongOpt("define").
            withDescription("define a system property").
            hasArg(true).
            withArgName("name=value").
            create('D'));
        options.addOption(
            OptionBuilder.withLongOpt("disableopt").
            withDescription("disables one or all optimization elements. " +
                            "optlist can be a comma separated list with the elements: " +
                            "all (disables all optimizations), " +
                            "int (disable any int based optimizations)").
            hasArg(true).
            withArgName("optlist").
            create());
        options.addOption(
            OptionBuilder.hasArg(false)
            .withDescription("usage information")
            .withLongOpt("help")
            .create('h'));
        options.addOption(
            OptionBuilder.hasArg(false)
            .withDescription("debug mode will print out full stack traces")
            .withLongOpt("debug")
            .create('d'));
        options.addOption(
            OptionBuilder.hasArg(false)
            .withDescription("display the Groovy and JVM versions")
            .withLongOpt("version")
            .create('v'));
        options.addOption(
            OptionBuilder.withArgName("charset")
            .hasArg()
            .withDescription("specify the encoding of the files")
            .withLongOpt("encoding")
            .create('c'));
        options.addOption(
            OptionBuilder.withArgName("script")
            .hasArg()
            .withDescription("specify a command line script")
            .create('e'));
        options.addOption(
            OptionBuilder.withArgName("extension")
            .hasOptionalArg()
            .withDescription("modify files in place; create backup if extension is given (e.g. \'.bak\')")
            .create('i'));
        options.addOption(
            OptionBuilder.hasArg(false)
            .withDescription("process files line by line using implicit 'line' variable")
            .create('n'));
        options.addOption(
            OptionBuilder.hasArg(false)
            .withDescription("process files line by line and print result (see also -n)")
            .create('p'));
        options.addOption(
            OptionBuilder.withArgName("port")
            .hasOptionalArg()
            .withDescription("listen on a port and process inbound lines (default: 1960)")
            .create('l'));
        options.addOption(
            OptionBuilder.withArgName("splitPattern")
            .hasOptionalArg()
            .withDescription("split lines using splitPattern (default '\\s') using implicit 'split' variable")
            .withLongOpt("autosplit")
            .create('a'));
        options.addOption(
            OptionBuilder.withLongOpt("indy")
            .withDescription("enables compilation using invokedynamic")
            .create());
        options.addOption(
            OptionBuilder.withLongOpt("configscript")
            .hasArg().withDescription("A script for tweaking the configuration options")
            .create());
        options.addOption(
                OptionBuilder.withLongOpt("basescript")
                .hasArg().withArgName("class").withDescription("Base class name for scripts (must derive from Script)")
                .create('b'));
        return options;

    }
377313
def register_migration(self, migration: 'Migration'):
        
        if migration.from_ver >= migration.to_ver:
            raise ValueError('Migration cannot downgrade verson')
        if migration.from_ver != self._final_ver:
            raise ValueError('Cannot register disjoint migration')
        self._migrations[migration.from_ver] = migration
        self._final_ver = migration.to_ver
801588
def migration(resource, version, previous_version=''):
    """"""
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            migrated = func(*args, **kwargs)

            return migrated

        m = Migration(wrapper, resource, version, previous_version)
        m.register()

        return m

    return decorator