diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-29 01:25:46 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-29 02:10:42 -0400 |
commit | 55ff5da70b6598218b032725f73de7c4f94a7c89 (patch) | |
tree | 75ba4ac4d098667be1ab951e2355bd624579b75f /phpBB/includes/db | |
parent | 761e3dd36f3b42fdaac99ba76f8d214b47983c05 (diff) | |
download | forums-55ff5da70b6598218b032725f73de7c4f94a7c89.tar forums-55ff5da70b6598218b032725f73de7c4f94a7c89.tar.gz forums-55ff5da70b6598218b032725f73de7c4f94a7c89.tar.bz2 forums-55ff5da70b6598218b032725f73de7c4f94a7c89.tar.xz forums-55ff5da70b6598218b032725f73de7c4f94a7c89.zip |
[ticket/10003] Ported 5553cfc2ed81ba9eb571804c431def962720b39e to db_tools.
The diff in database_update was only partially relevant.
PHPBB3-10003
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/db_tools.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index f72498af9b..01061c77b1 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -1289,13 +1289,12 @@ class phpbb_db_tools FROM user_indexes WHERE table_name = '" . strtoupper($table_name) . "' AND generated = 'N' - AND uniqueness = 'UNIQUE' - AND index_name LIKE 'U_%'"; + AND uniqueness = 'UNIQUE'"; $col = 'index_name'; break; case 'sqlite': - $sql = "PRAGMA index_list('" . $table_name . "') WHERE unique = 1;"; + $sql = "PRAGMA index_list('" . $table_name . "');"; $col = 'name'; break; } @@ -1322,7 +1321,15 @@ class phpbb_db_tools switch ($this->sql_layer) { case 'oracle': - $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1); + // Two cases here... prefixed with U_[table_owner] and not prefixed with table_name + if (strpos($row[$col], 'U_') === 0) + { + $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1); + } + else if (strpos($row[$col], strtoupper($table_name)) === 0) + { + $row[$col] = substr($row[$col], strlen($table_name) + 1); + } break; case 'firebird': @@ -2203,6 +2210,7 @@ class phpbb_db_tools } else { + // TODO: try to change pkey without removing trigger, generator or constraints. ATM this query may fail. $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type']; } break; |