Code: Select all
'\phpbb\db\migration\data\v310\remove_acp_styles_cache',
Code: Select all
'\phpbb\db\migration\data\v310\user_reminded_time',
Code: Select all
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v310;
class user_reminded_time extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array('\phpbb\db\migration\data\v30x\release_3_0_11');
}
public function update_schema()
{
return array(
'fill_columns' => array(
$this->table_prefix . 'users' => array(
'user_reminded_time' => array('UINT', 0),
),
),
);
}
public function revert_schema()
{
return array(
'fill_columns' => array(
$this->table_prefix . 'users' => array(
'user_reminded_time' => array('UINT', 0),
),
),
);
}
}
Code: Select all
'add_index' => 2,
Code: Select all
'fill_columns' => 2,
Code: Select all
// Change columns?
Code: Select all
// Fill columns?
if (!empty($schema_changes['fill_columns']))
{
foreach ($schema_changes['fill_columns'] as $table => $columns)
{
foreach ($columns as $column_name => $column_data)
{
// If the column exists we change it, else we add it ;)
if ($column_exists = $this->sql_column_exists($table, $column_name))
{
$result = $this->sql_column_fill($table, $column_name, $column_data, true);
}
}
}
}
Code: Select all
/**
* Change column type (not name!)
*/
Code: Select all
/**
* Fill column
*/
function sql_column_fill($table_name, $column_name, $column_data, $check_isnull)
{
$statements = array();
if ($check_isnull)
{
$where = 'WHERE ' . $column_name . ' ISNULL';
}
else
{
$where = '';
}
switch ($this->sql_layer)
{
case 'sqlite':
case 'sqlite3':
$statements[] = 'UPDATE ' . $table_name . ' set ' . $column_name . ' = ' . $column_data[1] . ' ' . $where;
}
return $this->_sql_run_sql($statements);
}
Code: Select all
UPDATE phpbb_users SET user_reminded_time = 0 WHERE user_reminded_time ISNULL;
I've been meaning to reply to this for awhile now, but had been forgetting to.Boris Berdichevski wrote:Original driver of sqlite3 from 3.1.x has a defect. Fix is here.
Code: Select all
return (isset($row[$field])) ? $row[$field] : false;
Code: Select all
$this->sql_freeresult($query_id);
Code: Select all
var $n_msec = 250000;
Code: Select all
var $n_msec = 5000;
Code: Select all
$this->db_connect_id = true;
Code: Select all
$this->dbo->busyTimeout($this->n_msec);
Code: Select all
case 'sqlite':
case 'sqlite3':
$sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id';
$sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results
FROM (' . $this->db->sql_build_query('SELECT', $sql_array_count) . ')';
// no break
default:
$sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results';
$sql = (!$sql) ? $this->db->sql_build_query('SELECT', $sql_array_count) : $sql;
Code: Select all
{
if ($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3')
{
$sql = 'SELECT COUNT(topic_id) as total_results
FROM (SELECT DISTINCT t.topic_id';
}
else
{
$sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results';
}
$sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
WHERE $sql_author
$sql_topic_id
$sql_firstpost
$post_visibility
$sql_fora
AND t.topic_id = p.topic_id
$sql_time" . (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') ? ')' : '');
}
Code: Select all
[root]/phpBB3/search/fulltext_native.php
Code: Select all
[root]/phpBB3/phpbb/search/fulltext_native.php