Fix update-db for new installations so it doesn't require a property we 
haven't built yet.

        Patch by exor674. 

diffs (26 lines):

diff -r c9ab986c6c8d -r 63973df563bf bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl        Fri Jan 08 23:43:26 2010 +0000
+++ b/bin/upgrading/update-db-general.pl        Fri Jan 08 23:45:20 2010 +0000
@@ -3811,13 +3811,16 @@ EOF
 
     # convert xpost-footer-update from char to blobchar
     if ( table_relevant( 'userproplite2' ) ) {
-        my $upropid = LJ::get_prop( user => 'crosspost_footer_text' 
)->{upropid};
+        my $uprop = LJ::get_prop( user => 'crosspost_footer_text' );
+        if ( defined( $uprop ) ) {
+            my $upropid = $uprop->{upropid};
 
-        my $testresult = $dbh->selectrow_array( "SELECT upropid FROM 
userproplite2 WHERE upropid = $upropid LIMIT 1" );
-        if ( $testresult > 0 ) {
-            do_sql( "INSERT IGNORE INTO userpropblob (userid, upropid, value) 
" .
-                    "    SELECT userid, upropid, value FROM userproplite2 
WHERE upropid = $upropid" );
-            do_sql( "DELETE FROM userproplite2 WHERE upropid = $upropid" );
+            my $testresult = $dbh->selectrow_array( "SELECT upropid FROM 
userproplite2 WHERE upropid = $upropid LIMIT 1" );
+            if ( $testresult > 0 ) {
+                do_sql( "INSERT IGNORE INTO userpropblob (userid, upropid, 
value) " .
+                        "    SELECT userid, upropid, value FROM userproplite2 
WHERE upropid = $upropid" );
+                do_sql( "DELETE FROM userproplite2 WHERE upropid = $upropid" );
+            }
         }
     }
     if ( table_relevant( "userproplist" ) && ! 
check_dbnote("xpost_footer_update") ) {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to