From 09cfa01d589ead86cf811e27b52167539e0478ec Mon Sep 17 00:00:00 2001
From: Nils Adermann <naderman@naderman.de>
Date: Mon, 16 Sep 2013 03:14:39 +0200
Subject: [ticket/11700] Fix installation after develop merge

PHPBB3-11700
---
 .../db/migration/data/310/auth_provider_oauth.php  | 71 ---------------------
 phpBB/phpbb/db/migration/data/310/mod_rewrite.php  | 25 --------
 .../db/migration/data/310/notifications_cron.php   | 25 --------
 .../migration/data/310/softdelete_mcp_modules.php  | 55 ----------------
 .../db/migration/data/v310/auth_provider_oauth.php | 73 ++++++++++++++++++++++
 phpBB/phpbb/db/migration/data/v310/mod_rewrite.php | 27 ++++++++
 .../db/migration/data/v310/notifications_cron.php  | 27 ++++++++
 .../migration/data/v310/softdelete_mcp_modules.php | 57 +++++++++++++++++
 8 files changed, 184 insertions(+), 176 deletions(-)
 delete mode 100644 phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php
 delete mode 100644 phpBB/phpbb/db/migration/data/310/mod_rewrite.php
 delete mode 100644 phpBB/phpbb/db/migration/data/310/notifications_cron.php
 delete mode 100644 phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php
 create mode 100644 phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
 create mode 100644 phpBB/phpbb/db/migration/data/v310/mod_rewrite.php
 create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_cron.php
 create mode 100644 phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php

(limited to 'phpBB/phpbb/db')

diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php
deleted file mode 100644
index cad1c16bb2..0000000000
--- a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
-*
-* @package migration
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
-*
-*/
-
-class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration
-{
-	public function effectively_installed()
-	{
-		return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth');
-	}
-
-	public function update_schema()
-	{
-		return array(
-			'add_tables'	=> array(
-				$this->table_prefix . 'oauth_tokens'	=> array(
-					'COLUMNS' => array(
-						'user_id'			=> array('UINT', 0), // phpbb_users.user_id
-						'session_id'		=> array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
-						'provider'			=> array('VCHAR', ''), // Name of the OAuth provider
-						'oauth_token'		=> array('MTEXT', ''), // Serialized token
-					),
-					'KEYS' => array(
-						'user_id'			=> array('INDEX', 'user_id'),
-						'provider'			=> array('INDEX', 'provider'),
-					),
-				),
-				$this->table_prefix . 'oauth_accounts'	=> array(
-					'COLUMNS' => array(
-						'user_id'			=> array('UINT', 0),
-						'provider'			=> array('VCHAR', ''),
-						'oauth_provider_id'	=> array('TEXT_UNI', ''),
-					),
-					'PRIMARY_KEY' => array(
-						'user_id',
-						'provider',
-					),
-				),
-			),
-		);
-	}
-
-	public function revert_schema()
-	{
-		return array(
-			'drop_tables'	=> array(
-				$this->table_prefix . 'oauth_tokens',
-				$this->table_prefix . 'oauth_accounts',
-			),
-		);
-	}
-
-	public function update_data()
-	{
-		return array(
-			array('module.add', array(
-				'ucp',
-				'UCP_PROFILE',
-				array(
-					'module_basename'	=> 'ucp_auth_link',
-					'modes'				=> array('auth_link'),
-				),
-			)),
-		);
-	}
-}
diff --git a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/310/mod_rewrite.php
deleted file mode 100644
index 85ce25abf3..0000000000
--- a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
-*
-* @package migration
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
-*
-*/
-
-class phpbb_db_migration_data_310_mod_rewrite extends phpbb_db_migration
-{
-	static public function depends_on()
-	{
-		return array(
-			'phpbb_db_migration_data_310_dev',
-		);
-	}
-
-	public function update_data()
-	{
-		return array(
-			array('config.add', array('enable_mod_rewrite', '0')),
-		);
-	}
-}
diff --git a/phpBB/phpbb/db/migration/data/310/notifications_cron.php b/phpBB/phpbb/db/migration/data/310/notifications_cron.php
deleted file mode 100644
index 454628e50e..0000000000
--- a/phpBB/phpbb/db/migration/data/310/notifications_cron.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
-*
-* @package migration
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-class phpbb_db_migration_data_310_notifications_cron extends phpbb_db_migration
-{
-	static public function depends_on()
-	{
-		return array('phpbb_db_migration_data_310_notifications');
-	}
-
-	public function update_data()
-	{
-		return array(
-			array('config.add', array('read_notification_expire_days', 30)),
-			array('config.add', array('read_notification_last_gc', 0)), // last run
-			array('config.add', array('read_notification_gc', (60 * 60 * 24))), // seconds between run; 1 day
-		);
-	}
-}
diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php
deleted file mode 100644
index f80f55d19a..0000000000
--- a/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
-*
-* @package migration
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
-*
-*/
-
-class phpbb_db_migration_data_310_softdelete_mcp_modules extends phpbb_db_migration
-{
-	public function effectively_installed()
-	{
-		$sql = 'SELECT module_id
-			FROM ' . MODULES_TABLE . "
-			WHERE module_class = 'mcp'
-				AND module_basename = 'mcp_queue'
-				AND module_mode = 'deleted_topics'";
-		$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_310_dev',
-			'phpbb_db_migration_data_310_softdelete_p2',
-		);
-	}
-
-	public function update_data()
-	{
-		return array(
-			array('module.add', array(
-				'mcp',
-				'MCP_QUEUE',
-				array(
-					'module_basename'	=> 'mcp_queue',
-					'modes'				=> array('deleted_topics'),
-				),
-			)),
-			array('module.add', array(
-				'mcp',
-				'MCP_QUEUE',
-				array(
-					'module_basename'	=> 'mcp_queue',
-					'modes'				=> array('deleted_posts'),
-				),
-			)),
-		);
-	}
-}
diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
new file mode 100644
index 0000000000..971a7e8504
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
@@ -0,0 +1,73 @@
+<?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 auth_provider_oauth extends \phpbb\db\migration\migration
+{
+	public function effectively_installed()
+	{
+		return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth');
+	}
+
+	public function update_schema()
+	{
+		return array(
+			'add_tables'	=> array(
+				$this->table_prefix . 'oauth_tokens'	=> array(
+					'COLUMNS' => array(
+						'user_id'			=> array('UINT', 0), // phpbb_users.user_id
+						'session_id'		=> array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
+						'provider'			=> array('VCHAR', ''), // Name of the OAuth provider
+						'oauth_token'		=> array('MTEXT', ''), // Serialized token
+					),
+					'KEYS' => array(
+						'user_id'			=> array('INDEX', 'user_id'),
+						'provider'			=> array('INDEX', 'provider'),
+					),
+				),
+				$this->table_prefix . 'oauth_accounts'	=> array(
+					'COLUMNS' => array(
+						'user_id'			=> array('UINT', 0),
+						'provider'			=> array('VCHAR', ''),
+						'oauth_provider_id'	=> array('TEXT_UNI', ''),
+					),
+					'PRIMARY_KEY' => array(
+						'user_id',
+						'provider',
+					),
+				),
+			),
+		);
+	}
+
+	public function revert_schema()
+	{
+		return array(
+			'drop_tables'	=> array(
+				$this->table_prefix . 'oauth_tokens',
+				$this->table_prefix . 'oauth_accounts',
+			),
+		);
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('module.add', array(
+				'ucp',
+				'UCP_PROFILE',
+				array(
+					'module_basename'	=> 'ucp_auth_link',
+					'modes'				=> array('auth_link'),
+				),
+			)),
+		);
+	}
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php
new file mode 100644
index 0000000000..ffb790b135
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php
@@ -0,0 +1,27 @@
+<?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 mod_rewrite extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return array(
+			'\phpbb\db\migration\data\v310\dev',
+		);
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('config.add', array('enable_mod_rewrite', '0')),
+		);
+	}
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron.php
new file mode 100644
index 0000000000..d5fa9c58a5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron.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 extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return array('\phpbb\db\migration\data\v310\notifications');
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('config.add', array('read_notification_expire_days', 30)),
+			array('config.add', array('read_notification_last_gc', 0)), // last run
+			array('config.add', array('read_notification_gc', (60 * 60 * 24))), // seconds between run; 1 day
+		);
+	}
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php
new file mode 100644
index 0000000000..2db9780601
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php
@@ -0,0 +1,57 @@
+<?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 softdelete_mcp_modules extends \phpbb\db\migration\migration
+{
+	public function effectively_installed()
+	{
+		$sql = 'SELECT module_id
+			FROM ' . MODULES_TABLE . "
+			WHERE module_class = 'mcp'
+				AND module_basename = 'mcp_queue'
+				AND module_mode = 'deleted_topics'";
+		$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',
+			'phpbb\db\migration\data\v310\softdelete_p2',
+		);
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('module.add', array(
+				'mcp',
+				'MCP_QUEUE',
+				array(
+					'module_basename'	=> 'mcp_queue',
+					'modes'				=> array('deleted_topics'),
+				),
+			)),
+			array('module.add', array(
+				'mcp',
+				'MCP_QUEUE',
+				array(
+					'module_basename'	=> 'mcp_queue',
+					'modes'				=> array('deleted_posts'),
+				),
+			)),
+		);
+	}
+}
-- 
cgit v1.2.1