Updated all nextSequenceValue calls with new sequence names.
OverlordQ stated he'll handle changes to Postgres scripts.
Need someone to change DB2 scripts.
}
$insertRows = array();
foreach( $insertCats as $cat ) {
- $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_id_seq' ),
+ $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_seq' ),
'cat_title' => $cat );
}
$dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' );
# Don't collide with expired blocks
Block::purgeExpired();
- $ipb_id = $dbw->nextSequenceValue('ipblocks_ipb_id_val');
+ $ipb_id = $dbw->nextSequenceValue('ipblocks_ipb_id_seq');
$dbw->insert( 'ipblocks',
array(
'ipb_id' => $ipb_id,
} else {
# Let's be sure that the row exists in the table. We don't need to
# do this if we got the row from the table in initialization!
- $seqVal = $dbw->nextSequenceValue( 'category_id_seq' );
+ $seqVal = $dbw->nextSequenceValue( 'category_cat_id_seq' );
$dbw->insert(
'category',
array( 'cat_id' => $seqVal,
$this->timestamp . "\n" );
return false;
}
- $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' );
+ $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
$data = array(
'log_id' => $log_id,
'log_type' => $this->type,
global $wgLogRestrictions;
$dbw = wfGetDB( DB_MASTER );
- $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' );
+ $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
$this->timestamp = $now = wfTimestampNow();
$data = array(
# Fixup database timestamps
$this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']);
$this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);
- $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'rc_rc_id_seq' );
+ $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() and $this->mAttribs['rc_cur_id']==0 ) {
# Record the text (or external storage URL) to the text table
if( !isset( $this->mTextId ) ) {
- $old_id = $dbw->nextSequenceValue( 'text_old_id_val' );
+ $old_id = $dbw->nextSequenceValue( 'text_old_id_seq' );
$dbw->insert( 'text',
array(
'old_id' => $old_id,
# Record the edit in revisions
$rev_id = isset( $this->mId )
? $this->mId
- : $dbw->nextSequenceValue( 'rev_rev_id_val' );
+ : $dbw->nextSequenceValue( 'revision_rev_id_seq' );
$dbw->insert( 'revision',
array(
'rev_id' => $rev_id,
} else {
$srcTable = $this->tableName( $srcTable );
}
+
+ // count-alias subselect fields to avoid abigious definition errors
+ $i=0;
+ foreach($varMap as $key=>&$val)
+ $val=$val.' field'.($i++);
+
$sql = "INSERT INTO $destTable (" . implode( ',', array_keys( $varMap ) ) . ')' .
" SELECT $startOpts " . implode( ',', $varMap ) .
" FROM $srcTable $useIndex ";
--- /dev/null
+-- script for renameing sequence names to conform with <table>_<field>_seq format
+RENAME rev_rev_id_val TO revision_rev_id_seq;
+RENAME text_old_id_val TO text_old_id_seq;
+RENAME category_id_seq TO category_cat_id_seq;
+RENAME ipblocks_ipb_id_val TO ipblocks_ipb_id_seq;
+RENAME rc_rc_id_seq TO recentchanges_rc_id_seq;
+RENAME log_log_id_seq TO logging_log_id_seq;
+RENAME pr_id_val TO page_restrictions_pr_id_seq;
\ No newline at end of file
END;
/*$mw$*/
-CREATE SEQUENCE rev_rev_id_val;
+CREATE SEQUENCE revision_rev_id_seq;
CREATE TABLE &mw_prefix.revision (
rev_id NUMBER NOT NULL,
rev_page NUMBER NULL REFERENCES &mw_prefix.page (page_id) ON DELETE CASCADE,
CREATE INDEX &mw_prefix.revision_i03 ON &mw_prefix.revision (rev_user,rev_timestamp);
CREATE INDEX &mw_prefix.revision_i04 ON &mw_prefix.revision (rev_user_text,rev_timestamp);
-CREATE SEQUENCE text_old_id_val;
+CREATE SEQUENCE text_old_id_seq;
CREATE TABLE &mw_prefix.pagecontent ( -- replaces reserved word 'text'
old_id NUMBER NOT NULL,
old_text CLOB,
CREATE INDEX &mw_prefix.categorylinks_i01 ON &mw_prefix.categorylinks (cl_to,cl_sortkey,cl_from);
CREATE INDEX &mw_prefix.categorylinks_i02 ON &mw_prefix.categorylinks (cl_to,cl_timestamp);
-CREATE SEQUENCE category_id_seq;
+CREATE SEQUENCE category_cat_id_seq;
CREATE TABLE &mw_prefix.category (
cat_id NUMBER NOT NULL,
cat_title VARCHAR2(255) NOT NULL,
hc_id NUMBER NOT NULL
);
-CREATE SEQUENCE ipblocks_ipb_id_val;
+CREATE SEQUENCE ipblocks_ipb_id_seq;
CREATE TABLE &mw_prefix.ipblocks (
ipb_id NUMBER NOT NULL,
ipb_address VARCHAR2(255) NULL,
CREATE INDEX &mw_prefix.filearchive_i03 ON &mw_prefix.filearchive (fa_deleted_timestamp);
CREATE INDEX &mw_prefix.filearchive_i04 ON &mw_prefix.filearchive (fa_user_text,fa_timestamp);
-CREATE SEQUENCE rc_rc_id_seq;
+CREATE SEQUENCE recentchanges_rc_id_seq;
CREATE TABLE &mw_prefix.recentchanges (
rc_id NUMBER NOT NULL,
rc_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
CREATE UNIQUE INDEX &mw_prefix.transcache_u01 ON &mw_prefix.transcache (tc_url);
-CREATE SEQUENCE log_log_id_seq;
+CREATE SEQUENCE logging_log_id_seq;
CREATE TABLE &mw_prefix.logging (
log_id NUMBER NOT NULL,
log_type VARCHAR2(10) NOT NULL,
CREATE INDEX &mw_prefix.querycachetwo_i02 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespace,qcc_title);
CREATE INDEX &mw_prefix.querycachetwo_i03 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
-CREATE SEQUENCE pr_id_val;
+CREATE SEQUENCE page_restrictions_pr_id_seq;
CREATE TABLE &mw_prefix.page_restrictions (
pr_id NUMBER NOT NULL,
pr_page NUMBER NULL REFERENCES &mw_prefix.page (page_id) ON DELETE CASCADE,