mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-07-30 01:37:13 +02:00
Improved SHOW INDEX for upgrades to detect indices correctly and so don't try to recreate them
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@429283 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
@ -29,7 +29,7 @@
|
||||
|
||||
function pg4wp_installing( $sql, &$logto)
|
||||
{
|
||||
global $table_prefix;
|
||||
global $wpdb;
|
||||
|
||||
// SHOW INDEX emulation
|
||||
if( 0 === strpos( $sql, 'SHOW INDEX'))
|
||||
@ -40,7 +40,8 @@
|
||||
$table = $matches[1];
|
||||
$sql = 'SELECT bc.relname AS "Table",
|
||||
CASE WHEN i.indisunique THEN \'0\' ELSE \'1\' END AS "Non_unique",
|
||||
CASE WHEN i.indisprimary THEN \'PRIMARY\' WHEN bc.relname LIKE \'%usermeta\' AND ic.relname = \'umeta_key\' THEN \'meta_key\' ELSE ic.relname END AS "Key_name",
|
||||
CASE WHEN i.indisprimary THEN \'PRIMARY\' WHEN bc.relname LIKE \'%usermeta\' AND ic.relname = \'umeta_key\'
|
||||
THEN \'meta_key\' ELSE REPLACE( ic.relname, \''.$table.'_\', \'\') END AS "Key_name",
|
||||
a.attname AS "Column_name",
|
||||
NULL AS "Sub_part"
|
||||
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a
|
||||
|
Reference in New Issue
Block a user