Upgrade to to the next version

@return void
356664
public function upgrade(): void
    {
        // This table was previously created by the googlemap module in 1.7.9.
        // These migrations are now part of the core code.

        if (!DB::schema()->hasTable('placelocation')) {
            DB::schema()->create('placelocation', static function (Blueprint $table): void {
                $table->integer('pl_id')->primary();
                $table->integer('pl_parent_id');
                $table->integer('pl_level');
                $table->string('pl_place', 255);
                $table->string('pl_long', 30)->nullable();
                $table->string('pl_lati', 30)->nullable();
                $table->integer('pl_zoom')->nullable();
                $table->string('pl_icon', 255)->nullable();

                $table->index('pl_place');
                $table->unique(['pl_parent_id', 'pl_place']);
            });
        }

        if (DB::schema()->hasColumn('placelocation', 'pl_media')) {
            DB::schema()->table('placelocation', static function (Blueprint $table): void {
                $table->dropColumn('pl_media');
                $table->dropColumn('sv_long');
                $table->dropColumn('sv_lati');
                $table->dropColumn('sv_bearing');
                $table->dropColumn('sv_elevation');
                $table->dropColumn('sv_zoom');
            });
        }
    }
455442
protected function handleUpgrade()
    {
        $this->error('______________________________________');
        $this->error('It appears that the Eyewitness package has already been installed. You only need to run the installer once per application.');
        $this->error('If you continue, this command will overwrite your eyewitness config file with the latest version, and you will lose all your current settings.');
        $this->error('You can run "artisan eyewitness:regenerate" if you just want to update to new keys.');
        $this->error('______________________________________');

        return $this->confirm('Do you wish to continue?');
    }
3400
public function up()
    {
        // only thing to change is the version number

        /** @var \LCI\Blend\Blendable\SystemSetting $systemSetting */
        $systemSetting = $this->blender->getBlendableLoader()->getBlendableSystemSetting('blend.version');
        $systemSetting
            ->setSeedsDir($this->getSeedsDir())
            ->setFieldValue('1.0.0 beta')
            ->setFieldArea('Blend')
            ->blend(true);

        foreach ($this->empty_settings as $key) {

            /** @var \LCI\Blend\Blendable\SystemSetting $systemSetting */
            $systemSetting = $this->blender->getBlendableLoader()->getBlendableSystemSetting($key);
            $systemSetting
                ->setSeedsDir($this->getSeedsDir())
                ->setFieldArea('Blend')
                ->blend(true);
        }

        $this->modx->cacheManager->refresh();
    }
992381
protected function upgrade540()
    {
        $result = true;

        // ConfigStore::save should store all settings in 1 serialized value.
        $configStore = $this->getConfigStore();
        if (method_exists($configStore, 'loadOld')) {
            $values = $configStore->loadOld($this->getKeys());
            $result = $this->save($values);
        }

        return $result;
    }
1293064
public function upgradeDatabase()
    {
        $this->refreshEntities([
            OneAssociation::class,
            ManyAssociation::class,
            AssociationEntry::class,
            Entry::class,
            Entry\Association::class,
        ]);

        // Migrate data from old entries table to new
        if ($this->connection->tableExists('ExpressEntityAssociationSelectedEntries')) {
            $this->connection->transactional(function ($db) {
                $r = $db->query('select * from ExpressEntityAssociationSelectedEntries');
                while ($row = $r->fetchRow()) {
                    $db->insert('ExpressEntityAssociationEntries', [
                        'association_id' => $row['id'], 'exEntryID' => $row['exSelectedEntryID']
                    ]);
                }
                $this->connection->Execute('alter table ExpressEntityAssociationSelectedEntries rename _ExpressEntityAssociationSelectedEntries');
            });
        }

    }
1121608
def upgrade(directory=None, revision='head', sql=False, tag=None, x_arg=None):
    """"""
    config = current_app.extensions['migrate'].migrate.get_config(directory,
                                                                  x_arg=x_arg)
    command.upgrade(config, revision, sql=sql, tag=tag)
