Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / libs / rdbms / field / PostgresField.php
index 36337e2..c5819a3 100644 (file)
@@ -1,4 +1,9 @@
 <?php
+
+namespace Wikimedia\Rdbms;
+
+use DatabasePostgres;
+
 class PostgresField implements Field {
        private $name, $tablename, $type, $nullable, $max_length, $deferred, $deferrable, $conname,
                $has_default, $default;
@@ -9,7 +14,7 @@ class PostgresField implements Field {
         * @param string $field
         * @return null|PostgresField
         */
-       static function fromText( $db, $table, $field ) {
+       static function fromText( DatabasePostgres $db, $table, $field ) {
                $q = <<<SQL
 SELECT
  attnotnull, attlen, conname AS conname,
@@ -34,7 +39,7 @@ AND relname=%s
 AND attname=%s;
 SQL;
 
-               $table = $db->tableName( $table, 'raw' );
+               $table = $db->remappedTableName( $table );
                $res = $db->query(
                        sprintf( $q,
                                $db->addQuotes( $db->getCoreSchema() ),