From 306beab4cba155a933391c40c75f5dd9c57fd69e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 31 May 2014 14:56:03 +0200 Subject: [PATCH] [ticket/12352] Add checks for existing user_pass_convert to migrations PHPBB3-12352 --- phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php | 6 ++++++ phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php index 24af20cf5c..a0c7c7eb75 100644 --- a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php @@ -25,6 +25,12 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration public function update_passwords($start) { + // Nothing to do if user_pass_convert column doesn't exist + if (!$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert')) + { + return; + } + $start = (int) $start; $limit = 1000; $converted_users = 0; diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php index 3a7d3d2169..e7d5e4e157 100644 --- a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php @@ -11,6 +11,11 @@ namespace phpbb\db\migration\data\v310; class passwords_convert_p2 extends \phpbb\db\migration\migration { + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert'); + } + static public function depends_on() { return array('\phpbb\db\migration\data\v310\passwords_convert_p1');