r1119: Adding upgrade3.php
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 21 Aug 2006 22:35:38 +0000 (22:35 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 21 Aug 2006 22:35:38 +0000 (22:35 +0000)
docs/schema_changes.sql
install/global.php
install/upgrade3.php [new file with mode: 0644]

index ceb334fe1257c515fd008efa805192f3bd173bf9..9de1d44968b68dc784bdae5bbcdbaebd5dbff705 100644 (file)
@@ -1,15 +1,2 @@
 ## SVN $Id$
 
-DROP TABLE localization;
-
-ALTER TABLE language DROP filename;
-
-ALTER TABLE language CHANGE languagecode langcode VARCHAR(5) NOT NULL;
-
-ALTER TABLE favourite RENAME favorite;
-
-ALTER TABLE user CHANGE showcolours showcolors BOOL NULL;
-
-ALTER TABLE language DROP debug;
-
-UPDATE usergroup SET permissions = permissions + 33554432 WHERE usergroupid IN (2, 5, 6);
index 1081b09dc7282698c68cc75ed8e9e4e398aef106..7c948eac42eb0b7b8f241787e90a1e127ce9ee0b 100644 (file)
@@ -75,7 +75,8 @@ $bugsys->datastore = array();
 $bugsys->versions = array(
        '1.0.0'                 => 1,
        '1.0.1'                 => 2,
-       '1.1.0 Beta 1'  => -1
+       '1.1.0 Beta 1'  => 3,
+       '1.1.0 Beta 2'  => -1
 );
 
 // ###################################################################
diff --git a/install/upgrade3.php b/install/upgrade3.php
new file mode 100644 (file)
index 0000000..41951e4
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar [#]version[#]
+|| # Copyright ©2002-[#]year[#] Blue Static
+|| #
+|| # 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; version [#]gpl[#] of the License.
+|| #
+|| # 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, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+define('STOP_MARK', 4);
+define('ACTIVE_SITE', 'upgrade3.php');
+
+require_once('./global.php');
+
+page_start();
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 0)
+{
+?>
+<h1>Welcome to Bugdar</h1>
+
+<p>This upgrade will take from Bugdar 1.1.0 Beta 1 to Bugdar 1.1.0 Beta 2.</p>
+
+<p>The following steps will make changes to your database schema so that you can run Bugdar 1.1.0 Beta 2.</p>
+
+<p>To begin the process, please click the button below.</p>
+<?php
+}
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 1)
+{
+?>
+       <h1>Language System Updates</h1>
+       
+       <p>In Bugdar 1.1.0 Beta 2, the language system was changed to use Gettext. These schema changes reflect that change.</p>
+<?php
+       
+       $db->query("DROP TABLE " . TABLE_PREFIX . "localization");
+       
+       echo "Dropping the strings cache table<br />\n";
+       
+       $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP filename");
+       
+       echo "Dropping language.filename<br />\n";
+       
+       $db->query("ALTER TABLE " . TABLE_PREFIX . "language CHANGE languagecode langcode VARCHAR(5) NOT NULL");
+       
+       echo "Adding language.langcode for the Gettext language code<br />\n";
+       
+       $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP debug");
+       
+       echo "Dropping language.debug as language debug mode no longer exists<br />\n";
+}
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 2)
+{
+?>
+       <h1>English US Changes</h1>
+       
+       <p>These changes bring the schema into English (US) compliance.</p>
+<?php
+       
+       $db->query("ALTER TABLE " . TABLE_PREFIX . "favourite RENAME " . TABLE_PREFIX . "favorite");
+       
+       echo "Renaming table 'favourite' to 'favorite'<br />\n";
+
+       $db->query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE showcolours showcolors BOOL NULL");
+       
+       echo "Renaming user.showcolours to user.showcolors<br />\n";
+}
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 3)
+{
+?>
+       <h1>Adding New Permission Mask</h1>
+       
+       <p>Bugdar 1.1.0 Beta 2 introduces a new permission called "canviewownhidden" which enables users to view hidden bugs that they reported. This is being turned on for registered users, developers, and administrators.</p>
+<?php
+       
+       $db->query("UPDATE " . TABLE_PREFIX . "usergroup SET permissions = permissions + 33554432 WHERE usergroupid IN (2, 5, 6)");
+       
+       echo "Increased permission levels<br />\n";
+}
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 4)
+{
+?>
+<h1>Version Number Change</h1>
+
+<p>This step finishes the upgrade by inreasing your version number.</p>
+
+<?php
+       
+       require_once('./includes/settings.php');
+               
+       $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Beta 2' WHERE varname = 'trackerversion'");
+       
+       build_settings();
+       
+?>
+
+... done.
+
+<?php
+}
+
+// ###################################################################
+
+page_end();
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file