xref: /webtrees/app/Schema/Migration32.php (revision 19d913785a45657df3e7bc9cd4411f501dd5071b)
11388907fSMichael Schramm<?php
21388907fSMichael Schramm/**
31388907fSMichael Schramm * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
51388907fSMichael Schramm * This program is free software: you can redistribute it and/or modify
61388907fSMichael Schramm * it under the terms of the GNU General Public License as published by
71388907fSMichael Schramm * the Free Software Foundation, either version 3 of the License, or
81388907fSMichael Schramm * (at your option) any later version.
91388907fSMichael Schramm * This program is distributed in the hope that it will be useful,
101388907fSMichael Schramm * but WITHOUT ANY WARRANTY; without even the implied warranty of
111388907fSMichael Schramm * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
121388907fSMichael Schramm * GNU General Public License for more details.
131388907fSMichael Schramm * You should have received a copy of the GNU General Public License
141388907fSMichael Schramm * along with this program. If not, see <http://www.gnu.org/licenses/>.
151388907fSMichael Schramm */
161388907fSMichael Schrammnamespace Fisharebest\Webtrees\Schema;
171388907fSMichael Schramm
181388907fSMichael Schrammuse Fisharebest\Webtrees\Database;
19bd52fa32SGreg Roachuse Fisharebest\Webtrees\DebugBar;
201388907fSMichael Schrammuse PDOException;
211388907fSMichael Schramm
221388907fSMichael Schramm/**
231388907fSMichael Schramm * Upgrade the database schema from version 32 to version 33.
241388907fSMichael Schramm */
25c1010edaSGreg Roachclass Migration32 implements MigrationInterface
26c1010edaSGreg Roach{
271388907fSMichael Schramm    /**
281388907fSMichael Schramm     * Upgrade to to the next version
29*19d91378SGreg Roach     *
30*19d91378SGreg Roach     * @return void
311388907fSMichael Schramm     */
32c1010edaSGreg Roach    public function upgrade()
33c1010edaSGreg Roach    {
341388907fSMichael Schramm        try {
351388907fSMichael Schramm            Database::prepare(
36af1e6d0cSGreg Roach                "ALTER TABLE `##site_setting` CHANGE setting_value setting_value VARCHAR(2000) NOT NULL"
371388907fSMichael Schramm            )->execute();
381388907fSMichael Schramm        } catch (PDOException $ex) {
39bd52fa32SGreg Roach            DebugBar::addThrowable($ex);
40bd52fa32SGreg Roach
41af1e6d0cSGreg Roach            // Already done?
421388907fSMichael Schramm        }
434c0b5256SGreg Roach
444c0b5256SGreg Roach        Database::prepare(
454c0b5256SGreg Roach            "DELETE FROM `##change` WHERE old_gedcom = '' AND new_gedcom = ''"
464c0b5256SGreg Roach        )->execute();
471388907fSMichael Schramm    }
481388907fSMichael Schramm}
49