1118034
public function up() {
		$db = Database::get();

		$database = $db->get_one('SELECT DATABASE()');

		$indexes = ['completed', 'frozen', 'failed'];

		foreach ($indexes as $index) {
			if ($db->get_one('SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS WHERE 1 AND TABLE_SCHEMA = "' . $database . '" AND TABLE_NAME="transaction" AND INDEX_NAME="' . $index . '"') === null) {
				$db->query('ALTER TABLE `transaction` ADD INDEX `' . $index . '` (`' . $index . '`)');
			}
		}
	}
733609
public function up()
    {
        Schema::create('modvel_modules', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->text('description');
            $table->string('category');
            $table->string('customer');
            $table->string('icon');
            $table->string('version');
            $table->string('adminDisplayName');    
            $table->string('adminVisible');    
            $table->integer('adminDisplayOrder');    
            $table->string('displayName');    
            $table->string('displayVisible');    
            $table->integer('displayOrder');    
            $table->integer('status')->default(1);
            $table->timestamps();
        });

        \DB::table('modvel_modules')->insert(array (
            0 => 
            array (
                'id' => 17,
                'name' => 'Dashboard',
                'description' => '',
                'category' => 'Dashboard',
                'customer' => 'General',
                'icon' => 'fa fa-tachometer',
                'version' => '1.0.0',
                'adminDisplayName' => 'Dashboard',
                'adminVisible' => '1',
                'adminDisplayOrder' => 0,
                'displayName' => 'Dashboard',
                'displayVisible' => '1',
                'displayOrder' => 0,
                'status' => 1,
                'created_at' => '2016-08-24 21:29:13',
                'updated_at' => '2016-08-24 21:29:13',
            ),
            1 => 
            array (
                'id' => 18,
                'name' => 'Logs',
                'description' => '',
                'category' => 'General',
                'customer' => 'General',
                'icon' => 'fa fa-history',
                'version' => '1.0.0',
                'adminDisplayName' => 'Log Management',
                'adminVisible' => '1',
                'adminDisplayOrder' => 0,
                'displayName' => 'Logs',
                'displayVisible' => '0',
                'displayOrder' => 0,
                'status' => 1,
                'created_at' => '2016-08-24 21:29:13',
                'updated_at' => '2016-08-24 21:29:13',
            ),
            2 => 
            array (
                'id' => 19,
                'name' => 'Modvel',
                'description' => '',
                'category' => 'General',
                'customer' => 'General',
                'icon' => 'fa fa-modx',
                'version' => '1.0.0',
                'adminDisplayName' => 'Modvel Configrations',
                'adminVisible' => '1',
                'adminDisplayOrder' => 0,
                'displayName' => 'Modvel',
                'displayVisible' => '1',
                'displayOrder' => 0,
                'status' => 1,
                'created_at' => '2016-08-24 21:29:13',
                'updated_at' => '2016-08-24 21:29:13',
            ),
            3 => 
            array (
                'id' => 20,
                'name' => 'Pages',
                'description' => '',
                'category' => 'General',
                'customer' => 'General',
                'icon' => 'fa fa-pencil-square-o',
                'version' => '1.0.0',
                'adminDisplayName' => 'Page Management',
                'adminVisible' => '1',
                'adminDisplayOrder' => 0,
                'displayName' => 'Pages',
                'displayVisible' => '1',
                'displayOrder' => 0,
                'status' => 1,
                'created_at' => '2016-08-24 21:29:13',
                'updated_at' => '2016-08-24 21:29:13',
            ),
            4 => 
            array (
                'id' => 21,
                'name' => 'Users',
                'description' => '',
                'category' => 'General',
                'customer' => 'General',
                'icon' => 'fa fa-user',
                'version' => '1.0.0',
                'adminDisplayName' => 'User Management',
                'adminVisible' => '1',
                'adminDisplayOrder' => 0,
                'displayName' => 'Users',
                'displayVisible' => '1',
                'displayOrder' => 0,
                'status' => 1,
                'created_at' => '2016-08-24 21:29:13',
                'updated_at' => '2016-08-24 21:29:13',
            ),
        ));
    }
