getTablePrefix() . 'maintenance_settings'; $driver = Schema::getConnection()->getDriverName(); if ($driver === 'mysql') { DB::statement("ALTER TABLE `{$table}` MODIFY `scope_code` VARCHAR(64) NOT NULL"); } elseif ($driver === 'pgsql') { DB::statement("ALTER TABLE \"{$table}\" ALTER COLUMN scope_code TYPE VARCHAR(64)"); } } public function down(): void { if (!Schema::hasTable('maintenance_settings')) return; // The old admin only recognizes site and category scopes. The FK removes child translations. DB::table('maintenance_settings') ->where('scope_code', 'like', 'third:%:%') ->orWhere('scope_code', 'like', 'self:lottery:%') ->orWhere('scope_code', 'like', 'self:sport:%') ->delete(); $table = Schema::getConnection()->getTablePrefix() . 'maintenance_settings'; $driver = Schema::getConnection()->getDriverName(); if ($driver === 'mysql') { DB::statement("ALTER TABLE `{$table}` MODIFY `scope_code` VARCHAR(32) NOT NULL"); } elseif ($driver === 'pgsql') { DB::statement("ALTER TABLE \"{$table}\" ALTER COLUMN scope_code TYPE VARCHAR(32)"); } } };