*/
protected function canUseNewUpdatelog() {
return $this->db->tableExists( 'updatelog', __METHOD__ ) &&
- $this->db->fieldExists( 'updatelog', 'ul_value' );
+ $this->db->fieldExists( 'updatelog', 'ul_value', __METHOD__ );
}
/**
protected function addField( $table, $field, $patch, $fullpath = false ) {
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
$this->output( "...$table table does not exist, skipping new field patch\n" );
- } elseif ( $this->db->fieldExists( $table, $field ) ) {
+ } elseif ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
$this->output( "...have $field field in $table table.\n" );
} else {
$this->output( "Adding $field field to table $table..." );
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
*/
protected function addIndex( $table, $index, $patch, $fullpath = false ) {
- if ( $this->db->indexExists( $table, $index ) ) {
+ if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
$this->output( "...$index key already set on $table table.\n" );
} else {
$this->output( "Adding $index key to table $table... " );
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
*/
protected function dropField( $table, $field, $patch, $fullpath = false ) {
- if ( $this->db->fieldExists( $table, $field ) ) {
+ if ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
$this->output( "Table $table contains $field field. Dropping... " );
$this->applyPatch( $patch, $fullpath );
$this->output( "ok\n" );
* @param $fullpath Boolean: Whether to treat $patch path as a relative or not
*/
protected function dropIndex( $table, $index, $patch, $fullpath = false ) {
- if ( $this->db->indexExists( $table, $index ) ) {
+ if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
$this->output( "Dropping $index key from table $table... " );
$this->applyPatch( $patch, $fullpath );
$this->output( "ok\n" );
$updateKey = "$table-$field-$patch";
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
$this->output( "...$table table does not exist, skipping modify field patch\n" );
- } elseif ( !$this->db->fieldExists( $table, $field ) ) {
+ } elseif ( !$this->db->fieldExists( $table, $field, __METHOD__ ) ) {
$this->output( "...$field field does not exist in $table table, skipping modify field patch\n" );
} elseif( $this->updateRowExists( $updateKey ) ) {
$this->output( "...$field in table $table already modified by patch $patch\n" );
$this->output( "ok\n" );
if ( !$this->db->tableExists( 'user_rights', __METHOD__ ) ) {
- if ( $this->db->fieldExists( 'user', 'user_rights' ) ) {
+ if ( $this->db->fieldExists( 'user', 'user_rights', __METHOD__ ) ) {
$this->output( "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion..." );
$this->db->applyPatch( 'patch-user_rights.sql' );
$this->output( "ok\n" );
protected function doMaybeProfilingMemoryUpdate() {
if ( !$this->db->tableExists( 'profiling', __METHOD__ ) ) {
// Simply ignore
- } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory' ) ) {
+ } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory', __METHOD__ ) ) {
$this->output( "...profiling table has pf_memory field.\n" );
} else {
$this->output( "Adding pf_memory field to table profiling..." );
}
protected function renameEuWikiId() {
- if ( $this->db->fieldExists( 'external_user', 'eu_local_id' ) ) {
+ if ( $this->db->fieldExists( 'external_user', 'eu_local_id', __METHOD__ ) ) {
$this->output( "...eu_wiki_id already renamed to eu_local_id.\n" );
return;
}
function start() {
parent::start();
- if ( ! $this->db->tableExists( 'testrun' )
- or ! $this->db->tableExists( 'testitem' ) )
+ if ( ! $this->db->tableExists( 'testrun', __METHOD__ )
+ || ! $this->db->tableExists( 'testitem', __METHOD__ ) )
{
print "WARNING> `testrun` table not found in database.\n";
$this->prevRun = false;
$this->db->begin();
if ( ! $this->db->tableExists( 'testrun' )
- or ! $this->db->tableExists( 'testitem' ) )
+ || ! $this->db->tableExists( 'testitem' ) )
{
print "WARNING> `testrun` table not found in database. Trying to create table.\n";
$this->db->sourceFile( $this->db->patchPath( 'patch-testrun.sql' ) );