mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/migrations] Make depends_on static to call it without dependencies
Move installing migrations to migration/install.php and handle figuring out what migrations have been installed based on phpBB version. PHPBB3-11318
This commit is contained in:
parent
babdb92aa9
commit
74f4397451
44 changed files with 249 additions and 133 deletions
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_1_rc1');
|
return array('phpbb_db_migration_data_3_0_1_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.1')),
|
array('config.update', array('version', '3.0.1')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_10 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_10 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_10_rc3');
|
return array('phpbb_db_migration_data_3_0_10_rc3');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.10')),
|
array('config.update', array('version', '3.0.10')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_10_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_10_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_9');
|
return array('phpbb_db_migration_data_3_0_9');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('email_max_chunk_size', 50)),
|
array('config.add', array('email_max_chunk_size', 50)),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_10_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_10_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_10_rc1');
|
return array('phpbb_db_migration_data_3_0_10_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.10-rc2')),
|
array('config.update', array('version', '3.0.10-rc2')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_10_rc3 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_10_rc3 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_10_rc2');
|
return array('phpbb_db_migration_data_3_0_10_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.10-rc3')),
|
array('config.update', array('version', '3.0.10-rc3')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_11 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_11 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11_rc2');
|
return array('phpbb_db_migration_data_3_0_11_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.11')),
|
array('config.update', array('version', '3.0.11')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_11_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_11_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_10');
|
return array('phpbb_db_migration_data_3_0_10');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'cleanup_deactivated_styles'))),
|
array('custom', array(array(&$this, 'cleanup_deactivated_styles'))),
|
||||||
|
@ -24,7 +24,7 @@ class phpbb_db_migration_data_3_0_11_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_deactivated_styles()
|
public function cleanup_deactivated_styles()
|
||||||
{
|
{
|
||||||
// Updates users having current style a deactivated one
|
// Updates users having current style a deactivated one
|
||||||
$sql = 'SELECT style_id
|
$sql = 'SELECT style_id
|
||||||
|
@ -48,7 +48,7 @@ class phpbb_db_migration_data_3_0_11_rc1 extends phpbb_db_migration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_orphan_private_messages()
|
public function delete_orphan_private_messages()
|
||||||
{
|
{
|
||||||
// Delete orphan private messages
|
// Delete orphan private messages
|
||||||
$batch_size = 500;
|
$batch_size = 500;
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_11_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_11_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11_rc1');
|
return array('phpbb_db_migration_data_3_0_11_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
@ -25,7 +25,7 @@ class phpbb_db_migration_data_3_0_11_rc2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_columns' => array(
|
'drop_columns' => array(
|
||||||
|
@ -36,7 +36,7 @@ class phpbb_db_migration_data_3_0_11_rc2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.11-rc2')),
|
array('config.update', array('version', '3.0.11-rc2')),
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_12_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_12_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11');
|
return array('phpbb_db_migration_data_3_0_11');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
public function update_schema()
|
||||||
{
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_schema()
|
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
@ -41,7 +36,7 @@ class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_columns' => array(
|
'drop_columns' => array(
|
||||||
|
@ -68,7 +63,7 @@ class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'fix_unset_last_view_time'))),
|
array('custom', array(array(&$this, 'fix_unset_last_view_time'))),
|
||||||
|
@ -78,7 +73,7 @@ class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fix_unset_last_view_time()
|
public function fix_unset_last_view_time()
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . $this->table_prefix . "topics
|
$sql = 'UPDATE ' . $this->table_prefix . "topics
|
||||||
SET topic_last_view_time = topic_last_post_time
|
SET topic_last_view_time = topic_last_post_time
|
||||||
|
@ -86,7 +81,7 @@ class phpbb_db_migration_data_3_0_1_rc1 extends phpbb_db_migration
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset_smiley_size()
|
public function reset_smiley_size()
|
||||||
{
|
{
|
||||||
// Update smiley sizes
|
// Update smiley sizes
|
||||||
$smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
|
$smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_2_rc2');
|
return array('phpbb_db_migration_data_3_0_2_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.2')),
|
array('config.update', array('version', '3.0.2')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_2_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_2_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_1');
|
return array('phpbb_db_migration_data_3_0_1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('referer_validation', '1')),
|
array('config.add', array('referer_validation', '1')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_2_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_2_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_2_rc1');
|
return array('phpbb_db_migration_data_3_0_2_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'change_columns' => array(
|
'change_columns' => array(
|
||||||
|
@ -48,7 +48,7 @@ class phpbb_db_migration_data_3_0_2_rc2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_index' => array(
|
'add_index' => array(
|
||||||
|
@ -66,7 +66,7 @@ class phpbb_db_migration_data_3_0_2_rc2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.2-rc2')),
|
array('config.update', array('version', '3.0.2-rc2')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_3 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_3 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_3_rc1');
|
return array('phpbb_db_migration_data_3_0_3_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.3')),
|
array('config.update', array('version', '3.0.3')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_2');
|
return array('phpbb_db_migration_data_3_0_2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
@ -29,7 +29,7 @@ class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_columns' => array(
|
'drop_columns' => array(
|
||||||
|
@ -44,7 +44,7 @@ class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('enable_queue_trigger', '0')),
|
array('config.add', array('enable_queue_trigger', '0')),
|
||||||
|
@ -59,7 +59,7 @@ class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function correct_acp_email_permissions()
|
public function correct_acp_email_permissions()
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . $this->table_prefix . 'modules
|
$sql = 'UPDATE ' . $this->table_prefix . 'modules
|
||||||
SET module_auth = \'acl_a_email && cfg_email_enable\'
|
SET module_auth = \'acl_a_email && cfg_email_enable\'
|
||||||
|
@ -68,7 +68,7 @@ class phpbb_db_migration_data_3_0_3_rc1 extends phpbb_db_migration
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_group_default_max_recipients()
|
public function set_group_default_max_recipients()
|
||||||
{
|
{
|
||||||
// Set maximum number of recipients for the registered users, bots, guests group
|
// Set maximum number of recipients for the registered users, bots, guests group
|
||||||
$sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
|
$sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_4 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_4 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_4_rc1');
|
return array('phpbb_db_migration_data_3_0_4_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'rename_log_delete_topic'))),
|
array('custom', array(array(&$this, 'rename_log_delete_topic'))),
|
||||||
|
@ -23,7 +23,7 @@ class phpbb_db_migration_data_3_0_4 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function rename_log_delete_topic()
|
public function rename_log_delete_topic()
|
||||||
{
|
{
|
||||||
if ($this->db->sql_layer == 'oracle')
|
if ($this->db->sql_layer == 'oracle')
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_4_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_4_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_3');
|
return array('phpbb_db_migration_data_3_0_3');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
@ -55,7 +55,7 @@ class phpbb_db_migration_data_3_0_4_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_columns' => array(
|
'drop_columns' => array(
|
||||||
|
@ -66,7 +66,7 @@ class phpbb_db_migration_data_3_0_4_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'update_custom_profile_fields'))),
|
array('custom', array(array(&$this, 'update_custom_profile_fields'))),
|
||||||
|
@ -75,7 +75,7 @@ class phpbb_db_migration_data_3_0_4_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_custom_profile_fields()
|
public function update_custom_profile_fields()
|
||||||
{
|
{
|
||||||
// Update the Custom Profile Fields based on previous settings to the new format
|
// Update the Custom Profile Fields based on previous settings to the new format
|
||||||
$sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
|
$sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_5 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_5 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_5_rc1part2');
|
return array('phpbb_db_migration_data_3_0_5_rc1part2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.5')),
|
array('config.update', array('version', '3.0.5')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_4');
|
return array('phpbb_db_migration_data_3_0_4');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'change_columns' => array(
|
'change_columns' => array(
|
||||||
|
@ -25,7 +25,7 @@ class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
$search_indexing_state = $this->config['search_indexing_state'];
|
$search_indexing_state = $this->config['search_indexing_state'];
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hash_old_passwords()
|
public function hash_old_passwords()
|
||||||
{
|
{
|
||||||
$sql = 'SELECT user_id, user_password
|
$sql = 'SELECT user_id, user_password
|
||||||
FROM ' . $this->table_prefix . 'users
|
FROM ' . $this->table_prefix . 'users
|
||||||
|
@ -63,7 +63,7 @@ class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_ichiro_bot()
|
public function update_ichiro_bot()
|
||||||
{
|
{
|
||||||
// Adjust bot entry
|
// Adjust bot entry
|
||||||
$sql = 'UPDATE ' . $this->table_prefix . "bots
|
$sql = 'UPDATE ' . $this->table_prefix . "bots
|
||||||
|
@ -72,7 +72,7 @@ class phpbb_db_migration_data_3_0_5_rc1 extends phpbb_db_migration
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove_duplicate_auth_options()
|
public function remove_duplicate_auth_options()
|
||||||
{
|
{
|
||||||
// Before we are able to add a unique key to auth_option, we need to remove duplicate entries
|
// Before we are able to add a unique key to auth_option, we need to remove duplicate entries
|
||||||
$sql = 'SELECT auth_option
|
$sql = 'SELECT auth_option
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_5_rc1part2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_5_rc1part2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_5_rc1');
|
return array('phpbb_db_migration_data_3_0_5_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_keys' => array(
|
'drop_keys' => array(
|
||||||
|
@ -28,7 +28,7 @@ class phpbb_db_migration_data_3_0_5_rc1part2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.5-rc1')),
|
array('config.update', array('version', '3.0.5-rc1')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_6 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_6 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_6_rc4');
|
return array('phpbb_db_migration_data_3_0_6_rc4');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.6')),
|
array('config.update', array('version', '3.0.6')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_6_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_6_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_5');
|
return array('phpbb_db_migration_data_3_0_5');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
@ -59,7 +59,7 @@ class phpbb_db_migration_data_3_0_6_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_columns' => array(
|
'drop_columns' => array(
|
||||||
|
@ -99,7 +99,7 @@ class phpbb_db_migration_data_3_0_6_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')),
|
array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')),
|
||||||
|
@ -184,14 +184,14 @@ class phpbb_db_migration_data_3_0_6_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_user_options_default()
|
public function set_user_options_default()
|
||||||
{
|
{
|
||||||
// 229376 is the added value to enable all three signature options
|
// 229376 is the added value to enable all three signature options
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376';
|
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376';
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_newly_registered_group()
|
public function add_newly_registered_group()
|
||||||
{
|
{
|
||||||
// Add newly_registered group... but check if it already exists (we always supported running the updater on any schema)
|
// Add newly_registered group... but check if it already exists (we always supported running the updater on any schema)
|
||||||
$sql = 'SELECT group_id
|
$sql = 'SELECT group_id
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_6_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_6_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_6_rc1');
|
return array('phpbb_db_migration_data_3_0_6_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.6-rc2')),
|
array('config.update', array('version', '3.0.6-rc2')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_6_rc3 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_6_rc3 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_6_rc2');
|
return array('phpbb_db_migration_data_3_0_6_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'update_cp_fields'))),
|
array('custom', array(array(&$this, 'update_cp_fields'))),
|
||||||
|
@ -23,7 +23,7 @@ class phpbb_db_migration_data_3_0_6_rc3 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_cp_fields()
|
public function update_cp_fields()
|
||||||
{
|
{
|
||||||
// Update the Custom Profile Fields based on previous settings to the new format
|
// Update the Custom Profile Fields based on previous settings to the new format
|
||||||
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
|
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_6_rc4 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_6_rc4 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_6_rc3');
|
return array('phpbb_db_migration_data_3_0_6_rc3');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.6-rc4')),
|
array('config.update', array('version', '3.0.6-rc4')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_7 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_7 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_7_rc2');
|
return array('phpbb_db_migration_data_3_0_7_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.7')),
|
array('config.update', array('version', '3.0.7')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_7_pl1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_7_pl1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_7');
|
return array('phpbb_db_migration_data_3_0_7');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.7-pl1')),
|
array('config.update', array('version', '3.0.7-pl1')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_7_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_7_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_6');
|
return array('phpbb_db_migration_data_3_0_6');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_keys' => array(
|
'drop_keys' => array(
|
||||||
|
@ -30,7 +30,7 @@ class phpbb_db_migration_data_3_0_7_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_index' => array(
|
'add_index' => array(
|
||||||
|
@ -46,7 +46,7 @@ class phpbb_db_migration_data_3_0_7_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('feed_overall', 1)),
|
array('config.add', array('feed_overall', 1)),
|
||||||
|
@ -61,7 +61,7 @@ class phpbb_db_migration_data_3_0_7_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_text_templates()
|
public function delete_text_templates()
|
||||||
{
|
{
|
||||||
// Delete all text-templates from the template_data
|
// Delete all text-templates from the template_data
|
||||||
$sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
|
$sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_7_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_7_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_7_rc1');
|
return array('phpbb_db_migration_data_3_0_7_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'update_email_hash'))),
|
array('custom', array(array(&$this, 'update_email_hash'))),
|
||||||
|
@ -23,7 +23,7 @@ class phpbb_db_migration_data_3_0_7_rc2 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_email_hash($start = 0)
|
public function update_email_hash($start = 0)
|
||||||
{
|
{
|
||||||
$limit = 1000;
|
$limit = 1000;
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_8 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_8 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_8_rc1');
|
return array('phpbb_db_migration_data_3_0_8_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.8')),
|
array('config.update', array('version', '3.0.8')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_7_pl1');
|
return array('phpbb_db_migration_data_3_0_7_pl1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('custom', array(array(&$this, 'update_file_extension_group_names'))),
|
array('custom', array(array(&$this, 'update_file_extension_group_names'))),
|
||||||
|
@ -37,7 +37,7 @@ class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_file_extension_group_names()
|
public function update_file_extension_group_names()
|
||||||
{
|
{
|
||||||
// Update file extension group names to use language strings.
|
// Update file extension group names to use language strings.
|
||||||
$sql = 'SELECT lang_dir
|
$sql = 'SELECT lang_dir
|
||||||
|
@ -93,7 +93,7 @@ class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_module_auth()
|
public function update_module_auth()
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . MODULES_TABLE . '
|
$sql = 'UPDATE ' . MODULES_TABLE . '
|
||||||
SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\'
|
SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\'
|
||||||
|
@ -103,7 +103,7 @@ class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_bots()
|
public function update_bots()
|
||||||
{
|
{
|
||||||
$bot_name = 'Bing [Bot]';
|
$bot_name = 'Bing [Bot]';
|
||||||
$bot_name_clean = utf8_clean_string($bot_name);
|
$bot_name_clean = utf8_clean_string($bot_name);
|
||||||
|
@ -167,7 +167,7 @@ class phpbb_db_migration_data_3_0_8_rc1 extends phpbb_db_migration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_orphan_shadow_topics()
|
public function delete_orphan_shadow_topics()
|
||||||
{
|
{
|
||||||
// Delete shadow topics pointing to not existing topics
|
// Delete shadow topics pointing to not existing topics
|
||||||
$batch_size = 500;
|
$batch_size = 500;
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_9 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_9 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_9_rc4');
|
return array('phpbb_db_migration_data_3_0_9_rc4');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.9')),
|
array('config.update', array('version', '3.0.9')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_8');
|
return array('phpbb_db_migration_data_3_0_8');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_tables' => array(
|
'add_tables' => array(
|
||||||
|
@ -51,7 +51,7 @@ class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'drop_tables' => array(
|
'drop_tables' => array(
|
||||||
|
@ -60,7 +60,7 @@ class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.add', array('ip_login_limit_max', 50)),
|
array('config.add', array('ip_login_limit_max', 50)),
|
||||||
|
@ -73,7 +73,7 @@ class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_file_extension_group_names()
|
public function update_file_extension_group_names()
|
||||||
{
|
{
|
||||||
// Update file extension group names to use language strings, again.
|
// Update file extension group names to use language strings, again.
|
||||||
$sql = 'SELECT group_id, group_name
|
$sql = 'SELECT group_id, group_name
|
||||||
|
@ -95,7 +95,7 @@ class phpbb_db_migration_data_3_0_9_rc1 extends phpbb_db_migration
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fix_firebird_qa_captcha()
|
public function fix_firebird_qa_captcha()
|
||||||
{
|
{
|
||||||
// Recover from potentially broken Q&A CAPTCHA table on firebird
|
// Recover from potentially broken Q&A CAPTCHA table on firebird
|
||||||
// Q&A CAPTCHA was uninstallable, so it's safe to remove these
|
// Q&A CAPTCHA was uninstallable, so it's safe to remove these
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_9_rc2 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_9_rc2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_9_rc1');
|
return array('phpbb_db_migration_data_3_0_9_rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.9-rc2')),
|
array('config.update', array('version', '3.0.9-rc2')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_9_rc3 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_9_rc3 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_9_rc2');
|
return array('phpbb_db_migration_data_3_0_9_rc2');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.9-rc3')),
|
array('config.update', array('version', '3.0.9-rc3')),
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_0_9_rc4 extends phpbb_db_migration
|
class phpbb_db_migration_data_3_0_9_rc4 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_9_rc3');
|
return array('phpbb_db_migration_data_3_0_9_rc3');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('config.update', array('version', '3.0.9-rc4')),
|
array('config.update', array('version', '3.0.9-rc4')),
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_3_1_0_dev extends phpbb_db_migration
|
class phpbb_db_migration_data_3_1_0_dev extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'phpbb_db_migration_data_3_0_11',
|
'phpbb_db_migration_data_3_0_11',
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_extensions extends phpbb_db_migration
|
class phpbb_db_migration_data_extensions extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11');
|
return array('phpbb_db_migration_data_3_0_11');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_style_update_p1 extends phpbb_db_migration
|
class phpbb_db_migration_data_style_update_p1 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11');
|
return array('phpbb_db_migration_data_3_0_11');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_style_update_p2 extends phpbb_db_migration
|
class phpbb_db_migration_data_style_update_p2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_style_update_p1');
|
return array('phpbb_db_migration_data_style_update_p1');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_timezone extends phpbb_db_migration
|
class phpbb_db_migration_data_timezone extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_3_0_11');
|
return array('phpbb_db_migration_data_3_0_11');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
class phpbb_db_migration_data_timezone_p2 extends phpbb_db_migration
|
class phpbb_db_migration_data_timezone_p2 extends phpbb_db_migration
|
||||||
{
|
{
|
||||||
public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array('phpbb_db_migration_data_timezone');
|
return array('phpbb_db_migration_data_timezone');
|
||||||
}
|
}
|
||||||
|
|
129
phpBB/includes/db/migration/install.php
Normal file
129
phpBB/includes/db/migration/install.php
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package migration
|
||||||
|
* @copyright (c) 2012 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class phpbb_db_migration_install
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* List of phpBB versions/what migration identifier
|
||||||
|
* contains the updates that should have been installed already
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $version_to_migration = array(
|
||||||
|
'3.0.1-rc1' => 'phpbb_db_migration_data_3_0_1_rc1',
|
||||||
|
'3.0.1' => 'phpbb_db_migration_data_3_0_1',
|
||||||
|
'3.0.2-rc1' => 'phpbb_db_migration_data_3_0_2_rc1',
|
||||||
|
'3.0.2-rc2' => 'phpbb_db_migration_data_3_0_2_rc2',
|
||||||
|
'3.0.2' => 'phpbb_db_migration_data_3_0_2',
|
||||||
|
'3.0.3-rc1' => 'phpbb_db_migration_data_3_0_3_rc1',
|
||||||
|
'3.0.3' => 'phpbb_db_migration_data_3_0_3',
|
||||||
|
'3.0.4-rc1' => 'phpbb_db_migration_data_3_0_4_rc1',
|
||||||
|
'3.0.4' => 'phpbb_db_migration_data_3_0_4',
|
||||||
|
'3.0.5-rc1' => array(
|
||||||
|
'phpbb_db_migration_data_3_0_5_rc1',
|
||||||
|
'phpbb_db_migration_data_3_0_5_rc1part2',
|
||||||
|
),
|
||||||
|
'3.0.5' => 'phpbb_db_migration_data_3_0_5',
|
||||||
|
'3.0.6-rc1' => 'phpbb_db_migration_data_3_0_6_rc1',
|
||||||
|
'3.0.6-rc2' => 'phpbb_db_migration_data_3_0_6_rc2',
|
||||||
|
'3.0.6-rc3' => 'phpbb_db_migration_data_3_0_6_rc3',
|
||||||
|
'3.0.6-rc4' => 'phpbb_db_migration_data_3_0_6_rc4',
|
||||||
|
'3.0.6' => 'phpbb_db_migration_data_3_0_6',
|
||||||
|
'3.0.7-rc1' => 'phpbb_db_migration_data_3_0_7_rc1',
|
||||||
|
'3.0.7-rc2' => 'phpbb_db_migration_data_3_0_7_rc2',
|
||||||
|
'3.0.7' => 'phpbb_db_migration_data_3_0_7',
|
||||||
|
'3.0.7-pl1' => 'phpbb_db_migration_data_3_0_7_pl1',
|
||||||
|
'3.0.8-rc1' => 'phpbb_db_migration_data_3_0_8_rc1',
|
||||||
|
'3.0.8' => 'phpbb_db_migration_data_3_0_8',
|
||||||
|
'3.0.9-rc1' => 'phpbb_db_migration_data_3_0_9_rc1',
|
||||||
|
'3.0.9-rc2' => 'phpbb_db_migration_data_3_0_9_rc2',
|
||||||
|
'3.0.9-rc3' => 'phpbb_db_migration_data_3_0_9_rc3',
|
||||||
|
'3.0.9-rc4' => 'phpbb_db_migration_data_3_0_9_rc4',
|
||||||
|
'3.0.9' => 'phpbb_db_migration_data_3_0_9',
|
||||||
|
'3.0.10-rc1' => 'phpbb_db_migration_data_3_0_10_rc1',
|
||||||
|
'3.0.10-rc2' => 'phpbb_db_migration_data_3_0_10_rc2',
|
||||||
|
'3.0.10-rc3' => 'phpbb_db_migration_data_3_0_10_rc3',
|
||||||
|
'3.0.10' => 'phpbb_db_migration_data_3_0_10',
|
||||||
|
'3.0.11-rc1' => 'phpbb_db_migration_data_3_0_11_rc1',
|
||||||
|
'3.0.11-rc2' => 'phpbb_db_migration_data_3_0_11_rc2',
|
||||||
|
'3.0.11' => 'phpbb_db_migration_data_3_0_11',
|
||||||
|
'3.0.12-rc1' => 'phpbb_db_migration_data_3_0_12_rc1',
|
||||||
|
'3.1.0-dev' => array(
|
||||||
|
'phpbb_db_migration_data_style_update_p1',
|
||||||
|
'phpbb_db_migration_data_style_update_p2',
|
||||||
|
'phpbb_db_migration_data_timezone',
|
||||||
|
'phpbb_db_migration_data_timezone_p2',
|
||||||
|
'phpbb_db_migration_data_extensions',
|
||||||
|
'phpbb_db_migration_data_3_1_0_dev',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public function install(phpbb_db_driver $db, phpbb_db_tools $db_tools, $table_prefix, $version)
|
||||||
|
{
|
||||||
|
$this->create_table($db_tools);
|
||||||
|
|
||||||
|
$this->guess_installed_migrations($db, $table_prefix, $version);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function create_table(phpbb_db_tools $db_tools)
|
||||||
|
{
|
||||||
|
if (!$db_tools->sql_table_exists(MIGRATIONS_TABLE))
|
||||||
|
{
|
||||||
|
$db_tools->sql_create_table(MIGRATIONS_TABLE, array(
|
||||||
|
'COLUMNS' => array(
|
||||||
|
'migration_name' => array('VCHAR', ''),
|
||||||
|
'migration_depends_on' => array('TEXT', ''),
|
||||||
|
'migration_schema_done' => array('BOOL', 0),
|
||||||
|
'migration_data_done' => array('BOOL', 0),
|
||||||
|
'migration_data_state' => array('TEXT', ''),
|
||||||
|
'migration_start_time' => array('TIMESTAMP', 0),
|
||||||
|
'migration_end_time' => array('TIMESTAMP', 0),
|
||||||
|
),
|
||||||
|
'PRIMARY_KEY' => 'migration_name',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Guess what migrations have been installed based on phpBB version
|
||||||
|
*
|
||||||
|
* @param mixed $version
|
||||||
|
*/
|
||||||
|
protected function guess_installed_migrations(phpbb_db_driver $db, $table_prefix, $version)
|
||||||
|
{
|
||||||
|
$installed = array();
|
||||||
|
foreach ($this->version_to_migration as $compare => $migration_list)
|
||||||
|
{
|
||||||
|
if (version_compare($version, $compare, '<='))
|
||||||
|
{
|
||||||
|
// The migration should have effectively been installed already
|
||||||
|
if (!is_array($migration_list))
|
||||||
|
{
|
||||||
|
$migration_list = array($migration_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($migration_list as $migration_name)
|
||||||
|
{
|
||||||
|
$sql_ary = array(
|
||||||
|
'migration_name' => $migration_name,
|
||||||
|
'migration_depends_on' => $migration_name::depends_on(),
|
||||||
|
'migration_schema_done' => 1,
|
||||||
|
'migration_data_done' => 1,
|
||||||
|
'migration_data_state' => '',
|
||||||
|
'migration_start_time' => 0,
|
||||||
|
'migration_end_time' => 0,
|
||||||
|
);
|
||||||
|
$sql = 'INSERT INTO ' . $table_prefix . 'migrations ' .
|
||||||
|
$db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
$db->sql_query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -147,21 +147,13 @@ header('Content-type: text/html; charset=UTF-8');
|
||||||
|
|
||||||
// End startup code
|
// End startup code
|
||||||
|
|
||||||
|
// Make sure migrations have been installed. If not, install migrations and guess what migrations have been installed
|
||||||
$db_tools = $phpbb_container->get('dbal.tools');
|
$db_tools = $phpbb_container->get('dbal.tools');
|
||||||
if (!$db_tools->sql_table_exists(MIGRATIONS_TABLE))
|
if (!$db_tools->sql_table_exists(MIGRATIONS_TABLE))
|
||||||
{
|
{
|
||||||
$db_tools->sql_create_table(MIGRATIONS_TABLE, array(
|
$migrations_installer = new phpbb_db_migration_install();
|
||||||
'COLUMNS' => array(
|
$migrations_installer->install($db, $db_tools, $table_prefix, $config['version']);
|
||||||
'migration_name' => array('VCHAR', ''),
|
unset($migrations_installer);
|
||||||
'migration_depends_on' => array('TEXT', ''),
|
|
||||||
'migration_schema_done' => array('BOOL', 0),
|
|
||||||
'migration_data_done' => array('BOOL', 0),
|
|
||||||
'migration_data_state' => array('TEXT', ''),
|
|
||||||
'migration_start_time' => array('TIMESTAMP', 0),
|
|
||||||
'migration_end_time' => array('TIMESTAMP', 0),
|
|
||||||
),
|
|
||||||
'PRIMARY_KEY' => 'migration_name',
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$migrator = $phpbb_container->get('migrator');
|
$migrator = $phpbb_container->get('migrator');
|
||||||
|
|
Loading…
Add table
Reference in a new issue