mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-07-30 17:57:13 +02:00
Added a hack so that wp_terms_seq is updated on installation
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546556 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
@ -328,6 +328,11 @@
|
||||
// This will avoid modifications to anything following ' VALUES'
|
||||
list($sql,$end) = explode( ' VALUES', $sql, 2);
|
||||
$end = ' VALUES'.$end;
|
||||
|
||||
// When installing, the sequence for table terms has to be updated
|
||||
if( defined('WP_INSTALLING') && WP_INSTALLING && false !== strpos($sql, 'INSERT INTO `'.$wpdb->terms.'`'))
|
||||
$end .= ';SELECT setval(\''.$wpdb->terms.'_seq\', (SELECT MAX(term_id) FROM '.$wpdb->terms.')+1);';
|
||||
|
||||
} // INSERT
|
||||
elseif( 0 === strpos( $sql, 'DELETE' ))
|
||||
{
|
||||
|
Reference in New Issue
Block a user