Upgrade to to the next version

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

        if (!DB::schema()->hasTable('news')) {
            DB::schema()->create('news', static function (Blueprint $table): void {
                $table->integer('news_id', true);
                $table->integer('user_id')->nullable();
                $table->integer('gedcom_id')->nullable();
                $table->string('subject', 255);
                $table->text('body');
                $table->timestamp('updated')->useCurrent();
                
                $table->index(['user_id', 'updated']);
                $table->index(['gedcom_id', 'updated']);

                $table->foreign('user_id')->references('user_id')->on('user')->onDelete('cascade');
                $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade');
            });
        }
    }
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"');
            }
        }
    }
1193756
public function Upgrade171to172()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 58);

        $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;
    }
935845
function upgrade(): Result {
    $composer = PHP_OS_FAMILY == 'Windows' ? 'php '.escapeshellarg('C:\Program Files\PHP\share\composer.phar') : 'composer';
    return $this->taskExecStack()
      ->exec('git reset --hard')
      ->exec('git fetch --all --prune')
      ->exec('git pull --rebase')
      ->exec("$composer update --no-interaction")
      ->run();
  }
232340
public function Upgrade161to162()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 53);

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

        return true;
    }
577623
public function Upgrade155to156()
    {
        $this->_batch->addTask('Db_AddPatches', 49);

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

        return true;
    }
543144
public function up()
    {
        Schema::table('asset_versions', function (Blueprint $table) {
            $table->float('aspect_ratio', 8, 3)
                ->nullable()
                ->default(null);
        });

        $versions = AssetVersion::all();

        foreach ($versions as $version) {
            $path = storage_path().'/boomcms/assets/'.$version->id;

            if (is_readable($path)) {
                $info = FileInfo::create(new File($path));

                $version->fill([
                    'aspect_ratio' => $info->getAspectRatio(),
                    'width'        => $info->getWidth(),
                    'height'       => $info->getHeight(),
                    'metadata'     => $info->getMetadata(),
                ])->save();
            }
        }
    }
951799
public function Upgrade182to183()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 61);

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

        return true;
    }
534816
public function Upgrade164to170()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 56);

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

        return true;
    }
917909
protected function upgrade_to_050() {
		if ( $this->options->installed_version ) {
			return;
		}

		$this->upgrade_cron();
		$this->upgrade_options();
		$this->upgrade_results();

		$this->delete_vulnerabilities();

		// Set installed version so upgrader does not run again.
		$this->options->get_store()->set( 'installed_version', '0.5.0' );
	}
1252026
public function Upgrade184to185()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 63);

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

        return true;
    }
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();
        }
    }
781167
public function up()
    {
        foreach ($this->legacyTableNames as $tableName)
        {
            if(Schema::hasTable($tableName)) {
                Schema::rename($tableName, 'laramanager_' . $tableName);
            }
        }
    }
431346
public function up()
    {

        // --------------------------------
        // Table: notes
        // --------------------------------
        Schema::create(config('combine-core.tablePrefix', 'combine') . '_notes', function (Blueprint $table) {
            $table->uuid('id');
            $table->json('activity')->nullable();
            $table->string('content', 1024);
            $table->uuid('noteable_id')->index();
            $table->char('noteable_type', 36);
            // --------------------------------
            // Timestamps
            // --------------------------------
            $table->timestamps();
            $table->softDeletes();
            // --------------------------------
            // Indexes
            // --------------------------------
            $table->primary('id');
        });
    }
