required keys:
	    migration_status, migration_request_id
13838
def execute(self, conn, daoinput, transaction = False):
        	
        if not conn:
	    dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.", 
                                self.logger.exception)
        if daoinput['migration_status'] == 1:
           sql = self.sql2 
        elif daoinput['migration_status'] == 2:
            sql = self.sql + " and MIGRATION_STATUS = 1 "
        elif daoinput['migration_status'] == 3:
            sql = self.sql3 + " and MIGRATION_STATUS = 1 " 
        else:
            dbsExceptionHandler("dbsException-conflict-data", "Oracle/MigrationRequest/UpdateRequestStatus. Expected migration status to be 1, 2 or 3",
                                self.logger.exception)
        
	result = self.dbi.processData(sql, daoinput, conn, transaction)
1238716
def migrations_to_run(self):
        
        assert self.database_current_migration is not None

        db_current_migration = self.database_current_migration

        return [
            (migration_number, migration_func)
            for migration_number, migration_func in self.sorted_migrations
            if migration_number > db_current_migration]
416719
def setup_migrate(app):
    """"""
    directory = path.join(path.dirname(__file__), 'migrations')
    migrate.init_app(app, db, directory=directory)
349041
def list_migration_issues_courses(self, course_id, content_migration_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - content_migration_id
        """ID"""
        path["content_migration_id"] = content_migration_id

        self.logger.debug("GET /api/v1/courses/{course_id}/content_migrations/{content_migration_id}/migration_issues with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/content_migrations/{content_migration_id}/migration_issues".format(**path), data=data, params=params, all_pages=True)
301146
def _resolve(self, path, migration_file):
        
        variables = {}

        name = '_'.join(migration_file.split('_')[4:])
        migration_file = os.path.join(path, '%s.py' % migration_file)

        with open(migration_file) as fh:
            exec(fh.read(), {}, variables)

        klass = variables[inflection.camelize(name)]

        instance = klass()
        instance.set_schema_builder(self.get_repository().get_connection().get_schema_builder())

        return instance
300407
def run_migration(connection, queries, engine):
    

    # Execute query
    with connection.cursor() as cursorMig:
        # Parse statements
        queries = parse_statements(queries, engine)

        for query in queries:
            cursorMig.execute(query)
        connection.commit()

    return True
165303
def status(self, migration_rqst_id="", block_name="", dataset="", user=""):
        
        try:
            return self.dbsMigrate.listMigrationRequests(migration_rqst_id,
                block_name, dataset, user)
        except dbsException as de:
            dbsExceptionHandler(de.eCode, de.message, self.logger.exception, de.serverError)
        except Exception as ex:
            sError = "DBSMigrateModle/status. %s\n Exception trace: \n %s." \
                     % (ex, traceback.format_exc() )
	    if hasattr(ex, 'status') and ex.status == 400:
		dbsExceptionHandler('dbsException-invalid-input2', str(ex), self.logger.exception, sError)	
            else:
		dbsExceptionHandler('dbsException-server-error',  str(ex), self.logger.exception, sError)
443174
def get_migration_files(self):
        """"""
        migrations = (re.match(MigrationFile.PATTERN, filename)
                      for filename in os.listdir(self.directory))
        migrations = (MigrationFile(m.group('id'), m.group(0))
                      for m in migrations if m)
        return sorted(migrations, key=lambda m: m.id)
1356141
def migrate(engine, database, module, **kwargs):
    '''
    
    '''
    validate_args(engine, database, module)

    options = {
        'direction': kwargs.get('direction', 'up'),
        'fake': kwargs.get('fake', False),
        'force': kwargs.get('force', False),
        'migration': kwargs.get('migration', None),
        'transaction': kwargs.get('transaction', True),
    }

    Migration._meta.database = database
    migrator = DATABASE_MAP[engine](database, module, **options)
    migrator.run()
684834
protected function loadMigrations()
    {
        $migrationsDir = $this->docRoot . '/src/Database/Migrations';
        foreach (scandir($migrationsDir) as $file) {
            if ($file !== '.' && $file !== '..') {
                require "{$migrationsDir}/{$file}";
            }
        }
    }
1169193
def init(ctx):
    ''''''

    log.info('Apply DB migrations if needed')
    ctx.invoke(migrate, record=True)

    ctx.invoke(index)

    if IS_TTY:
        text = _('Do you want to create a superadmin user?')
        if click.confirm(text, default=True):
            user = ctx.invoke(user_commands.create)
            ctx.invoke(user_commands.set_admin, email=user.email)

        text = _('Do you want to import some data-related license?')
        if click.confirm(text, default=True):
            ctx.invoke(licenses)

        text = _('Do you want to create some sample data?')
        if click.confirm(text, default=True):
            ctx.invoke(generate_fixtures)

    success(_('Your udata instance is ready!'))
233975
def config_migration(migration_version)
      source = "#{Dir.pwd}/db/migrate/#{migration_version}_create_#{@scaffold_name}s.rb"
      modify_content(source, 'CreateMigration', "Create#{@model_class}s")   
      modify_content(source, 'migration', "#{@scaffold_name}s") 

      @arguments.each do |value| 
        @attributes << value.split(':').first 
        @data_types << value.split(':').last 
      end

      attribute_data_types = @data_types.reverse
      @attributes.reverse.each_with_index do |value,index|
        add_attributes(source, value, attribute_data_types[index])  
      end
    end
289756
def update_migration_info(direction)
      save, @verbose = @verbose, false

      create_migration_info_table_if_needed

      if direction.to_sym == :up
        execute("INSERT INTO #{migration_info_table} (#{migration_name_column}) VALUES (#{quoted_name})")
      elsif direction.to_sym == :down
        execute("DELETE FROM #{migration_info_table} WHERE #{migration_name_column} = #{quoted_name}")
      end
      @verbose = save
    end
954061
private function makeUp($current_migrations, $migrations)
    {
        if (count($current_migrations) == count($migrations)) {
            echo Color::green('Nothing to migrate.');
            
            return;
        }

        foreach ($migrations as $file => $migration) {
            if ($this->checkMigrationExistance($migration)) {
                continue;
            }

            // Include the migration file
            require $file;

            try {
                // Up migration
                (new $migration)->up();
            } catch (\Exception $exception) {
                $this->throwMigrationException($exception, $migration);
            }

            // Create new migration status
            $this->createMigrationStatus($migration);
        }

        foreach ($current_migrations as $migration) {
            $this->updateMigrationStatus(
                $migration->migration,
                $migration->batch + 1
            );
        }
    }
1123846
def get_migrations_to_down(self, migration_id):
        """"""
        migration_id = MigrationFile.validate_id(migration_id)
        if not migration_id:
            return []

        migrations = self.get_migration_files()
        last_migration_id = self.get_last_migrated_id()

        if migration_id in (m.id for m in self.get_unregistered_migrations()):
            logger.error('Migration is not applied %s' % migration_id)
            return []

        try:
            migration = [m for m in migrations if m.id == migration_id][0]
        except IndexError:
            logger.error('Migration does not exists %s' % migration_id)
            return []

        return list(reversed([m for m in migrations
                              if migration.id <= m.id <= last_migration_id]))
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,
        )
459728
def parse(self):
        """"""
        if not self.parsed.get('migration'):
            raise ParseError(u"'migration' key is missing", YAML_EXAMPLE)
        self.check_dict_expected_keys(
            {'options', 'versions'}, self.parsed['migration'], 'migration',
        )
        return self._parse_migrations()