xref: /webtrees/app/Schema/Migration32.php (revision bd52fa32338513b5d44dc6b1b89178c1bbf60b6a)
11388907fSMichael Schramm<?php
21388907fSMichael Schramm/**
31388907fSMichael Schramm * webtrees: online genealogy
46bdf7674SGreg Roach * Copyright (C) 2017 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;
19*bd52fa32SGreg 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 */
251388907fSMichael Schrammclass Migration32 implements MigrationInterface {
261388907fSMichael Schramm	/**
271388907fSMichael Schramm	 * Upgrade to to the next version
281388907fSMichael Schramm	 */
291388907fSMichael Schramm	public function upgrade() {
301388907fSMichael Schramm		try {
311388907fSMichael Schramm			Database::prepare(
32af1e6d0cSGreg Roach				"ALTER TABLE `##site_setting` CHANGE setting_value setting_value VARCHAR(2000) NOT NULL"
331388907fSMichael Schramm			)->execute();
341388907fSMichael Schramm		} catch (PDOException $ex) {
35*bd52fa32SGreg Roach			DebugBar::addThrowable($ex);
36*bd52fa32SGreg Roach
37af1e6d0cSGreg Roach			// Already done?
381388907fSMichael Schramm		}
394c0b5256SGreg Roach
404c0b5256SGreg Roach		Database::prepare(
414c0b5256SGreg Roach			"DELETE FROM `##change` WHERE old_gedcom = '' AND new_gedcom = ''"
424c0b5256SGreg Roach		)->execute();
431388907fSMichael Schramm	}
441388907fSMichael Schramm}
45