X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabasePostgres.php;h=807d9cc240a421584b7c9e05fda72d576244df05;hb=765370a6db20c95907abd9ed1b6d4a285638acb3;hp=525d308e9aa4bac61e18ede550bd9a4c74bd7c5d;hpb=48a6894abbb26e5e93437bf30cf0fee54db052a4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 525d308e9a..807d9cc240 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -789,7 +789,9 @@ __INDEXATTR__; $newNameE = $this->addIdentifierQuotes( $newName ); $oldNameE = $this->addIdentifierQuotes( $oldName ); - $ret = $this->query( 'CREATE ' . ( $temporary ? 'TEMPORARY ' : '' ) . " TABLE $newNameE " . + $temporary = $temporary ? 'TEMPORARY' : ''; + + $ret = $this->query( "CREATE $temporary TABLE $newNameE " . "(LIKE $oldNameE INCLUDING DEFAULTS INCLUDING INDEXES)", $fname ); if ( !$ret ) { return $ret; @@ -812,7 +814,7 @@ __INDEXATTR__; $fieldE = $this->addIdentifierQuotes( $field ); $newSeqE = $this->addIdentifierQuotes( $newSeq ); $newSeqQ = $this->addQuotes( $newSeq ); - $this->query( 'CREATE ' . ( $temporary ? 'TEMPORARY ' : '' ) . " SEQUENCE $newSeqE", $fname ); + $this->query( "CREATE $temporary SEQUENCE $newSeqE OWNED BY $newNameE.$fieldE", $fname ); $this->query( "ALTER TABLE $newNameE ALTER COLUMN $fieldE SET DEFAULT nextval({$newSeqQ}::regclass)", $fname @@ -1442,4 +1444,7 @@ SQL; } } +/** + * @deprecated since 1.29 + */ class_alias( DatabasePostgres::class, 'DatabasePostgres' );