xref: /webtrees/app/Schema/Migration13.php (revision 19d913785a45657df3e7bc9cd4411f501dd5071b)
13bfb94b0SGreg Roach<?php
23bfb94b0SGreg Roach/**
33bfb94b0SGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
53bfb94b0SGreg Roach * This program is free software: you can redistribute it and/or modify
63bfb94b0SGreg Roach * it under the terms of the GNU General Public License as published by
73bfb94b0SGreg Roach * the Free Software Foundation, either version 3 of the License, or
83bfb94b0SGreg Roach * (at your option) any later version.
93bfb94b0SGreg Roach * This program is distributed in the hope that it will be useful,
103bfb94b0SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
113bfb94b0SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
123bfb94b0SGreg Roach * GNU General Public License for more details.
133bfb94b0SGreg Roach * You should have received a copy of the GNU General Public License
143bfb94b0SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
153bfb94b0SGreg Roach */
1676692c8bSGreg Roachnamespace Fisharebest\Webtrees\Schema;
1776692c8bSGreg Roach
183bfb94b0SGreg Roachuse Fisharebest\Webtrees\Database;
19bd52fa32SGreg Roachuse Fisharebest\Webtrees\DebugBar;
203bfb94b0SGreg Roachuse PDOException;
213bfb94b0SGreg Roach
223bfb94b0SGreg Roach/**
2376692c8bSGreg Roach * Upgrade the database schema from version 13 to version 14.
243bfb94b0SGreg Roach */
25c1010edaSGreg Roachclass Migration13 implements MigrationInterface
26c1010edaSGreg Roach{
2776692c8bSGreg Roach    /**
2876692c8bSGreg Roach     * Upgrade to to the next version
29*19d91378SGreg Roach     *
30*19d91378SGreg Roach     * @return void
3176692c8bSGreg Roach     */
32c1010edaSGreg Roach    public function upgrade()
33c1010edaSGreg Roach    {
343bfb94b0SGreg Roach        // Remove the i_isdead column
353bfb94b0SGreg Roach        try {
363bfb94b0SGreg Roach            Database::exec("ALTER TABLE `##individuals` DROP i_isdead");
373bfb94b0SGreg Roach        } catch (PDOException $ex) {
38bd52fa32SGreg Roach            DebugBar::addThrowable($ex);
39bd52fa32SGreg Roach
403bfb94b0SGreg Roach            // Already done this?
413bfb94b0SGreg Roach        }
423bfb94b0SGreg Roach    }
433bfb94b0SGreg Roach}
44