From 8aa9f1d3abe4ec2ad7d7692d70d19c4accb6ec43 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 19 Aug 2013 10:34:26 +0200 Subject: [PATCH] [ticket/11691] Move purge code into new function PHPBB3-11691 --- .../data/v310/notification_options_reconvert.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php index 16509d7833..a4962b177d 100644 --- a/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php +++ b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php @@ -19,22 +19,22 @@ class notification_options_reconvert extends \phpbb\db\migration\migration public function update_data() { return array( + array('custom', array(array($this, 'purge_notifications'))), array('custom', array(array($this, 'convert_notifications'))), ); } + public function purge_notifications() + { + $sql = 'DELETE FROM ' . $insert_table; + $this->sql_query($sql); + } + public function convert_notifications($start) { $insert_table = $this->table_prefix . 'user_notifications'; $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $insert_table); - $start = (int) $start; - if ($start == 0) - { - $sql = 'DELETE FROM ' . $insert_table; - $this->db->sql_query($sql); - } - return $this->perform_conversion($insert_buffer, $insert_table, $start); }