1196614
public function up()
    {
        $table = $this->table('settings');
        $table->addColumn('scope', 'string', ['limit' => 255, 'null' => true])
            ->addColumn('field', 'string', ['limit' => 255, 'null' => true])
            ->addColumn('value', 'text', ['null' => true])
            ->addColumn('serialized', 'boolean', ['null' => false, 'default' => 0])
            ->addColumn('created', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
            ->addColumn('modified', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP']);
        $table->create();

        $this->unsignedIntId($table);
        $table->save();
    }
741819
public function upgrade(): void
    {
        DB::schema()->create('gedcom', static function (Blueprint $table): void {
            $table->integer('gedcom_id', true);
            $table->string('gedcom_name', 255);
            $table->integer('sort_order')->default(0);

            $table->unique('gedcom_name');
            $table->index('sort_order');
        });

        DB::schema()->create('site_setting', static function (Blueprint $table): void {
            $table->string('setting_name', 32);
            $table->string('setting_value', 2000);

            $table->primary('setting_name');
        });

        DB::schema()->create('gedcom_setting', static function (Blueprint $table): void {
            $table->integer('gedcom_id');
            $table->string('setting_name', 32);
            $table->string('setting_value', 255);

            $table->primary(['gedcom_id', 'setting_name']);

            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('user', static function (Blueprint $table): void {
            $table->integer('user_id', true);
            $table->string('user_name', 32);
            $table->string('real_name', 64);
            $table->string('email', 64);
            $table->string('password', 128);

            $table->unique('user_name');
            $table->unique('email');
        });

        DB::schema()->create('user_setting', static function (Blueprint $table): void {
            $table->integer('user_id');
            $table->string('setting_name', 32);
            $table->string('setting_value', 255);

            $table->primary(['user_id', 'setting_name']);

            $table->foreign('user_id')->references('user_id')->on('user');
        });

        DB::schema()->create('user_gedcom_setting', static function (Blueprint $table): void {
            $table->integer('user_id');
            $table->integer('gedcom_id');
            $table->string('setting_name', 32);
            $table->string('setting_value', 255);

            $table->primary(['user_id', 'gedcom_id', 'setting_name']);
            $table->index('gedcom_id');

            $table->foreign('user_id')->references('user_id')->on('user');
            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('log', static function (Blueprint $table): void {
            $table->integer('log_id', true);
            $table->timestamp('log_time')->useCurrent();
            $table->enum('log_type', ['auth', 'config', 'debug', 'edit', 'error', 'media', 'search']);
            $table->longText('log_message');
            $table->ipAddress('ip_address');
            $table->integer('user_id')->nullable();
            $table->integer('gedcom_id')->nullable();

            $table->index('log_time');
            $table->index('log_type');
            $table->index('ip_address');
            $table->index('user_id');
            $table->index('gedcom_id');

            $table->foreign('user_id')->references('user_id')->on('user');
            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('change', static function (Blueprint $table): void {
            $table->integer('change_id', true);
            $table->timestamp('change_time')->useCurrent();
            $table->enum('status', ['accepted', 'pending', 'rejected'])->default('pending');
            $table->integer('gedcom_id');
            $table->string('xref', 20);
            $table->longText('old_gedcom');
            $table->longText('new_gedcom');
            $table->integer('user_id');

            $table->index(['gedcom_id', 'status', 'xref']);
            $table->index('user_id');

            $table->foreign('user_id')->references('user_id')->on('user');
            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('message', static function (Blueprint $table): void {
            $table->integer('message_id', true);
            $table->string('sender', 64);
            $table->ipAddress('ip_address');
            $table->integer('user_id');
            $table->string('subject', 255);
            $table->longText('body');
            $table->timestamp('created')->useCurrent();

            $table->index('user_id');

            $table->foreign('user_id')->references('user_id')->on('user');
        });

        DB::schema()->create('default_resn', static function (Blueprint $table): void {
            $table->integer('default_resn_id', true);
            $table->integer('gedcom_id');
            $table->string('xref', 20)->nullable();
            $table->string('tag_type', 15)->nullable();
            $table->enum('resn', ['none', 'privacy', 'confidential', 'hidden']);
            $table->string('comment', 255)->nullable();
            $table->timestamp('updated')->useCurrent();

            $table->unique(['gedcom_id', 'xref', 'tag_type']);

            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('individuals', static function (Blueprint $table): void {
            $table->string('i_id', 20);
            $table->integer('i_file');
            $table->string('i_rin', 20);
            $table->enum('i_sex', ['U', 'M', 'F']);
            $table->longText('i_gedcom');

            $table->primary(['i_id', 'i_file']);
            $table->unique(['i_file', 'i_id']);
        });

        DB::schema()->create('families', static function (Blueprint $table): void {
            $table->string('f_id', 20);
            $table->integer('f_file');
            $table->string('f_husb', 20)->nullable();
            $table->string('f_wife', 20)->nullable();
            $table->longText('f_gedcom');
            $table->integer('f_numchil');

            $table->primary(['f_id', 'f_file']);
            $table->unique(['f_file', 'f_id']);
            $table->index('f_husb');
            $table->index('f_wife');
        });

        DB::schema()->create('places', static function (Blueprint $table): void {
            $table->integer('p_id', true);
            $table->string('p_place', 150);
            $table->integer('p_parent_id')->nullable();
            $table->integer('p_file');
            $table->longText('p_std_soundex')->nullable();
            $table->longText('p_dm_soundex')->nullable();

            $table->index(['p_file', 'p_place']);
            $table->unique(['p_parent_id', 'p_file', 'p_place']);
        });

        DB::schema()->create('placelinks', static function (Blueprint $table): void {
            $table->integer('pl_p_id');
            $table->string('pl_gid', 20);
            $table->integer('pl_file');

            $table->primary(['pl_p_id', 'pl_gid', 'pl_file']);
            $table->index('pl_p_id');
            $table->index('pl_gid');
            $table->index('pl_file');
        });

        DB::schema()->create('dates', static function (Blueprint $table): void {
            $table->tinyInteger('d_day');
            $table->char('d_month', 5)->nullable();
            $table->tinyInteger('d_mon');
            $table->smallInteger('d_year');
            $table->mediumInteger('d_julianday1');
            $table->mediumInteger('d_julianday2');
            $table->string('d_fact', 15);
            $table->string('d_gid', 20);
            $table->integer('d_file');
            $table->enum('d_type', ['@#DGREGORIAN@', '@#DJULIAN@', '@#DHEBREW@', '@#DFRENCH R@', '@#DHIJRI@', '@#DROMAN@', '@#DJALALI@']);

            $table->index('d_day');
            $table->index('d_month');
            $table->index('d_mon');
            $table->index('d_year');
            $table->index('d_julianday1');
            $table->index('d_julianday2');
            $table->index('d_gid');
            $table->index('d_file');
            $table->index('d_type');
            $table->index(['d_fact', 'd_gid']);
        });

        DB::schema()->create('media', static function (Blueprint $table): void {
            $table->string('m_id', 20);
            $table->string('m_ext', 6)->nullable();
            $table->string('m_type', 20)->nullable();
            $table->string('m_titl', 248)->nullable();
            $table->string('m_filename', 248)->nullable();
            $table->integer('m_file');
            $table->longText('m_gedcom')->nullable();

            $table->primary(['m_file', 'm_id']);
            $table->unique(['m_id', 'm_file']);
            $table->index(['m_ext', 'm_type']);
        });

        DB::schema()->create('next_id', static function (Blueprint $table): void {
            $table->integer('gedcom_id');
            $table->string('record_type', 15);
            $table->decimal('next_id', 20, 0);

            $table->primary(['gedcom_id', 'record_type']);

            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('other', static function (Blueprint $table): void {
            $table->string('o_id', 20);
            $table->integer('o_file');
            $table->string('o_type', 15);
            $table->longText('o_gedcom');

            $table->primary(['o_id', 'o_file']);
            $table->unique(['o_file', 'o_id']);
        });

        DB::schema()->create('sources', static function (Blueprint $table): void {
            $table->string('s_id', 20);
            $table->integer('s_file');
            $table->string('s_name', 255);
            $table->longText('s_gedcom');

            $table->primary(['s_id', 's_file']);
            $table->unique(['s_file', 's_id']);
            $table->index('s_name');
        });

        DB::schema()->create('link', static function (Blueprint $table): void {
            $table->integer('l_file');
            $table->string('l_from', 20);
            $table->string('l_type', 15);
            $table->string('l_to', 20);

            $table->primary(['l_from', 'l_file', 'l_type', 'l_to']);
            $table->unique(['l_to', 'l_file', 'l_type', 'l_from']);
        });

        DB::schema()->create('name', static function (Blueprint $table): void {
            $table->integer('n_file');
            $table->string('n_id', 20);
            $table->integer('n_num');
            $table->string('n_type', 15);
            $table->string('n_sort', 255);
            $table->string('n_full', 255);
            $table->string('n_surname', 255)->nullable();
            $table->string('n_surn', 255)->nullable();
            $table->string('n_givn', 255)->nullable();
            $table->string('n_soundex_givn_std', 255)->nullable();
            $table->string('n_soundex_surn_std', 255)->nullable();
            $table->string('n_soundex_givn_dm', 255)->nullable();
            $table->string('n_soundex_surn_dm', 255)->nullable();

            $table->primary(['n_id', 'n_file', 'n_num']);
            $table->index(['n_full', 'n_id', 'n_file']);
            $table->index(['n_surn', 'n_file', 'n_type', 'n_id']);
            $table->index(['n_givn', 'n_file', 'n_type', 'n_id']);
        });

        DB::schema()->create('module', static function (Blueprint $table): void {
            $table->string('module_name', 32);
            $table->enum('status', ['enabled', 'disabled'])->default('enabled');
            $table->integer('tab_order')->nullable();
            $table->integer('menu_order')->nullable();
            $table->integer('sidebar_order')->nullable();

            $table->primary('module_name');
        });

        DB::schema()->create('module_setting', static function (Blueprint $table): void {
            $table->string('module_name', 32);
            $table->string('setting_name', 32);
            $table->longText('setting_value');

            $table->primary(['module_name', 'setting_name']);

            $table->foreign('module_name')->references('module_name')->on('module');
        });

        DB::schema()->create('module_privacy', static function (Blueprint $table): void {
            $table->string('module_name', 32);
            $table->integer('gedcom_id');
            $table->enum('component', ['block', 'chart', 'menu', 'report', 'sidebar', 'tab', 'theme']);
            $table->tinyInteger('access_level');

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

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

        DB::schema()->create('block', static function (Blueprint $table): void {
            $table->integer('block_id', true);
            $table->integer('gedcom_id')->nullable();
            $table->integer('user_id')->nullable();
            $table->string('xref', 20)->nullable();
            $table->enum('location', ['main', 'side'])->nullable();
            $table->integer('block_order');
            $table->string('module_name', 32);

            $table->index('module_name');
            $table->index('gedcom_id');
            $table->index('user_id');

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

        DB::schema()->create('block_setting', static function (Blueprint $table): void {
            $table->integer('block_id');
            $table->string('setting_name', 32);
            $table->longText('setting_value');

            $table->primary(['block_id', 'setting_name']);

            $table->foreign('block_id')->references('block_id')->on('block');
        });

        DB::schema()->create('hit_counter', static function (Blueprint $table): void {
            $table->integer('gedcom_id');
            $table->string('page_name', 32);
            $table->string('page_parameter', 32);
            $table->integer('page_count');

            $table->primary(['gedcom_id', 'page_name', 'page_parameter']);

            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        DB::schema()->create('session', static function (Blueprint $table): void {
            $table->string('session_id', 32);
            $table->timestamp('session_time')->useCurrent();
            $table->integer('user_id');
            $table->ipAddress('ip_address');
            $table->binary('session_data');

            $table->primary('session_id');
            $table->index('session_time');
            $table->index(['user_id', 'ip_address']);
        });

        // See https://github.com/laravel/framework/issues/3544
        if (DB::connection()->getDriverName() === 'mysql') {
            $table = DB::connection()->getSchemaGrammar()->wrapTable('session');
            $sql   = 'ALTER TABLE ' . $table . ' MODIFY session_data LONGBLOB';
            DB::connection()->statement($sql);
        }

        DB::schema()->create('gedcom_chunk', static function (Blueprint $table): void {
            $table->integer('gedcom_chunk_id', true);
            $table->integer('gedcom_id');
            $table->binary('chunk_data');
            $table->boolean('imported')->default(0);

            $table->index(['gedcom_id', 'imported']);

            $table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
        });

        // See https://github.com/laravel/framework/issues/3544
        if (DB::connection()->getDriverName() === 'mysql') {
            $table = DB::connection()->getSchemaGrammar()->wrapTable('gedcom_chunk');
            $sql   = 'ALTER TABLE ' . $table . ' MODIFY chunk_data LONGBLOB';
            DB::connection()->statement($sql);
        }
    }
523483
public function up()
    {
        //legacy app clean up
        dbexec('DELETE FROM `#__migrator_versions` WHERE component = "opensocial"');

        dbexec('ALTER TABLE `#__nodes` CHANGE `meta` `meta` text DEFAULT NULL');
        dbexec('ALTER TABLE `#__edges` CHANGE `meta` `meta` text DEFAULT NULL');
        dbexec('ALTER TABLE `#__components` CHANGE `params` `meta` text DEFAULT NULL');
        dbexec('ALTER TABLE `#__components` DROP COLUMN `link`');
        dbexec('ALTER TABLE `#__components` DROP COLUMN `menuid`');
        dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_link`');
        dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_alt`');
        dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_img`');

        //deleting legacy data
        dbexec('DELETE FROM `#__components` WHERE `option` IN ("com_config","com_cpanel","com_plugins","com_templates","com_components", "com_languages")');

        $this->_updateMeta('components');

        dbexec('UPDATE `#__components` SET meta = REPLACE(meta, \'"allowUserRegistration":\', \'"allow_registration":\') WHERE `option` = \'com_people\'');

        //legacy data clean up
        dbexec('DELETE FROM `#__plugins` WHERE `element` = "invite" ');
        dbexec('ALTER TABLE `#__plugins` DROP COLUMN `access`');
        dbexec('ALTER TABLE `#__plugins` DROP COLUMN `client_id`');
        dbexec('ALTER TABLE `#__plugins` DROP COLUMN `checked_out`');
        dbexec('ALTER TABLE `#__plugins` DROP COLUMN `checked_out_time`');

        $this->_updateMeta('plugins');

        dbexec('DROP TABLE IF EXISTS `#__templates_menu`');
        dbexec('DROP TABLE IF EXISTS `#__session`');
        dbexec('DROP TABLE IF EXISTS `#__sessions`');

        $query = "CREATE TABLE `#__sessions` ("
        ."`id` SERIAL,"
        ."`session_id` char(64) NOT NULL,"
        ."`node_id` bigint(11) NOT NULL DEFAULT 0,"
        ."`username` varchar(255) DEFAULT NULL,"
        ."`usertype` varchar(255),"
        ."`time` INT(11) DEFAULT 0,"
        ."`guest` tinyint(2) DEFAULT '1',"
        ."`meta` longtext,"
        ."PRIMARY KEY (`id`),"
        ."KEY `whosonline` (`guest`,`usertype`,`username`),"
        ."UNIQUE KEY `session_id` (`session_id`),"
        ."KEY `node_id` (`node_id`),"
        ."KEY `username` (`username`)"
        .") ENGINE=InnoDB CHARACTER SET=utf8";
        dbexec($query);

        //for people the alias is the same as username
        dbexec("UPDATE `#__nodes` SET alias = person_username WHERE type LIKE '%com:people.domain.entity.person' ");

        dbexec('DROP TABLE IF EXISTS `#__people_people`');

        $query = "CREATE TABLE `#__people_people` ("
        ."`people_person_id` SERIAL,"
        ."`node_id` BIGINT UNSIGNED NOT NULL,"
        ."`userid` INT(11) DEFAULT NULL,"
        ."`email` varchar(255) DEFAULT NULL,"
        ."`username` varchar(255) DEFAULT NULL,"
        ."`password` varchar(255) DEFAULT NULL,"
        ."`usertype` varchar(50) DEFAULT NULL,"
        ."`gender` varchar(50) DEFAULT NULL,"
        ."`given_name` varchar(255) DEFAULT NULL,"
        ."`family_name` varchar(255) DEFAULT NULL,"
        ."`network_presence` tinyint(3) NOT NULL DEFAULT 0,"
        ."`last_visit_date` datetime DEFAULT NULL,"
        ."`time_zone` int(11) DEFAULT NULL,"
        ."`language` varchar(100) DEFAULT NULL,"
        ."`activation_code` varchar(255) DEFAULT NULL,"
        ."PRIMARY KEY (`people_person_id`),"
        ."KEY `usertype` (`usertype`),"
        ."UNIQUE KEY `username` (`username`),"
        ."UNIQUE KEY `email` (`email`),"
        ."UNIQUE KEY `node_id` (`node_id`),"
        ."KEY `last_visit_date` (`last_visit_date`)"
        .") ENGINE=InnoDB CHARACTER SET=utf8";
        dbexec($query);

        $query = "INSERT INTO `#__people_people` ("
        ."`node_id`,`userid`,`username`,`usertype`,`gender`,"
        ."`email`,`given_name`,`family_name`,"
        ."`last_visit_date`,`time_zone`,`language` )"
        ." SELECT "
        ."`id`,`person_userid`,`person_username`,`person_usertype`,`actor_gender`,"
        ."`person_useremail`,`person_given_name`,`person_family_name`,"
        ."`person_lastvisitdate`,`person_time_zone`,`person_language` "
        ." FROM `#__nodes`"
        ." WHERE `type` LIKE '%com:people.domain.entity.person'"
        ." ORDER BY `id`";
        dbexec($query);

        $query = "UPDATE `#__people_people` AS `p` "
        ."INNER JOIN `#__users` AS `u` ON `u`.`id` = `p`.`userid`"
        ." SET "
        ."`p`.`password` = `u`.`password`,"
        ."`p`.`last_visit_date` = `u`.`lastvisitDate`,"
        ."`p`.`activation_code` = `u`.`activation`";
        dbexec($query);

        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_userid`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_username`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_useremail`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_usertype`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_lastvisitdate`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `actor_gender`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_given_name`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_family_name`');
        dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_network_presence`');

        dbexec('ALTER TABLE `#__nodes` CHANGE `person_time_zone` `timezone` int(3) DEFAULT NULL');
        dbexec('ALTER TABLE `#__nodes` CHANGE `person_language` `language` VARCHAR(50) DEFAULT NULL');

        dbexec('ALTER TABLE `#__people_people` DROP COLUMN `userid`');

        dbexec('DROP TABLE IF EXISTS `#__users`');

        //update user and authentication plugins
        dbexec("UPDATE `#__plugins` SET `element` = 'anahita' WHERE `element` = 'joomla'");
        dbexec("UPDATE `#__plugins` SET `name` = 'User - Anahita' WHERE `folder` = 'user' AND `element` = 'anahita'");

        dbexec('ALTER TABLE `#__nodes` CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4');
        dbexec('ALTER TABLE `#__nodes` CHANGE alias alias VARCHAR(255) CHARACTER SET utf8mb4');
        dbexec('ALTER TABLE `#__nodes` CHANGE body body MEDIUMTEXT CHARACTER SET utf8mb4');
        dbexec('ALTER TABLE `#__nodes` CHANGE excerpt excerpt TEXT CHARACTER SET utf8mb4');
    }