update sequence handling to support bigserial and serial types

This commit is contained in:
Matthew Bucci
2024-01-16 21:35:32 -08:00
parent ade3d6ad87
commit 66d8a3df0e
5 changed files with 71 additions and 40 deletions

View File

@@ -53,7 +53,7 @@ function pg4wp_rewrite($sql)
// 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);';
$end .= ';SELECT setval(\'' . $wpdb->terms . '_term_id_seq\', (SELECT MAX(term_id) FROM ' . $wpdb->terms . ')+1);';
}
break;
case 'Insert':