mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11691] Move purge code into new function
PHPBB3-11691
This commit is contained in:
parent
3b7abb98e1
commit
8aa9f1d3ab
1 changed files with 7 additions and 7 deletions
|
@ -19,22 +19,22 @@ class notification_options_reconvert extends \phpbb\db\migration\migration
|
||||||
public function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
array('custom', array(array($this, 'purge_notifications'))),
|
||||||
array('custom', array(array($this, 'convert_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)
|
public function convert_notifications($start)
|
||||||
{
|
{
|
||||||
$insert_table = $this->table_prefix . 'user_notifications';
|
$insert_table = $this->table_prefix . 'user_notifications';
|
||||||
$insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $insert_table);
|
$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);
|
return $this->perform_conversion($insert_buffer, $insert_table, $start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue