. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Schema; use Illuminate\Database\Capsule\Manager as DB; /** * Upgrade the database schema from version 43 to version 44. */ class Migration43 implements MigrationInterface { /** * Upgrade to to the next version * * @return void */ public function upgrade(): void { // Language was previously a tree-setting. $language = DB::table('gedcom_setting') ->where('setting_name', '=', 'LANGUAGE') ->where('gedcom_id', '>', 0) ->value('setting_value'); // Now it is a site-setting. DB::table('site_setting')->updateOrInsert([ 'setting_name' => 'LANGUAGE', ], [ 'setting_value' => $language ?? 'en-US', ]); // Cleanup DB::table('gedcom_setting') ->where('setting_name', '=', 'LANGUAGE') ->delete(); } }