Plugin Directory

Changeset 546556


Ignore:
Timestamp:
05/20/2012 12:30:56 PM (14 years ago)
Author:
hawk__
Message:

Added a hack so that wp_terms_seq is updated on installation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postgresql-for-wordpress/trunk/pg4wp/driver_pgsql.php

    r546507 r546556  
    329329            list($sql,$end) = explode( ' VALUES', $sql, 2);
    330330            $end = ' VALUES'.$end;
     331           
     332            // When installing, the sequence for table terms has to be updated
     333            if( defined('WP_INSTALLING') && WP_INSTALLING && false !== strpos($sql, 'INSERT INTO `'.$wpdb->terms.'`'))
     334                $end .= ';SELECT setval(\''.$wpdb->terms.'_seq\', (SELECT MAX(term_id) FROM '.$wpdb->terms.')+1);';
     335           
    331336        } // INSERT
    332337        elseif( 0 === strpos( $sql, 'DELETE' ))
Note: See TracChangeset for help on using the changeset viewer.