Update post_date for old drafts during upgrade. see #5698

git-svn-id: http://svn.automattic.com/wordpress/trunk@8921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-17 21:47:27 +00:00
parent 3cf0e131c8
commit f3987bee5f
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;
?>