To upgrade to 1.7.1
351629
public function Upgrade170to171()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 57);

        $this->_batch->addTask('Echo', $this->_('Make sure to read the changelog as it contains important instructions'));
        $this->_batch->addTask('Echo', $this->_('Check the Code compatibility report for any issues with project specific code!'));

        return true;
    }
869081
def upgrade(self, package, force=False):
        """"""
        self.install(package, upgrade=True, force=force)
880801
public function Upgrade16to161()
    {
        $this->_batch->addTask('Db_AddPatches', 52);

        $this->_batch->addTask('Echo', $this->_('Make sure to read the changelog as it contains important instructions'));

        return true;
    }
477459
def upgrade_v1_1_v1_5
      with_collection_lock do
        temp_dir = Pathname.new(Dir.mktmpdir(TEMP_PREFIX, @temp_root))

        @directory.children(true).each do |boxdir|
          # Ignore all non-directories because they can't be boxes
          next if !boxdir.directory?

          box_name = boxdir.basename.to_s

          # If it is a v1 box, then we need to upgrade it first
          if v1_box?(boxdir)
            upgrade_dir = v1_upgrade(boxdir)
            FileUtils.mv(upgrade_dir, boxdir.join("virtualbox"))
          end

          # Create the directory for this box
          new_box_dir = temp_dir.join(dir_name(box_name), "0")
          new_box_dir.mkpath

          # Go through each provider and move it
          boxdir.children(true).each do |providerdir|
            FileUtils.cp_r(providerdir, new_box_dir.join(providerdir.basename))
          end
        end

        # Move the folder into place
        @directory.rmtree
        FileUtils.mv(temp_dir.to_s, @directory.to_s)
      end
    end
259511
def upgrade(self, flag):
        
        for pkg in self.binary:
            try:
                subprocess.call("upgradepkg {0} {1}".format(flag, pkg),
                                shell=True)
                check = pkg[:-4].split("/")[-1]
                if os.path.isfile(self.meta.pkg_path + check):
                    print("Completed!\n")
                else:
                    raise SystemExit()
            except subprocess.CalledProcessError:
                self._not_found("Can't upgrade", self.binary, pkg)
                raise SystemExit(1)
1349151
def upgrade():
    """"""
    op.create_table(
        'workflows_workflow',
        sa.Column(
            'uuid',
            UUIDType,
            primary_key=True,
            nullable=False,
            default=uuid.uuid4()
        ),
        sa.Column(
            'name',
            sa.String(255),
            default='Default workflow',
            nullable=False
        ),
        sa.Column(
            'created',
            sa.DateTime,
            default=datetime.now,
            nullable=False
        ),
        sa.Column(
            'modified',
            sa.DateTime,
            default=datetime.now,
            onupdate=datetime.now,
            nullable=False
        ),
        sa.Column('id_user', sa.Integer, default=0, nullable=False),
        sa.Column(
            'extra_data',
            JSONType().with_variant(
                postgresql.JSON(none_as_null=True),
                'postgresql',
            ),
            default=lambda: dict(),
            nullable=False
        ),
        sa.Column(
            'status',
            ChoiceType(WorkflowStatus, impl=sa.Integer()),
            default=WorkflowStatus.NEW,
            nullable=False
        )
    )

    op.create_table(
        'workflows_object',
        sa.Column('id', sa.Integer, primary_key=True),
        sa.Column(
            'data',
            JSONType().with_variant(
                postgresql.JSON(none_as_null=True),
                'postgresql',
            ),
            default=lambda: dict(),
            nullable=False
        ),
        sa.Column(
            'extra_data',
            JSONType().with_variant(
                postgresql.JSON(none_as_null=True),
                'postgresql',
            ),
            default=lambda: dict(),
            nullable=False
        ),
        sa.Column(
            'id_workflow',
            UUIDType,
            sa.ForeignKey('workflows_workflow.uuid', ondelete='CASCADE'),
            nullable=True,
            index=True
        ),
        sa.Column(
            'status',
            ChoiceType(ObjectStatus, impl=sa.Integer()),
            default=ObjectStatus.INITIAL,
            nullable=False,
            index=True
        ),
        sa.Column(
            'id_parent',
            sa.Integer,
            sa.ForeignKey('workflows_object.id', ondelete='CASCADE'),
            default=None,
            index=True
        ),
        sa.Column('id_user', sa.Integer, default=0, nullable=False),
        sa.Column(
            'created',
            sa.DateTime,
            default=datetime.now,
            nullable=False
        ),
        sa.Column(
            'modified',
            sa.DateTime,
            default=datetime.now,
            onupdate=datetime.now,
            nullable=False
        ),
        sa.Column(
            'data_type',
            sa.String(150),
            default='',
            nullable=True,
            index=True
        ),
        sa.Column('id_user', sa.Integer, default=0, nullable=False),
        sa.Column(
            'callback_pos',
            JSONType().with_variant(
                postgresql.JSON(none_as_null=True),
                'postgresql',
            ),
            default=lambda: list(),
            nullable=True
        )
    )
