aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/db/migration')
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php42
-rw-r--r--phpBB/phpbb/db/migration/data/v310/allow_cdn.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha1.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha2.php28
-rw-r--r--phpBB/phpbb/db/migration/data/v310/avatar_types.php60
-rw-r--r--phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php47
-rw-r--r--phpBB/phpbb/db/migration/data/v310/namespaces.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php27
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php6
-rw-r--r--phpBB/phpbb/db/migration/data/v310/plupload.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v310/signature_module_auth.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_p2.php6
-rw-r--r--phpBB/phpbb/db/migration/data/v310/style_update_p2.php24
-rw-r--r--phpBB/phpbb/db/migration/data/v310/teampage.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php42
-rw-r--r--phpBB/phpbb/db/migration/exception.php8
-rw-r--r--phpBB/phpbb/db/migration/migration.php8
-rw-r--r--phpBB/phpbb/db/migration/tool/config.php4
-rw-r--r--phpBB/phpbb/db/migration/tool/module.php7
23 files changed, 491 insertions, 34 deletions
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php
new file mode 100644
index 0000000000..5a2d569724
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12', '<'),
+ array('config.update', array('version', '3.0.12')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php
new file mode 100644
index 0000000000..3edb578fc8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC2', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12-RC2', '<'),
+ array('config.update', array('version', '3.0.12-RC2')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php
new file mode 100644
index 0000000000..510693a5b7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12_rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC3', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12-RC3', '<'),
+ array('config.update', array('version', '3.0.12-RC3')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php b/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php
new file mode 100644
index 0000000000..9f168f4fd6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class acp_style_components_module extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_STYLE_COMPONENTS'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id == false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'acp',
+ false,
+ 'ACP_STYLE_COMPONENTS',
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/allow_cdn.php b/phpBB/phpbb/db/migration/data/v310/allow_cdn.php
new file mode 100644
index 0000000000..aa471df6e7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/allow_cdn.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class allow_cdn extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['allow_cdn']);
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\jquery_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_cdn', (int) $this->config['load_jquery_cdn'])),
+ array('config.remove', array('load_jquery_cdn')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha1.php b/phpBB/phpbb/db/migration/data/v310/alpha1.php
new file mode 100644
index 0000000000..403e301e64
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/alpha1.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class alpha1 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\local_url_bbcode',
+ '\phpbb\db\migration\data\v30x\release_3_0_12',
+ '\phpbb\db\migration\data\v310\acp_style_components_module',
+ '\phpbb\db\migration\data\v310\allow_cdn',
+ '\phpbb\db\migration\data\v310\auth_provider_oauth',
+ '\phpbb\db\migration\data\v310\avatars',
+ '\phpbb\db\migration\data\v310\boardindex',
+ '\phpbb\db\migration\data\v310\config_db_text',
+ '\phpbb\db\migration\data\v310\forgot_password',
+ '\phpbb\db\migration\data\v310\mod_rewrite',
+ '\phpbb\db\migration\data\v310\mysql_fulltext_drop',
+ '\phpbb\db\migration\data\v310\namespaces',
+ '\phpbb\db\migration\data\v310\notifications_cron',
+ '\phpbb\db\migration\data\v310\notification_options_reconvert',
+ '\phpbb\db\migration\data\v310\plupload',
+ '\phpbb\db\migration\data\v310\signature_module_auth',
+ '\phpbb\db\migration\data\v310\softdelete_mcp_modules',
+ '\phpbb\db\migration\data\v310\teampage',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-a1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha2.php b/phpBB/phpbb/db/migration/data/v310/alpha2.php
new file mode 100644
index 0000000000..3c0853f924
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/alpha2.php
@@ -0,0 +1,28 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class alpha2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha1',
+ '\phpbb\db\migration\data\v310\notifications_cron_p2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-a2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/phpBB/phpbb/db/migration/data/v310/avatar_types.php
new file mode 100644
index 0000000000..bdbdccf0c5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/avatar_types.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class avatar_types extends \phpbb\db\migration\migration
+{
+ /**
+ * @var avatar type map
+ */
+ protected $avatar_type_map = array(
+ AVATAR_UPLOAD => 'avatar.driver.upload',
+ AVATAR_REMOTE => 'avatar.driver.remote',
+ AVATAR_GALLERY => 'avatar.driver.local',
+ );
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ '\phpbb\db\migration\data\v310\avatars',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_user_avatar_type'))),
+ array('custom', array(array($this, 'update_group_avatar_type'))),
+ );
+ }
+
+ public function update_user_avatar_type()
+ {
+ foreach ($this->avatar_type_map as $old => $new)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_avatar_type = '$new'
+ WHERE user_avatar_type = '$old'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ public function update_group_avatar_type()
+ {
+ foreach ($this->avatar_type_map as $old => $new)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "groups
+ SET group_avatar_type = '$new'
+ WHERE group_avatar_type = '$old'";
+ $this->db->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
new file mode 100644
index 0000000000..97d174d4bc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class mysql_fulltext_drop extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ // This migration is irrelevant for all non-MySQL DBMSes.
+ return strpos($this->db->sql_layer, 'mysql') === false;
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_schema()
+ {
+ /*
+ * Drop FULLTEXT indexes related to MySQL fulltext search.
+ * Doing so is equivalent to dropping the search index from the ACP.
+ * Possibly time-consuming recreation of the search index (i.e.
+ * FULLTEXT indexes) is left as a task to the admin to not
+ * unnecessarily stall the upgrade process. The new search index will
+ * then require about 40% less table space (also see PHPBB3-11621).
+ */
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'posts' => array(
+ 'post_subject',
+ 'post_text',
+ 'post_content',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php
index 9b182f88b8..f74ecbd874 100644
--- a/phpBB/phpbb/db/migration/data/v310/namespaces.php
+++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php
@@ -23,7 +23,7 @@ class namespaces extends \phpbb\db\migration\migration
return array(
array('if', array(
(preg_match('#^phpbb_search_#', $this->config['search_type'])),
- array('config.update', array('search_type', str_replace('phpbb_search_', 'phpbb\\search\\', $this->config['search_type']))),
+ array('config.update', array('search_type', str_replace('phpbb_search_', '\\phpbb\\search\\', $this->config['search_type']))),
)),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php
index 10f1392094..61be25bb5f 100644
--- a/phpBB/phpbb/db/migration/data/v310/notifications.php
+++ b/phpBB/phpbb/db/migration/data/v310/notifications.php
@@ -34,7 +34,7 @@ class notifications extends \phpbb\db\migration\migration
),
$this->table_prefix . 'notifications' => array(
'COLUMNS' => array(
- 'notification_id' => array('UINT', NULL, 'auto_increment'),
+ 'notification_id' => array('UINT', null, 'auto_increment'),
'item_type' => array('VCHAR:255', ''),
'item_id' => array('UINT', 0),
'item_parent_id' => array('UINT', 0),
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
new file mode 100644
index 0000000000..050e679cc0
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_cron_p2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications_cron');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make read_notification_last_gc dynamic.
+ array('config.remove', array('read_notification_last_gc')),
+ array('config.add', array('read_notification_last_gc', 0, 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php
index 8ed626d8a6..eb2eb361ee 100644
--- a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php
@@ -26,7 +26,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration
'add_tables' => array(
$this->table_prefix . 'notification_types' => array(
'COLUMNS' => array(
- 'notification_type_id' => array('USINT', NULL, 'auto_increment'),
+ 'notification_type_id' => array('USINT', null, 'auto_increment'),
'notification_type_name' => array('VCHAR:255', ''),
'notification_type_enabled' => array('BOOL', 1),
),
@@ -37,7 +37,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration
),
$this->table_prefix . 'notifications' => array(
'COLUMNS' => array(
- 'notification_id' => array('UINT:10', NULL, 'auto_increment'),
+ 'notification_id' => array('UINT:10', null, 'auto_increment'),
'notification_type_id' => array('USINT', 0),
'item_id' => array('UINT', 0),
'item_parent_id' => array('UINT', 0),
@@ -73,7 +73,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration
),
$this->table_prefix . 'notifications' => array(
'COLUMNS' => array(
- 'notification_id' => array('UINT', NULL, 'auto_increment'),
+ 'notification_id' => array('UINT', null, 'auto_increment'),
'item_type' => array('VCHAR:255', ''),
'item_id' => array('UINT', 0),
'item_parent_id' => array('UINT', 0),
diff --git a/phpBB/phpbb/db/migration/data/v310/plupload.php b/phpBB/phpbb/db/migration/data/v310/plupload.php
new file mode 100644
index 0000000000..7cdba507a2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/plupload.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class plupload extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['plupload_last_gc']) &&
+ isset($this->config['plupload_salt']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('plupload_last_gc', 0)),
+ array('config.add', array('plupload_salt', unique_id())),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
index a85e0be01c..6da1cb8009 100644
--- a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
+++ b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
@@ -27,7 +27,7 @@ class signature_module_auth extends \phpbb\db\migration\migration
static public function depends_on()
{
- return array('\phpbb\db\migration\data\v31x\dev');
+ return array('\phpbb\db\migration\data\v310\dev');
}
public function update_data()
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php
index 0c32e474f4..38b190c766 100644
--- a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php
@@ -34,7 +34,10 @@ class softdelete_p2 extends \phpbb\db\migration\migration
),
'drop_keys' => array(
$this->table_prefix . 'posts' => array('post_approved'),
- $this->table_prefix . 'topics' => array('forum_appr_last'),
+ $this->table_prefix . 'topics' => array(
+ 'forum_appr_last',
+ 'topic_approved',
+ ),
),
);
}
@@ -63,6 +66,7 @@ class softdelete_p2 extends \phpbb\db\migration\migration
),
$this->table_prefix . 'topics' => array(
'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'),
+ 'topic_approved' => array('topic_approved'),
),
),
);
diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php
index 202a8409fb..40d6a4dbbd 100644
--- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php
+++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php
@@ -24,6 +24,14 @@ class style_update_p2 extends \phpbb\db\migration\migration
public function update_schema()
{
return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id',
+ 'template_id',
+ 'theme_id',
+ ),
+ ),
+
'drop_columns' => array(
$this->table_prefix . 'styles' => array(
'imageset_id',
@@ -53,10 +61,18 @@ class style_update_p2 extends \phpbb\db\migration\migration
),
),
+ 'add_index' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id' => array('imageset_id'),
+ 'template_id' => array('template_id'),
+ 'theme_id' => array('theme_id'),
+ ),
+ ),
+
'add_tables' => array(
$this->table_prefix . 'styles_imageset' => array(
'COLUMNS' => array(
- 'imageset_id' => array('UINT', NULL, 'auto_increment'),
+ 'imageset_id' => array('UINT', null, 'auto_increment'),
'imageset_name' => array('VCHAR_UNI:255', ''),
'imageset_copyright' => array('VCHAR_UNI', ''),
'imageset_path' => array('VCHAR:100', ''),
@@ -68,7 +84,7 @@ class style_update_p2 extends \phpbb\db\migration\migration
),
$this->table_prefix . 'styles_imageset_data' => array(
'COLUMNS' => array(
- 'image_id' => array('UINT', NULL, 'auto_increment'),
+ 'image_id' => array('UINT', null, 'auto_increment'),
'image_name' => array('VCHAR:200', ''),
'image_filename' => array('VCHAR:200', ''),
'image_lang' => array('VCHAR:30', ''),
@@ -83,7 +99,7 @@ class style_update_p2 extends \phpbb\db\migration\migration
),
$this->table_prefix . 'styles_template' => array(
'COLUMNS' => array(
- 'template_id' => array('UINT', NULL, 'auto_increment'),
+ 'template_id' => array('UINT', null, 'auto_increment'),
'template_name' => array('VCHAR_UNI:255', ''),
'template_copyright' => array('VCHAR_UNI', ''),
'template_path' => array('VCHAR:100', ''),
@@ -112,7 +128,7 @@ class style_update_p2 extends \phpbb\db\migration\migration
),
$this->table_prefix . 'styles_theme' => array(
'COLUMNS' => array(
- 'theme_id' => array('UINT', NULL, 'auto_increment'),
+ 'theme_id' => array('UINT', null, 'auto_increment'),
'theme_name' => array('VCHAR_UNI:255', ''),
'theme_copyright' => array('VCHAR_UNI', ''),
'theme_path' => array('VCHAR:100', ''),
diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php
index 80cc4be1c0..172435c672 100644
--- a/phpBB/phpbb/db/migration/data/v310/teampage.php
+++ b/phpBB/phpbb/db/migration/data/v310/teampage.php
@@ -27,7 +27,7 @@ class teampage extends \phpbb\db\migration\migration
'add_tables' => array(
$this->table_prefix . 'teampage' => array(
'COLUMNS' => array(
- 'teampage_id' => array('UINT', NULL, 'auto_increment'),
+ 'teampage_id' => array('UINT', null, 'auto_increment'),
'group_id' => array('UINT', 0),
'teampage_name' => array('VCHAR_UNI:255', ''),
'teampage_position' => array('UINT', 0),
diff --git a/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php
new file mode 100644
index 0000000000..f8ada6c6f5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class ucp_popuppm_module extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'ucp'
+ AND module_langname = 'UCP_PM_POPUP_TITLE'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id == false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'ucp',
+ 'UCP_PM',
+ 'UCP_PM_POPUP_TITLE',
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php
index 58e29b5218..cfe546d1ab 100644
--- a/phpBB/phpbb/db/migration/exception.php
+++ b/phpBB/phpbb/db/migration/exception.php
@@ -10,14 +10,6 @@
namespace phpbb\db\migration;
/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
* The migrator is responsible for applying new migrations in the correct order.
*
* @package db
diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php
index aff3837279..b32de00871 100644
--- a/phpBB/phpbb/db/migration/migration.php
+++ b/phpBB/phpbb/db/migration/migration.php
@@ -10,14 +10,6 @@
namespace phpbb\db\migration;
/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
* Abstract base class for database migrations
*
* Each migration consists of a set of schema and data changes to be implemented
diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php
index f2149dc59a..36a1931f4e 100644
--- a/phpBB/phpbb/db/migration/tool/config.php
+++ b/phpBB/phpbb/db/migration/tool/config.php
@@ -130,6 +130,10 @@ class config implements \phpbb\db\migration\tool\tool_interface
case 'remove':
$call = 'add';
+ if (sizeof($arguments) == 1)
+ {
+ $arguments[] = '';
+ }
break;
case 'update_if_equals':
diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php
index 9869dd4230..3e39d87c04 100644
--- a/phpBB/phpbb/db/migration/tool/module.php
+++ b/phpBB/phpbb/db/migration/tool/module.php
@@ -182,9 +182,6 @@ class module implements \phpbb\db\migration\tool\tool_interface
{
// The "automatic" way
$basename = (isset($data['module_basename'])) ? $data['module_basename'] : '';
- $basename = str_replace(array('/', '\\'), '', $basename);
- $class = str_replace(array('/', '\\'), '', $class);
-
$module = $this->get_module_info($class, $basename);
$result = '';
@@ -353,9 +350,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
}
// Automatic method
- $basename = str_replace(array('/', '\\'), '', $module['module_basename']);
- $class = str_replace(array('/', '\\'), '', $class);
-
+ $basename = $module['module_basename'];
$module_info = $this->get_module_info($class, $basename);
foreach ($module_info['modes'] as $mode => $info)