r25991 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25990‎ | r25991 | r25992 >
Date:14:19, 21 September 2007
Author:proes
Status:old
Tags:
Comment:
Replaced Create transactions indices.sql by PHP code.
Modified paths:
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/Create+transactions+indices.sql (deleted) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/Create+uw_transactions+indices.sql (deleted) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/Recreate+indexes+for+all+tables+for+website.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataTables.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/Database scripts/Convenience/Create transactions indices.sql
@@ -1,2 +0,0 @@
2 -ALTER TABLE `transactions`
3 - ADD INDEX `user` (`user_id`, `transaction_id`);
Index: trunk/extensions/Wikidata/Database scripts/Convenience/Create uw_transactions indices.sql
@@ -1,2 +0,0 @@
2 -ALTER TABLE `%dc%_transactions`
3 - ADD INDEX `user` (`user_id`, `transaction_id`);
Index: trunk/extensions/Wikidata/Database scripts/Convenience/Recreate indexes for all tables for website.php
@@ -95,7 +95,6 @@
9696 $dc = "uw";
9797
9898 $tables = array(
99 - "transactions",
10099 "translated_content",
101100 "alt_meaningtexts",
102101 "class_attributes",
@@ -119,6 +118,7 @@
120119 $dataSet = new WikiDataSet($prefix);
121120 recreateIndexesForTableNew($dataSet->bootstrappedDefinedMeanings, $purpose);
122121 recreateIndexesForTableNew($dataSet->expression, $purpose);
 122+ recreateIndexesForTableNew($dataSet->transactions, $purpose);
123123
124124 recreateIndexesForTables($prefix, $tables);
125125 }
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataTables.php
@@ -221,7 +221,11 @@
222222 $this->timestamp = $this->createColumn("timestamp");
223223 $this->comment = $this->createColumn("comment");
224224
225 - $this->setKeyColumns(array($this->transactionId));
 225+ $this->setKeyColumns(array($this->transactionId));
 226+
 227+ $this->setWebSiteIndexes(array(
 228+ new TableIndex("user", array($this->userId, $this->transactionId))
 229+ ));
226230 }
227231 }
228232
@@ -513,7 +517,7 @@
514518 $this->meaningRelations = new MeaningRelationsTable("{$dataSetPrefix}_meaning_relations");
515519 $this->syntrans = new SyntransTable("{$dataSetPrefix}_syntrans");
516520 $this->textAttributeValues = new TextAttributeValuesTable("{$dataSetPrefix}_text_attribute_values");
517 - $this->transactions = new Table("{$dataSetPrefix}_transactions", false, array("transaction_id"));
 521+ $this->transactions = new TransactionsTable("{$dataSetPrefix}_transactions", false, array("transaction_id"));
518522 $this->translatedContentAttributeValues = new TranslatedContentAttributeValuesTable("{$dataSetPrefix}_translated_content_attribute_values");
519523 $this->translatedContent = new TranslatedContentTable("{$dataSetPrefix}_translated_content");
520524 $this->optionAttributeOptions = new OptionAttributeOptionsTable("{$dataSetPrefix}_option_attribute_options");

Status & tagging log