1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [prep-release-3.0.9] Update Changelog for 3.0.9 release.
  [prep-release-3.0.9] Bumping version number for the final 3.0.9 release.
  [ticket/10247] Removing attempt_id column from the 3.0.8 to 3.0.9-RC1 updater.
  [ticket/10247] Add a db_tools test for the removal of a primary key column.
  [ticket/10247] Add empty data section to database update for RC4
  [ticket/10247] Remove unecessary attempt_id primary key column

Conflicts:
	phpBB/install/database_update.php
This commit is contained in:
Andreas Fischer 2011-07-05 01:07:22 +02:00
commit 5f73cdcdc2
12 changed files with 42 additions and 58 deletions

View File

@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
<property name="newversion" value="3.0.9-RC3" />
<property name="prevversion" value="3.0.9-RC2" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9-RC1" />
<property name="newversion" value="3.0.9" />
<property name="prevversion" value="3.0.8" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.9-RC1, 3.0.9-RC2, 3.0.9-RC3" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />

View File

@ -1225,7 +1225,6 @@ function get_schema_struct()
$schema_data['phpbb_login_attempts'] = array(
'COLUMNS' => array(
'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
'attempt_browser' => array('VCHAR:150', ''),
'attempt_forwarded_for' => array('VCHAR:255', ''),
@ -1234,7 +1233,6 @@ function get_schema_struct()
'username' => array('VCHAR_UNI:255', 0),
'username_clean' => array('VCHAR_CI', 0),
),
'PRIMARY_KEY' => 'attempt_id',
'KEYS' => array(
'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),

View File

@ -333,6 +333,8 @@
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10234'>PHPBB3-10234</a>] - msg_handler() reports E_WARNING as &quot;PHP Notice: &quot;
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10247'>PHPBB3-10247</a>] - mediumint(8) too small for phpbb_login_attempts.attempt_id
</li>
</ul>
<h4> Improvement

View File

@ -1013,7 +1013,12 @@ function database_update_info()
'add_tables' => array(
LOGIN_ATTEMPT_TABLE => array(
'COLUMNS' => array(
'attempt_id' => array('UINT', NULL, 'auto_increment'),
// this column was removed from the database updater
// after 3.0.9-RC3 was released. It might still exist
// in 3.0.9-RCX installations and has to be dropped in
// 3.0.10 after the db_tools class is capable of properly
// removing a primary key.
// 'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
'attempt_browser' => array('VCHAR:150', ''),
'attempt_forwarded_for' => array('VCHAR:255', ''),
@ -1037,6 +1042,14 @@ function database_update_info()
),
),
),
// No changes from 3.0.9-RC1 to 3.0.9-RC2
'3.0.9-RC1' => array(),
// No changes from 3.0.9-RC2 to 3.0.9-RC3
'3.0.9-RC2' => array(),
// No changes from 3.0.9-RC3 to 3.0.9
'3.0.9-RC3' => array(),
/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.10-RC1 */
// Changes from 3.1.0-dev to 3.1.0-A1
'3.1.0-dev' => array(
@ -2046,6 +2059,18 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
// No changes from 3.0.9-RC1 to 3.0.9-RC2
case '3.0.9-RC1':
break;
// No changes from 3.0.9-RC2 to 3.0.9-RC3
case '3.0.9-RC2':
break;
// No changes from 3.0.9-RC3 to 3.0.9
case '3.0.9-RC3':
break;
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':
set_config('use_system_cron', 0);

View File

@ -549,7 +549,6 @@ END;;
# Table: 'phpbb_login_attempts'
CREATE TABLE phpbb_login_attempts (
attempt_id INTEGER NOT NULL,
attempt_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
attempt_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
attempt_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
@ -559,24 +558,11 @@ CREATE TABLE phpbb_login_attempts (
username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE
);;
ALTER TABLE phpbb_login_attempts ADD PRIMARY KEY (attempt_id);;
CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts(attempt_ip, attempt_time);;
CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts(attempt_forwarded_for, attempt_time);;
CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts(attempt_time);;
CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts(user_id);;
CREATE GENERATOR phpbb_login_attempts_gen;;
SET GENERATOR phpbb_login_attempts_gen TO 0;;
CREATE TRIGGER t_phpbb_login_attempts FOR phpbb_login_attempts
BEFORE INSERT
AS
BEGIN
NEW.attempt_id = GEN_ID(phpbb_login_attempts_gen, 1);
END;;
# Table: 'phpbb_moderator_cache'
CREATE TABLE phpbb_moderator_cache (
forum_id INTEGER DEFAULT 0 NOT NULL,

View File

@ -657,7 +657,6 @@ GO
Table: 'phpbb_login_attempts'
*/
CREATE TABLE [phpbb_login_attempts] (
[attempt_id] [int] IDENTITY (1, 1) NOT NULL ,
[attempt_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
[attempt_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
[attempt_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
@ -668,13 +667,6 @@ CREATE TABLE [phpbb_login_attempts] (
) ON [PRIMARY]
GO
ALTER TABLE [phpbb_login_attempts] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_login_attempts] PRIMARY KEY CLUSTERED
(
[attempt_id]
) ON [PRIMARY]
GO
CREATE INDEX [att_ip] ON [phpbb_login_attempts]([attempt_ip], [attempt_time]) ON [PRIMARY]
GO

View File

@ -373,7 +373,6 @@ CREATE TABLE phpbb_log (
# Table: 'phpbb_login_attempts'
CREATE TABLE phpbb_login_attempts (
attempt_id mediumint(8) UNSIGNED NOT NULL auto_increment,
attempt_ip varbinary(40) DEFAULT '' NOT NULL,
attempt_browser varbinary(150) DEFAULT '' NOT NULL,
attempt_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
@ -381,7 +380,6 @@ CREATE TABLE phpbb_login_attempts (
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
username blob NOT NULL,
username_clean blob NOT NULL,
PRIMARY KEY (attempt_id),
KEY att_ip (attempt_ip, attempt_time),
KEY att_for (attempt_forwarded_for, attempt_time),
KEY att_time (attempt_time),

View File

@ -373,7 +373,6 @@ CREATE TABLE phpbb_log (
# Table: 'phpbb_login_attempts'
CREATE TABLE phpbb_login_attempts (
attempt_id mediumint(8) UNSIGNED NOT NULL auto_increment,
attempt_ip varchar(40) DEFAULT '' NOT NULL,
attempt_browser varchar(150) DEFAULT '' NOT NULL,
attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
@ -381,7 +380,6 @@ CREATE TABLE phpbb_login_attempts (
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
username varchar(255) DEFAULT '0' NOT NULL,
username_clean varchar(255) DEFAULT '0' NOT NULL,
PRIMARY KEY (attempt_id),
KEY att_ip (attempt_ip, attempt_time),
KEY att_for (attempt_forwarded_for, attempt_time),
KEY att_time (attempt_time),

View File

@ -747,15 +747,13 @@ END;
Table: 'phpbb_login_attempts'
*/
CREATE TABLE phpbb_login_attempts (
attempt_id number(8) NOT NULL,
attempt_ip varchar2(40) DEFAULT '' ,
attempt_browser varchar2(150) DEFAULT '' ,
attempt_forwarded_for varchar2(255) DEFAULT '' ,
attempt_time number(11) DEFAULT '0' NOT NULL,
user_id number(8) DEFAULT '0' NOT NULL,
username varchar2(765) DEFAULT '0' NOT NULL,
username_clean varchar2(255) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_login_attempts PRIMARY KEY (attempt_id)
username_clean varchar2(255) DEFAULT '0' NOT NULL
)
/
@ -768,22 +766,6 @@ CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time
CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id)
/
CREATE SEQUENCE phpbb_login_attempts_seq
/
CREATE OR REPLACE TRIGGER t_phpbb_login_attempts
BEFORE INSERT ON phpbb_login_attempts
FOR EACH ROW WHEN (
new.attempt_id IS NULL OR new.attempt_id = 0
)
BEGIN
SELECT phpbb_login_attempts_seq.nextval
INTO :new.attempt_id
FROM dual;
END;
/
/*
Table: 'phpbb_moderator_cache'
*/

View File

@ -529,18 +529,14 @@ CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
/*
Table: 'phpbb_login_attempts'
*/
CREATE SEQUENCE phpbb_login_attempts_seq;
CREATE TABLE phpbb_login_attempts (
attempt_id INT4 DEFAULT nextval('phpbb_login_attempts_seq'),
attempt_ip varchar(40) DEFAULT '' NOT NULL,
attempt_browser varchar(150) DEFAULT '' NOT NULL,
attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
attempt_time INT4 DEFAULT '0' NOT NULL CHECK (attempt_time >= 0),
user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
username varchar(255) DEFAULT '0' NOT NULL,
username_clean varchar_ci DEFAULT '0' NOT NULL,
PRIMARY KEY (attempt_id)
username_clean varchar_ci DEFAULT '0' NOT NULL
);
CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);

View File

@ -361,7 +361,6 @@ CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
# Table: 'phpbb_login_attempts'
CREATE TABLE phpbb_login_attempts (
attempt_id INTEGER PRIMARY KEY NOT NULL ,
attempt_ip varchar(40) NOT NULL DEFAULT '',
attempt_browser varchar(150) NOT NULL DEFAULT '',
attempt_forwarded_for varchar(255) NOT NULL DEFAULT '',

View File

@ -241,6 +241,15 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
}
public function test_column_remove()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
$this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_int_size'));
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
}
public function test_column_remove_primary()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@ -264,5 +273,4 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->tools->sql_table_drop('prefix_test_table');
}
}