MediaWiki  REL1_24
PostgresUpdater Class Reference

Class for handling updates to Postgres databases. More...

Inheritance diagram for PostgresUpdater:
Collaboration diagram for PostgresUpdater:

List of all members.

Public Member Functions

 addPgExtIndex ($table, $index, $type)
 addPgIndex ($table, $index, $type)
 describeIndex ($idx)
 fkeyDeltype ($fkey)
 ruleDef ($table, $rule)

Protected Member Functions

 addInterwikiType ()
 addPgField ($table, $field, $type)
 addSequence ($table, $pkey, $ns)
 changeField ($table, $field, $newtype, $default)
 changeFieldPurgeTable ($table, $field, $newtype, $default)
 changeFkeyDeferrable ($table, $field, $clause)
 changeNullableField ($table, $field, $null)
 checkIndex ($index, $should_be, $good_def)
 checkIwlPrefix ()
 checkOiDeleted ()
 checkOiNameConstraint ()
 checkPageDeletedTrigger ()
 checkRevUserFkey ()
 convertArchive2 ()
 describeTable ($table)
 dropIndex ($table, $index, $patch= '', $fullpath=false)
 Drop an index from an existing table.
 getCoreUpdateList ()
 getOldGlobalUpdates ()
 Before 1.17, we used to handle updates via stuff like $wgExtNewTables/Fields/Indexes.
 renameIndex ($table, $old, $new, $skipBothIndexExistWarning=false, $a=false, $b=false)
 Rename an index from an existing table.
 renameSequence ($old, $new)
 renameTable ($old, $new, $patch=false)
 setDefault ($table, $field, $default)
 tsearchFixes ()

Protected Attributes

DatabasePostgres $db
 Handle to the database subclass.

Detailed Description

Class for handling updates to Postgres databases.

Since:
1.17

Definition at line 30 of file PostgresUpdater.php.


Member Function Documentation

Definition at line 911 of file PostgresUpdater.php.

References DatabaseUpdater\applyPatch().

PostgresUpdater::addPgExtIndex ( table,
index,
type 
)
PostgresUpdater::addPgField ( table,
field,
type 
) [protected]

Definition at line 649 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::addPgIndex ( table,
index,
type 
)

Definition at line 749 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::addSequence ( table,
pkey,
ns 
) [protected]

Definition at line 581 of file PostgresUpdater.php.

References DatabaseUpdater\output(), and setDefault().

PostgresUpdater::changeField ( table,
field,
newtype,
default 
) [protected]

Definition at line 661 of file PostgresUpdater.php.

References $res, array(), and DatabaseUpdater\output().

PostgresUpdater::changeFieldPurgeTable ( table,
field,
newtype,
default 
) [protected]

Definition at line 686 of file PostgresUpdater.php.

References $res, array(), and DatabaseUpdater\output().

PostgresUpdater::changeFkeyDeferrable ( table,
field,
clause 
) [protected]

Definition at line 771 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::changeNullableField ( table,
field,
null 
) [protected]

Definition at line 724 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::checkIndex ( index,
should_be,
good_def 
) [protected]

Definition at line 871 of file PostgresUpdater.php.

References array(), empty, and DatabaseUpdater\output().

Definition at line 901 of file PostgresUpdater.php.

References DatabaseUpdater\applyPatch().

Definition at line 819 of file PostgresUpdater.php.

References DatabaseUpdater\output().

Definition at line 831 of file PostgresUpdater.php.

References DatabaseUpdater\output().

Definition at line 487 of file PostgresUpdater.php.

References $query, $res, array(), and as.

PostgresUpdater::describeTable ( table) [protected]

Definition at line 462 of file PostgresUpdater.php.

References $res, array(), and as.

PostgresUpdater::dropIndex ( table,
index,
patch = '',
fullpath = false 
) [protected]

Drop an index from an existing table.

Parameters:
string$tableName of the table to modify
string$indexName of the index
string$patchPath to the patch file
bool$fullpathWhether to treat $patch path as a relative or not
Returns:
bool False if this was skipped because schema changes are skipped

Reimplemented from DatabaseUpdater.

Definition at line 864 of file PostgresUpdater.php.

References DatabaseUpdater\output().

Definition at line 536 of file PostgresUpdater.php.

Referenced by checkRevUserFkey().

Todo:
FIXME: Postgres should use sequential updates like Mysql, Sqlite and everybody else.

It never got refactored like it should've.

Returns:
array

Reimplemented from DatabaseUpdater.

Definition at line 41 of file PostgresUpdater.php.

Before 1.17, we used to handle updates via stuff like $wgExtNewTables/Fields/Indexes.

This is nasty :) We refactored a lot of this in 1.17 but we want to remain back-compatible for a while. So load up these old global-based things into our update list.

Returns:
array

Reimplemented from DatabaseUpdater.

Definition at line 423 of file PostgresUpdater.php.

References DatabaseUpdater\$updates, array(), as, and global.

PostgresUpdater::renameIndex ( table,
oldIndex,
newIndex,
skipBothIndexExistWarning = false,
patch = false,
fullpath = false 
) [protected]

Rename an index from an existing table.

Parameters:
string$tableName of the table to modify
string$oldIndexOld name of the index
string$newIndexNew name of the index
bool$skipBothIndexExistWarningWhether to warn if both the old and the new indexes exist.
string$patchPath to the patch file
bool$fullpathWhether to treat $patch path as a relative or not
Returns:
bool False if this was skipped because schema changes are skipped

Reimplemented from DatabaseUpdater.

Definition at line 615 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::renameSequence ( old,
new 
) [protected]

Definition at line 591 of file PostgresUpdater.php.

References DatabaseUpdater\output().

PostgresUpdater::renameTable ( old,
new,
patch = false 
) [protected]

Definition at line 603 of file PostgresUpdater.php.

References DatabaseUpdater\applyPatch(), and DatabaseUpdater\output().

PostgresUpdater::ruleDef ( table,
rule 
)

Definition at line 557 of file PostgresUpdater.php.

PostgresUpdater::setDefault ( table,
field,
default 
) [protected]

Definition at line 715 of file PostgresUpdater.php.

References DatabaseUpdater\output().

Referenced by addSequence().

Definition at line 915 of file PostgresUpdater.php.

References DatabaseUpdater\applyPatch().


Member Data Documentation

DatabasePostgres PostgresUpdater::$db [protected]

Handle to the database subclass.

Reimplemented from DatabaseUpdater.

Definition at line 34 of file PostgresUpdater.php.


The documentation for this class was generated from the following file: