Merge "Avoid using cascadingDeletes()/cleanupTriggers()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 19 Sep 2016 19:31:44 +0000 (19:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 19 Sep 2016 19:31:44 +0000 (19:31 +0000)
1  2 
includes/changes/RecentChange.php

@@@ -297,8 -297,7 +297,8 @@@ class RecentChange 
                }
  
                # If our database is strict about IP addresses, use NULL instead of an empty string
 -              if ( $dbw->strictIPs() && $this->mAttribs['rc_ip'] == '' ) {
 +              $strictIPs = in_array( $dbw->getType(), [ 'oracle', 'postgres' ] ); // legacy
 +              if ( $strictIPs && $this->mAttribs['rc_ip'] == '' ) {
                        unset( $this->mAttribs['rc_ip'] );
                }
  
                $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' );
  
                # # If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
-               if ( $dbw->cascadingDeletes() && $this->mAttribs['rc_cur_id'] == 0 ) {
+               if ( $this->mAttribs['rc_cur_id'] == 0 ) {
                        unset( $this->mAttribs['rc_cur_id'] );
                }