From 5c339ed9285451948f3a3952518dcd054bb07c75 Mon Sep 17 00:00:00 2001 From: Jure Kajzer Date: Wed, 30 Sep 2009 13:38:07 +0000 Subject: [PATCH] logging table added columns, fixed cat_id sequence generation in Article and Category --- includes/Article.php | 3 ++- includes/Category.php | 4 +++- maintenance/ora/tables.sql | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 8287682a8c..da033f2f11 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -4072,7 +4072,8 @@ class Article { } $insertRows = array(); foreach( $insertCats as $cat ) { - $insertRows[] = array( 'cat_title' => $cat ); + $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_val' ), + 'cat_title' => $cat ); } $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' ); diff --git a/includes/Category.php b/includes/Category.php index 611d087e33..b63685e16c 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -246,9 +246,11 @@ 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_cat_id_val' ); $dbw->insert( 'category', - array( 'cat_title' => $this->mName ), + array( 'cat_id' => $seqVal, + 'cat_title' => $this->mName ), __METHOD__, 'IGNORE' ); diff --git a/maintenance/ora/tables.sql b/maintenance/ora/tables.sql index 66fc60afd7..20ae33a8ea 100644 --- a/maintenance/ora/tables.sql +++ b/maintenance/ora/tables.sql @@ -416,8 +416,10 @@ CREATE TABLE &mw_prefix.logging ( log_action VARCHAR2(10) NOT NULL, log_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL, log_user NUMBER REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL, + log_user_text VARCHAR2(255), log_namespace NUMBER NOT NULL, log_title VARCHAR2(255) NOT NULL, + log_page NUMBER, log_comment VARCHAR2(255), log_params CLOB, log_deleted NUMBER DEFAULT '0' NOT NULL -- 2.20.1