254814
public function admin_upgrade() {

		foreach ( PodsInit::$upgrades as $old_version => $new_version ) {
			if ( version_compare( $old_version, PodsInit::$version_last, '<=' ) && version_compare( PodsInit::$version_last, $new_version, '<' ) ) {
				$new_version = str_replace( '.', '_', $new_version );

				pods_view( PODS_DIR . 'ui/admin/upgrade/upgrade_' . $new_version . '.php', compact( array_keys( get_defined_vars() ) ) );

				break;
			}
		}
	}
1317671
public function upgrade(): void
    {
        // These tables were created by webtrees 1.x, and may not exist if we first installed webtrees 2.x
        DB::schema()->dropIfExists('site_access_rule');
        DB::schema()->dropIfExists('next_id');

        // Split the media table into media/media_file so that we can store multiple media
        // files in each media object.
        DB::schema()->create('media_file', static function (Blueprint $table): void {
            $table->integer('id', true);
            $table->string('m_id', 20);
            $table->integer('m_file');
            $table->string('multimedia_file_refn', 248); // GEDCOM only allows 30 characters
            $table->string('multimedia_format', 4);
            $table->string('source_media_type', 15);
            $table->string('descriptive_title', 248);

            $table->index(['m_id', 'm_file']);
            $table->index(['m_file', 'm_id']);
            $table->index(['m_file', 'multimedia_file_refn']);
            $table->index(['m_file', 'multimedia_format']);
            $table->index(['m_file', 'source_media_type']);
            $table->index(['m_file', 'descriptive_title']);
        });

        if (DB::schema()->hasColumn('media', 'm_filename')) {
            (new Builder(DB::connection()))->from('media_file')->insertUsing([
                'm_id',
                'm_file',
                'multimedia_file_refn',
                'multimedia_format',
                'source_media_type',
                'descriptive_title',
            ], static function (Builder $query): void {
                $query->select([
                    'm_id',
                    'm_file',
                    'm_filename',
                    'm_ext',
                    'm_type',
                    'm_titl',
                ])->from('media');
            });

            // SQLite can only drop one column at a time.
            DB::schema()->table('media', static function (Blueprint $table): void {
                $table->dropColumn('m_filename');
            });
            DB::schema()->table('media', static function (Blueprint $table): void {
                $table->dropColumn('m_ext');
            });
            DB::schema()->table('media', static function (Blueprint $table): void {
                $table->dropColumn('m_type');
            });
            DB::schema()->table('media', static function (Blueprint $table): void {
                $table->dropColumn('m_titl');
            });
        }
    }
