(self, dbname, db)
Upgrade all schemas in single db.
Upgrade all schemas in single db.
Upgrade all schemas in single db .
def upgrade(self, dbname, db):
        """Upgrade all schemas in single db."""

        curs = db.cursor()
        ignore = {}
        for schema, ver, fn, recheck_func in version_list:
            # skip schema?
            if schema in ignore:
                continue
            if not skytools.exists_schema(curs, schema):
                ignore[schema] = 1
                continue

            # new enough?
            ok, oldver = check_version(curs, schema, ver, recheck_func, self.options.force)
            if ok:
                continue

            # too old schema, no way to upgrade
            if fn is None:
                self.log.info('%s: Cannot upgrade %s, too old version', dbname, schema)
                ignore[schema] = 1
                continue

            if self.options.not_really:
                self.log.info ("%s: Would upgrade '%s' version %s to %s", dbname, schema, oldver, ver)
                continue

            curs = db.cursor()
            curs.execute('begin')
            self.log.info("%s: Upgrading '%s' version %s to %s", dbname, schema, oldver, ver)
            skytools.installer_apply_file(db, fn, self.log)
            curs.execute('commit')
def upgrade ( self , dbname , db ) : curs = db . cursor ( ) ignore = { } for schema , ver , fn , recheck_func in version_list : # skip schema? if schema in ignore : continue if not skytools . exists_schema ( curs , schema ) : ignore [ schema ] = 1 continue # new enough? ok , oldver = check_version ( curs , schema , ver , recheck_func , self . options . force ) if ok : continue # too old schema, no way to upgrade if fn is None : self . log . info ( '%s: Cannot upgrade %s, too old version' , dbname , schema ) ignore [ schema ] = 1 continue if self . options . not_really : self . log . info ( "%s: Would upgrade '%s' version %s to %s" , dbname , schema , oldver , ver ) continue curs = db . cursor ( ) curs . execute ( 'begin' ) self . log . info ( "%s: Upgrading '%s' version %s to %s" , dbname , schema , oldver , ver ) skytools . installer_apply_file ( db , fn , self . log ) curs . execute ( 'commit' )