1370888
def upgrade_setuptools():
    
    # Note - I tried including the higher version in
    # setup_requires, but was still able to trigger
    # the bug. - stu.axon
    global MIN_SETUPTOOLS
    r = None
    try:
        r = pkg_resources.require(["setuptools"])[0]
    except DistributionNotFound:
        # ok, setuptools will be installed later
        return

    if StrictVersion(r.version) >= StrictVersion(MIN_SETUPTOOLS):
        return
    else:
        print("Upgrading setuptools...")
        subprocess.call("%s -mpip install 'setuptools>=%s'" % (sys.executable, MIN_SETUPTOOLS), shell=True)
342813
def upgrade():
    """"""
    current_date = datetime.utcnow()

    # Add 'created' and 'updated' columns to RemoteAccount
    _add_created_updated_columns('oauthclient_remoteaccount', current_date)

    # Add 'created' and 'updated' columns to RemoteToken
    _add_created_updated_columns('oauthclient_remotetoken', current_date)

    # Add 'created' and 'updated' columns to UserIdentity
    _add_created_updated_columns('oauthclient_useridentity', current_date)
54210
def bin_upgrade(self):
        
        packages = self.args[1:]
        options = [
            "-u",
            "--upgradepkg"
        ]
        flag = ""
        flags = [
            "--dry-run",
            "--install-new",
            "--reinstall",
            "--verbose"
        ]
        if len(self.args) > 1 and self.args[0] in options:
            if self.args[1] in flags:
                flag = self.args[1]
                packages = self.args[2:]
            PackageManager(packages).upgrade(flag)
        else:
            usage("")
944748
public function upgradeCoreData()
    {
        $entity = $this->getPackageEntity();
        if ($entity !== null) {
            $em = $this->app->make(EntityManagerInterface::class);
            $entity->setPackageName($this->getPackageName());
            $entity->setPackageDescription($this->getPackageDescription());
            $entity->setPackageVersion($this->getPackageVersion());
            $em->persist($entity);
            $em->flush();
        }
    }
374863
def upgrade(directory, sql, tag, x_arg, revision):
    """"""
    _upgrade(directory, revision, sql, tag, x_arg)
702590
def db_upgrade(version=None):
    """"""
    v1 = get_db_version()
    migrate_api.upgrade(url=db_url, repository=db_repo, version=version)
    v2 = get_db_version()

    if v1 == v2:
        print 'Database already up-to-date.'
    else:
        print 'Upgraded: %s ... %s' % (v1, v2)
267990
def upgrade(self):
        
        for pkg in self.upgrade_all:
            check_md5(pkg_checksum(pkg, "slack_patches"), self.patch_path + pkg)
            pkg_ver = "{0}-{1}".format(split_package(pkg)[0],
                                       split_package(pkg)[1])
            if find_package(split_package(pkg)[0] + self.meta.sp,
                            self.meta.pkg_path):
                print("[ {0}upgrading{1} ] --> {2}".format(
                    self.meta.color["YELLOW"], self.meta.color["ENDC"],
                    pkg[:-4]))
                PackageManager((self.patch_path + pkg).split()).upgrade(
                    "--install-new")
                self.upgraded.append(pkg_ver)
            else:
                print("[ {0}installing{1} ] --> {2}".format(
                    self.meta.color["GREEN"], self.meta.color["ENDC"],
                    pkg[:-4]))
                PackageManager((self.patch_path + pkg).split()).upgrade(
                    "--install-new")
                self.installed.append(pkg_ver)
914610
public static function upgrade() {
		$sql = self::$sql;

		$sql::$logger->deactivate();
		try {
			$version = $sql->query(
				"SELECT version FROM meta LIMIT 1")['version'];
		} catch(SQLError $e) {
			$sql::$logger->activate();
			return self::upgrade_tables();
		}
		$sql::$logger->activate();

		if (0 <= version_compare($version, self::TABLE_VERSION))
			return self::$logger->debug(
				"Zapmin: Tables are up-to-date.");

		return self::upgrade_tables($version);
	}
395587
def _cmd_up(self):
        """"""
        revision = self._get_revision()
        if not self._rev:
            self._log(0, "upgrading current revision")
        else:
            self._log(0, "upgrading from revision %s" % revision)
        for rev in self._revisions[int(revision) - 1:]:
            sql_files = glob.glob(os.path.join(self._migration_path, rev, "*.up.sql"))
            sql_files.sort()
            self._exec(sql_files, rev)
        self._log(0, "done: upgraded revision to %s\n" % rev)
248860
def upgrade(self, only):
        """"""
        repositories = self.meta.repositories
        if only:
            repositories = only
        for repo in repositories:
            changelogs = "{0}{1}{2}".format(self.log_path, repo,
                                            "/ChangeLog.txt")
            if os.path.isfile(changelogs):
                os.remove(changelogs)
            if os.path.isdir(self.lib_path + "{0}_repo/".format(repo)):
                for f in (os.listdir(self.lib_path + "{0}_repo/".format(
                        repo))):
                    files = "{0}{1}_repo/{2}".format(self.lib_path, repo, f)
                    if os.path.isfile(files):
                        os.remove(files)
                    elif os.path.isdir(files):
                        shutil.rmtree(files)
        Update().repository(only)
738422
def upgrade_v16_to_v17(storage: SQLiteStorage, old_version: int, current_version: int, **kwargs):
    
    if old_version == SOURCE_VERSION:
        _transform_snapshots(storage)

    return TARGET_VERSION