479247
def upgrade():
    """"""
    op.create_table(
        'communities_community',
        sa.Column('created', sa.DateTime(), nullable=False),
        sa.Column('updated', sa.DateTime(), nullable=False),
        sa.Column('id', sa.String(length=100), nullable=False),
        sa.Column('id_user', sa.Integer(), nullable=False),
        sa.Column('title', sa.String(length=255), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.Column('page', sa.Text(), nullable=False),
        sa.Column('curation_policy', sa.Text(), nullable=False),
        sa.Column('last_record_accepted', sa.DateTime(), nullable=False),
        sa.Column('logo_ext', sa.String(length=4), nullable=True),
        sa.Column('ranking', sa.Integer(), nullable=False),
        sa.Column('fixed_points', sa.Integer(), nullable=False),
        sa.Column('deleted_at', sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(['id_user'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table(
        'communities_community_record',
        sa.Column('created', sa.DateTime(), nullable=False),
        sa.Column('updated', sa.DateTime(), nullable=False),
        sa.Column('id_community', sa.String(length=100), nullable=False),
        sa.Column('id_record', sqlalchemy_utils.types.uuid.UUIDType(),
                  nullable=False),
        sa.Column('id_user', sa.Integer(), nullable=True),
        sa.Column('expires_at', sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(
            ['id_community'], ['communities_community.id'],
            name='fk_communities_community_record_id_community',
        ),
        sa.ForeignKeyConstraint(['id_record'], [u'records_metadata.id'], ),
        sa.ForeignKeyConstraint(['id_user'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id_community', 'id_record')
    )
    op.create_table(
        'communities_featured_community',
        sa.Column('created', sa.DateTime(), nullable=False),
        sa.Column('updated', sa.DateTime(), nullable=False),
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('id_community', sa.String(length=100), nullable=False),
        sa.Column('start_date', sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(
            ['id_community'], [u'communities_community.id'],
            name='fk_communities_featured_community_id_community',
        ),
        sa.PrimaryKeyConstraint('id')
    )
881293
protected function upgrade470()
    {
        $result = true;
        $newSettings = array();

        if ($this->get('salutation') && strpos($this->get('salutation'), '[#') !== false) {
            $newSettings['salutation'] = str_replace('[#', '[', $this->get('salutation'));
        }

        if (!empty($newSettings)) {
            $result = $this->save($newSettings);
        }
        return $result;
    }
592718
public function upgradeDatabase()
    {
        Page::getByPath('/dashboard/system/backup')->delete();
        Page::getByPath('/dashboard/system/backup/backup')->delete();
        Page::getByPath('/dashboard/system/backup/update')->delete();

        $this->createSinglePage('/dashboard/system/update', 'Update concrete5');

        $this->createSinglePage('/dashboard/system/update/update', 'Apply Update', ['meta_keywords' => 'upgrade, new version, update']);
    }
69387
public function up()
    {
        $locationApp = dbfetch('SELECT * FROM `#__components` WHERE `option` = "com_locations"')[0];
        
        if ($locationApp['meta']) {
            $meta = json_decode($locationApp['meta']);
            if ($meta->browser_key) {
                $rawMeta = '{\"service\":\"google\",\"api_key\":\"'.$meta->browser_key.'\"}'; 
                dbexec('UPDATE `#__components` SET `meta` = "'.$rawMeta.'" WHERE `option` = "com_locations"');
            }
        }
    }
852156
def upgrade():
    """"""
    op.create_table(
        'access_actionsroles',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('role_id', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['role_id'], [u'accounts_role.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'role_id',
                            name='access_actionsroles_unique')
    )
    op.create_index(
        op.f('ix_access_actionsroles_action'), 'access_actionsroles',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsroles_argument'), 'access_actionsroles',
        ['argument'], unique=False)
    op.create_table(
        'access_actionsusers',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'user_id',
                            name='access_actionsusers_unique')
    )
    op.create_index(
        op.f('ix_access_actionsusers_action'), 'access_actionsusers',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsusers_argument'), 'access_actionsusers',
        ['argument'], unique=False)
59829
public function upgrade(): void
    {
        // doctrine/dbal cannot modify tables containing ENUM fields
        $data = DB::table('module_privacy')->get();

        DB::schema()->drop('module_privacy');

        DB::schema()->create('module_privacy', static function (Blueprint $table): void {
            $table->increments('id');
            $table->string('module_name', 32);
            $table->integer('gedcom_id');
            $table->string('interface');
            $table->tinyInteger('access_level');

            $table->unique(['gedcom_id', 'module_name', 'interface']);
            $table->unique(['module_name', 'gedcom_id', 'interface']);

            $table->foreign('module_name')->references('module_name')->on('module')->onDelete('cascade');
            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade');
        });

        foreach ($data as $datum) {
            DB::table('module_privacy')->insert([
                'module_name'  => $datum->module_name,
                'gedcom_id'    => $datum->gedcom_id,
                'interface'    => self::COMPONENT_TO_INTERFACE[$datum->component],
                'access_level' => $datum->access_level,
            ]);
        }
    }
1222132
public function upgrade()
    {
        $this->upgradeDatabase();

        // now we refresh all blocks
        $manager = new Manager($this->app);
        $items = $manager->driver('block_type')->getItems($this->getPackageEntity());
        foreach ($items as $item) {
            $item->refresh();
        }

        Localization::clearCache();
    }