diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-06-02 23:51:34 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-06-03 00:43:38 +0100 |
| commit | 3bfb94b0b402ff08e5888afb946384316f6d3e60 (patch) | |
| tree | 82b9b0ce9b47e146778c29b01eed2fcf5ae1a41a /modules_v3/googlemap/db_schema | |
| parent | 38d2124dba7359bb63bf14ade54d80ebccbb2376 (diff) | |
| download | webtrees-3bfb94b0b402ff08e5888afb946384316f6d3e60.tar.gz webtrees-3bfb94b0b402ff08e5888afb946384316f6d3e60.tar.bz2 webtrees-3bfb94b0b402ff08e5888afb946384316f6d3e60.zip | |
Refactor database migrations to use autoloading and remove duplicates
Diffstat (limited to 'modules_v3/googlemap/db_schema')
| -rw-r--r-- | modules_v3/googlemap/db_schema/db_schema_0_1.php | 46 | ||||
| -rw-r--r-- | modules_v3/googlemap/db_schema/db_schema_1_2.php | 45 | ||||
| -rw-r--r-- | modules_v3/googlemap/db_schema/db_schema_2_3.php | 26 | ||||
| -rw-r--r-- | modules_v3/googlemap/db_schema/db_schema_3_4.php | 32 | ||||
| -rw-r--r-- | modules_v3/googlemap/db_schema/db_schema_4_5.php | 29 |
5 files changed, 0 insertions, 178 deletions
diff --git a/modules_v3/googlemap/db_schema/db_schema_0_1.php b/modules_v3/googlemap/db_schema/db_schema_0_1.php deleted file mode 100644 index 7d17ca84c1..0000000000 --- a/modules_v3/googlemap/db_schema/db_schema_0_1.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -namespace Fisharebest\Webtrees; - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// Update the GM module database schema from version 0 to version 1 -// -// Version 0: empty database -// Version 1: create the tables, as per PhpGedView 4.2.1 - -// Create all of the tables needed for this module - -Database::exec( - "CREATE TABLE IF NOT EXISTS `##placelocation` (" . - " pl_id INTEGER NOT NULL," . - " pl_parent_id INTEGER NULL," . - " pl_level INTEGER NULL," . - " pl_place VARCHAR(255) NULL," . - " pl_long VARCHAR(30) NULL," . - " pl_lati VARCHAR(30) NULL," . - " pl_zoom INTEGER NULL," . - " pl_icon VARCHAR(255) NULL," . - " PRIMARY KEY (pl_id)," . - " KEY ix1 (pl_level)," . - " KEY ix2 (pl_long)," . - " KEY ix3 (pl_lati)," . - " KEY ix4 (pl_place)," . - " KEY ix5 (pl_parent_id)" . - ") COLLATE utf8_unicode_ci ENGINE=InnoDB" -); - -// Update the version to indicate success -Site::setPreference($schema_name, $next_version); diff --git a/modules_v3/googlemap/db_schema/db_schema_1_2.php b/modules_v3/googlemap/db_schema/db_schema_1_2.php deleted file mode 100644 index a2f3c3e631..0000000000 --- a/modules_v3/googlemap/db_schema/db_schema_1_2.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -namespace Fisharebest\Webtrees; - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -use PDOException; - -// Update the GM module database schema from version 1 to version 2 -// -// Version 0: empty database -// Version 1: create the tables, as per PhpGedView 4.2.1 -// Version 2: update the tables to support streetview - -// Create all of the tables needed for this module - -try { - Database::exec( - "ALTER TABLE `##placelocation` ADD (" . - " pl_media VARCHAR(60) NULL," . - " sv_long FLOAT NOT NULL DEFAULT 0," . - " sv_lati FLOAT NOT NULL DEFAULT 0," . - " sv_bearing FLOAT NOT NULL DEFAULT 0," . - " sv_elevation FLOAT NOT NULL DEFAULT 0," . - " sv_zoom FLOAT NOT NULL DEFAULT 1" . - ")" - ); -} catch (PDOException $ex) { - // Already done this? -} - -// Update the version to indicate success -Site::setPreference($schema_name, $next_version); diff --git a/modules_v3/googlemap/db_schema/db_schema_2_3.php b/modules_v3/googlemap/db_schema/db_schema_2_3.php deleted file mode 100644 index b684f09b8f..0000000000 --- a/modules_v3/googlemap/db_schema/db_schema_2_3.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -namespace Fisharebest\Webtrees; - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// Update the GM module database schema from version 2 to version 3 -// -// Convert flag icons from .gif to .png - -Database::exec("UPDATE `##placelocation` SET pl_icon=REPLACE(pl_icon, '.gif', '.png')"); - -// Update the version to indicate success -Site::setPreference($schema_name, $next_version); diff --git a/modules_v3/googlemap/db_schema/db_schema_3_4.php b/modules_v3/googlemap/db_schema/db_schema_3_4.php deleted file mode 100644 index 78f5a225e5..0000000000 --- a/modules_v3/googlemap/db_schema/db_schema_3_4.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -namespace Fisharebest\Webtrees; - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// Update the GM module database schema from version 3 to version 4 -// -// Combine the two ways of enabling the GM module - -Database::exec( - "UPDATE `##module` m, `##module_setting` ms SET m.status=CASE WHEN (m.status=1 AND ms.setting_value=1) THEN 'enabled' ELSE 'disabled' END WHERE m.module_name=ms.module_name AND m.module_name='googlemap' AND ms.setting_name='GM_ENABLED'" -); - -Database::exec( - "DELETE FROM `##module_setting` WHERE module_name='googlemap' AND setting_name='GM_ENABLED'" -); - -// Update the version to indicate success -Site::setPreference($schema_name, $next_version); diff --git a/modules_v3/googlemap/db_schema/db_schema_4_5.php b/modules_v3/googlemap/db_schema/db_schema_4_5.php deleted file mode 100644 index b890f5f919..0000000000 --- a/modules_v3/googlemap/db_schema/db_schema_4_5.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -namespace Fisharebest\Webtrees; - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// Update the GM module database schema from version 4 to version 5 -// -// Delete some old/unused configuration settings - -Database::exec( - "DELETE FROM `##module_setting` WHERE module_name='googlemap' AND setting_name IN ( - 'GM_API_KEY', 'GM_DEFAULT_TOP_VALUE', 'GM_DISP_COUNT', 'GM_MAX_NOF_LEVELS', 'GM_PH_CONTROLS', 'GM_PH_WHEEL', 'GM_PRE_POST_MODE_1', 'GM_PRE_POST_MODE_2', 'GM_PRE_POST_MODE_3', 'GM_PRE_POST_MODE_4', 'GM_PRE_POST_MODE_5', 'GM_PRE_POST_MODE_6', 'GM_PRE_POST_MODE_7', 'GM_PRE_POST_MODE_8', 'GM_PRE_POST_MODE_9')" -); - -// Update the version to indicate success -Site::setPreference($schema_name, $next_version); |
