[ticket/9549] Update database with the new config values and columns

PHPBB3-9549
This commit is contained in:
Joas Schilling 2011-02-09 21:03:37 +01:00
parent b7d3d57b70
commit 023a102082
10 changed files with 89 additions and 17 deletions

View file

@ -1146,7 +1146,8 @@ function get_schema_struct()
'group_receive_pm' => array('BOOL', 0), 'group_receive_pm' => array('BOOL', 0),
'group_message_limit' => array('UINT', 0), 'group_message_limit' => array('UINT', 0),
'group_max_recipients' => array('UINT', 0), 'group_max_recipients' => array('UINT', 0),
'group_legend' => array('BOOL', 1), 'group_legend' => array('UINT', 0),
'group_teampage' => array('UINT', 0),
), ),
'PRIMARY_KEY' => 'group_id', 'PRIMARY_KEY' => 'group_id',
'KEYS' => array( 'KEYS' => array(

View file

@ -920,8 +920,19 @@ function database_update_info()
'3.0.7-PL1' => array(), '3.0.7-PL1' => array(),
// No changes from 3.0.8-RC1 to 3.0.8 // No changes from 3.0.8-RC1 to 3.0.8
'3.0.8-RC1' => array(), '3.0.8-RC1' => array(),
// No changes from 3.1.0-dev to 3.1.0-A1 // Changes from 3.1.0-dev to 3.1.0-A1
'3.1.0-dev' => array(), '3.1.0-dev' => array(
'add_columns' => array(
GROUPS_TABLE => array(
'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
),
),
'change_columns' => array(
GROUPS_TABLE => array(
'group_legend' => array('UINT', 0),
),
),
),
); );
} }
@ -1868,6 +1879,56 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.1.0-dev to 3.1.0-A1 // Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev': case '3.1.0-dev':
set_config('use_system_cron', 0); set_config('use_system_cron', 0);
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_teampage = 1
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'ADMINISTRATORS'";
_sql($sql, $errored, $error_ary);
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_teampage = 2
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'GLOBAL_MODERATORS'";
_sql($sql, $errored, $error_ary);
set_config('legend_sort_groupname', '1');
set_config('teampage_multiple', '1');
set_config('teampage_forums', '1');
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
$result = $db->sql_query($sql);
$next_legend = 1;
while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_legend = ' . $next_legend . '
WHERE group_id = ' . (int) $row['group_id'];
_sql($sql, $errored, $error_ary);
$next_legend++;
}
$db->sql_freeresult($result);
unset($next_legend);
// Install modules
$modules_to_install = array(
'position' => array(
'base' => 'groups',
'class' => 'acp',
'title' => 'ACP_GROUPS_POSITION',
'auth' => 'acl_a_group',
'cat' => 'ACP_GROUPS',
),
);
_add_modules($modules_to_install);
$no_updates = false;
break; break;
} }
} }

View file

@ -444,7 +444,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INTEGER DEFAULT 0 NOT NULL, group_receive_pm INTEGER DEFAULT 0 NOT NULL,
group_message_limit INTEGER DEFAULT 0 NOT NULL, group_message_limit INTEGER DEFAULT 0 NOT NULL,
group_max_recipients INTEGER DEFAULT 0 NOT NULL, group_max_recipients INTEGER DEFAULT 0 NOT NULL,
group_legend INTEGER DEFAULT 1 NOT NULL group_legend INTEGER DEFAULT 0 NOT NULL,
group_teampage INTEGER DEFAULT 0 NOT NULL
);; );;
ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);; ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;

View file

@ -546,7 +546,8 @@ CREATE TABLE [phpbb_groups] (
[group_receive_pm] [int] DEFAULT (0) NOT NULL , [group_receive_pm] [int] DEFAULT (0) NOT NULL ,
[group_message_limit] [int] DEFAULT (0) NOT NULL , [group_message_limit] [int] DEFAULT (0) NOT NULL ,
[group_max_recipients] [int] DEFAULT (0) NOT NULL , [group_max_recipients] [int] DEFAULT (0) NOT NULL ,
[group_legend] [int] DEFAULT (1) NOT NULL [group_legend] [int] DEFAULT (0) NOT NULL ,
[group_teampage] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY] ) ON [PRIMARY]
GO GO

View file

@ -316,7 +316,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (group_id), PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name(255)) KEY group_legend_name (group_legend, group_name(255))
); );

View file

@ -316,7 +316,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (group_id), PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name) KEY group_legend_name (group_legend, group_name)
) CHARACTER SET `utf8` COLLATE `utf8_bin`; ) CHARACTER SET `utf8` COLLATE `utf8_bin`;

View file

@ -605,7 +605,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm number(1) DEFAULT '0' NOT NULL, group_receive_pm number(1) DEFAULT '0' NOT NULL,
group_message_limit number(8) DEFAULT '0' NOT NULL, group_message_limit number(8) DEFAULT '0' NOT NULL,
group_max_recipients number(8) DEFAULT '0' NOT NULL, group_max_recipients number(8) DEFAULT '0' NOT NULL,
group_legend number(1) DEFAULT '1' NOT NULL, group_legend number(8) DEFAULT '0' NOT NULL,
group_teampage number(8) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id) CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
) )
/ /

View file

@ -459,7 +459,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0), group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0), group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0), group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
group_legend INT2 DEFAULT '1' NOT NULL CHECK (group_legend >= 0), group_legend INT4 DEFAULT '0' NOT NULL CHECK (group_legend >= 0),
group_teampage INT4 DEFAULT '0' NOT NULL CHECK (group_teampage >= 0),
PRIMARY KEY (group_id) PRIMARY KEY (group_id)
); );

View file

@ -151,6 +151,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('legend_sort_groupname', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0');
@ -238,6 +239,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_multiple', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
@ -520,13 +523,13 @@ INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_reg
INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
# -- Groups # -- Groups
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 1, '', '', '', 0); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 2, 2, '', '', '', 0);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, 1, '', '', '', 0);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5); INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, 0, '', '', '', 5);
# -- User -> Group # -- User -> Group
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0); INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);

View file

@ -308,7 +308,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0', group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0', group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0', group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1' group_legend INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_teampage INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );
CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name); CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);