Update post_date for old drafts during upgrade. see #5698

git-svn-id: https://develop.svn.wordpress.org/trunk@8921 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-09-17 21:47:27 +00:00
parent 160f106ca8
commit 8d3218c90a
2 changed files with 10 additions and 2 deletions

View File

@ -210,7 +210,7 @@ function upgrade_all() {
if ( $wp_current_db_version < 8201 )
upgrade_260();
if ( $wp_current_db_version < 8539 )
if ( $wp_current_db_version < 8921 )
upgrade_270();
maybe_disable_automattic_widgets();
@ -752,6 +752,8 @@ function upgrade_252() {
}
function upgrade_260() {
global $wp_current_db_version;
if ( $wp_current_db_version < 8000 )
populate_roles_260();
@ -762,8 +764,14 @@ function upgrade_260() {
}
function upgrade_270() {
global $wpdb, $wp_current_db_version;
if ( $wp_current_db_version < 8530 )
populate_roles_270();
// Update post_date for unpublished posts with empty timestamp
if ( $wp_current_db_version < 8921 )
$wpdb->query( "UPDATE $wpdb->posts SET post_date = post_modified WHERE post_date = '0000-00-00 00:00:00'" );
}

View File

@ -15,6 +15,6 @@ $wp_version = '2.7-hemorrhage';
*
* @global int $wp_db_version
*/
$wp_db_version = 8890;
$wp_db_version = 8921;
?>