diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-07 13:19:59 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-07 13:19:59 +0000 |
| commit | 5de26540b4f0348719ec93e760ed987f92a60075 (patch) | |
| tree | c3404563a65d5ed2699257ee82d723fb39b28cfe /phpBB/install | |
| parent | 8678ad0b0b2f83ce91047f06fb73474105a70d7c (diff) | |
| download | forums-5de26540b4f0348719ec93e760ed987f92a60075.tar forums-5de26540b4f0348719ec93e760ed987f92a60075.tar.gz forums-5de26540b4f0348719ec93e760ed987f92a60075.tar.bz2 forums-5de26540b4f0348719ec93e760ed987f92a60075.tar.xz forums-5de26540b4f0348719ec93e760ed987f92a60075.zip | |
fixing some bugs
changed the way we are handling bookmarks. No order_id required, really! Order by last post time as suggested by BartVB.
git-svn-id: file:///svn/phpbb/trunk@7497 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
| -rw-r--r-- | phpBB/install/database_update.php | 15 | ||||
| -rw-r--r-- | phpBB/install/install_convert.php | 9 | ||||
| -rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 7 | ||||
| -rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 13 | ||||
| -rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 4 | ||||
| -rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 4 | ||||
| -rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 6 | ||||
| -rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 4 | ||||
| -rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 4 |
9 files changed, 37 insertions, 29 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 395fcc4918..79c7145797 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -336,6 +336,10 @@ $database_update_info = array( STYLES_IMAGESET_TABLE => array( 'imgset_nm', ), + BOOKMARKS_TABLE => array( + 'order_id', + 'topic_user_id', + ), ), 'add_index' => array( SEARCH_WORDLIST_TABLE => array( @@ -363,7 +367,7 @@ $database_update_info = array( 'username_clean' => array('username_clean'), ), ), - // Add the following columns + // Drop the following columns 'drop_columns' => array( STYLES_IMAGESET_TABLE => array( 'site_logo', @@ -461,6 +465,15 @@ $database_update_info = array( 'user_icon9', 'user_icon10' ), + BOOKMARKS_TABLE => array( + 'order_id', + ), + ), + // Adding primary key + 'add_primary_keys' => array( + BOOKMARKS_TABLE => array( + 'topic_id', 'user_id', + ), ), ), ); diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 52e4d1cf14..12d4eda5ec 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -753,7 +753,14 @@ class install_convert extends module $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__); } - $search_type = $config['search_type']; + $search_type = basename(trim($config['search_type'])); + + // For conversions we are a bit less strict and set to a search backend we know exist... + if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + { + $search_type = 'fulltext_native'; + set_config('search_type', $search_type); + } if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) { diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 50a59d9c98..f815449d19 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -179,12 +179,11 @@ CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting); # Table: 'phpbb_bookmarks' CREATE TABLE phpbb_bookmarks ( topic_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - order_id INTEGER DEFAULT 0 NOT NULL + user_id INTEGER DEFAULT 0 NOT NULL );; -CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks(order_id);; -CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks(topic_id, user_id);; +ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);; + # Table: 'phpbb_bots' CREATE TABLE phpbb_bots ( diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 7caea395ec..3e58881427 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -236,15 +236,16 @@ GO */ CREATE TABLE [phpbb_bookmarks] ( [topic_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [order_id] [int] DEFAULT (0) NOT NULL + [user_id] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO -CREATE INDEX [order_id] ON [phpbb_bookmarks]([order_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_user_id] ON [phpbb_bookmarks]([topic_id], [user_id]) ON [PRIMARY] +ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_bookmarks] PRIMARY KEY CLUSTERED + ( + [topic_id], + [user_id] + ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index a5d850ca68..db814a3613 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -129,9 +129,7 @@ CREATE TABLE phpbb_bbcodes ( CREATE TABLE phpbb_bookmarks ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - order_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - KEY order_id (order_id), - KEY topic_user_id (topic_id, user_id) + PRIMARY KEY (topic_id, user_id) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 6308ed0c15..dee258d888 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -129,9 +129,7 @@ CREATE TABLE phpbb_bbcodes ( CREATE TABLE phpbb_bookmarks ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - order_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - KEY order_id (order_id), - KEY topic_user_id (topic_id, user_id) + PRIMARY KEY (topic_id, user_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8ad99ea189..9660dbf386 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -278,14 +278,10 @@ CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting) CREATE TABLE phpbb_bookmarks ( topic_id number(8) DEFAULT '0' NOT NULL, user_id number(8) DEFAULT '0' NOT NULL, - order_id number(8) DEFAULT '0' NOT NULL + CONSTRAINT pk_phpbb_bookmarks PRIMARY KEY (topic_id, user_id) ) / -CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id) -/ -CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id) -/ /* Table: 'phpbb_bots' diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index fe20316705..c976a2a157 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -234,11 +234,9 @@ CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting) CREATE TABLE phpbb_bookmarks ( topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - order_id INT4 DEFAULT '0' NOT NULL CHECK (order_id >= 0) + PRIMARY KEY (topic_id, user_id) ); -CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id); -CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id); /* Table: 'phpbb_bots' diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index fcd6a50679..9f48115874 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -127,11 +127,9 @@ CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting) CREATE TABLE phpbb_bookmarks ( topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - order_id INTEGER UNSIGNED NOT NULL DEFAULT '0' + PRIMARY KEY (topic_id, user_id) ); -CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id); -CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id); # Table: 'phpbb_bots' CREATE TABLE phpbb_bots ( |
