Changed sequence names to a standard <table>_<field>_seq form.
Updated all nextSequenceValue calls with new sequence names. OverlordQ stated he'll handle changes to Postgres scripts. Need someone to change DB2 scripts.
This commit is contained in:
parent
be1cd24b80
commit
785ad24aa7
10 changed files with 29 additions and 15 deletions
|
|
@ -4097,7 +4097,7 @@ class Article {
|
|||
}
|
||||
$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' );
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ class Block {
|
|||
# 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,
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class Category {
|
|||
} 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,
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class WikiRevision {
|
|||
$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,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class LogPage {
|
|||
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(
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class RecentChange
|
|||
# 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 ) {
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ class Revision {
|
|||
|
||||
# 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,
|
||||
|
|
@ -840,7 +840,7 @@ class Revision {
|
|||
# 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,
|
||||
|
|
|
|||
|
|
@ -512,6 +512,12 @@ class DatabaseOracle extends DatabaseBase {
|
|||
} 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 ";
|
||||
|
|
|
|||
8
maintenance/ora/patch_seq_names_pre1.16.sql
Normal file
8
maintenance/ora/patch_seq_names_pre1.16.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- 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;
|
||||
|
|
@ -79,7 +79,7 @@ BEGIN
|
|||
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,
|
||||
|
|
@ -100,7 +100,7 @@ CREATE INDEX &mw_prefix.revision_i02 ON &mw_prefix.revision (rev_page,rev_timest
|
|||
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,
|
||||
|
|
@ -163,7 +163,7 @@ CREATE UNIQUE INDEX &mw_prefix.categorylinks_u01 ON &mw_prefix.categorylinks (cl
|
|||
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,
|
||||
|
|
@ -210,7 +210,7 @@ CREATE TABLE &mw_prefix.hitcounter (
|
|||
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,
|
||||
|
|
@ -314,7 +314,7 @@ CREATE INDEX &mw_prefix.filearchive_i02 ON &mw_prefix.filearchive (fa_storage_gr
|
|||
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,
|
||||
|
|
@ -409,7 +409,7 @@ CREATE TABLE &mw_prefix.transcache (
|
|||
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,
|
||||
|
|
@ -488,7 +488,7 @@ CREATE INDEX &mw_prefix.querycachetwo_i01 ON &mw_prefix.querycachetwo (qcc_type,
|
|||
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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue