mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10411] Revert database_update.php changes from for easier update
Revert the changes from 8fc022033a
* [ticket/10411] Update schema and fix database update
The database changes will be added as a migration in the next step
PHPBB3-10411
This commit is contained in:
parent
ba97303a60
commit
d61eb95b48
1 changed files with 16 additions and 36 deletions
|
@ -1165,18 +1165,11 @@ function database_update_info()
|
||||||
'ext_name' => array('UNIQUE', 'ext_name'),
|
'ext_name' => array('UNIQUE', 'ext_name'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TEAMPAGE_TABLE => array(
|
|
||||||
'COLUMNS' => array(
|
|
||||||
'teampage_id' => array('UINT', NULL, 'auto_increment'),
|
|
||||||
'group_id' => array('UINT', 0),
|
|
||||||
'teampage_name' => array('VCHAR_UNI:255', ''),
|
|
||||||
'teampage_position' => array('UINT', 0),
|
|
||||||
'teampage_parent' => array('UINT', 0),
|
|
||||||
),
|
|
||||||
'PRIMARY_KEY' => 'teampage_id',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
'add_columns' => array(
|
'add_columns' => array(
|
||||||
|
GROUPS_TABLE => array(
|
||||||
|
'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
|
||||||
|
),
|
||||||
PROFILE_FIELDS_TABLE => array(
|
PROFILE_FIELDS_TABLE => array(
|
||||||
'field_show_on_pm' => array('BOOL', 0),
|
'field_show_on_pm' => array('BOOL', 0),
|
||||||
),
|
),
|
||||||
|
@ -2482,39 +2475,26 @@ function change_database_data(&$no_updates, $version)
|
||||||
set_config('use_system_cron', 0);
|
set_config('use_system_cron', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT teampage_id
|
$sql = 'SELECT group_teampage
|
||||||
FROM ' . TEAMPAGE_TABLE;
|
FROM ' . GROUPS_TABLE . '
|
||||||
|
WHERE group_teampage > 0';
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$added_groups_teampage = (bool) $db->sql_fetchfield('teampage_id');
|
$added_groups_teampage = (bool) $db->sql_fetchfield('group_teampage');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!$added_groups_teampage)
|
if (!$added_groups_teampage)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'UPDATE ' . GROUPS_TABLE . '
|
||||||
FROM ' . GROUPS_TABLE . '
|
SET group_teampage = 1
|
||||||
WHERE group_type = ' . GROUP_SPECIAL . "
|
WHERE group_type = ' . GROUP_SPECIAL . "
|
||||||
AND (group_name = 'ADMINISTRATORS'
|
AND group_name = 'ADMINISTRATORS'";
|
||||||
OR group_name = 'GLOBAL_MODERATORS')
|
_sql($sql, $errored, $error_ary);
|
||||||
ORDER BY group_name ASC";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$teampage_entries = array();
|
$sql = 'UPDATE ' . GROUPS_TABLE . '
|
||||||
while ($row = $db->sql_fetchrow($result))
|
SET group_teampage = 2
|
||||||
{
|
WHERE group_type = ' . GROUP_SPECIAL . "
|
||||||
$teampage_entries[] = array(
|
AND group_name = 'GLOBAL_MODERATORS'";
|
||||||
'group_id' => (int) $row['group_id'],
|
_sql($sql, $errored, $error_ary);
|
||||||
'teampage_name' => '',
|
|
||||||
'teampage_position' => sizeof($teampage_entries) + 1,
|
|
||||||
'teampage_parent' => 0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if (sizeof($teampage_entries))
|
|
||||||
{
|
|
||||||
$db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries);
|
|
||||||
}
|
|
||||||
unset($teampage_entries);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($config['legend_sort_groupname']))
|
if (!isset($config['legend_sort_groupname']))
|
||||||
|
|
Loading…
Add table
Reference in a new issue