r16965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16964‎ | r16965 | r16966 >
Date:09:38, 12 October 2006
Author:karstenuil
Status:old
Tags:
Comment:
Database changes to make text attributes available for all objects.
Modified paths:
  • /trunk/extensions/Wikidata/Database+scripts/Incremental/18+-+Database+changes+to+use+text+attributes+on+objects.sql (added) (history)
  • /trunk/extensions/Wikidata/WiktionaryZ/Expression.php (modified) (history)
  • /trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZRecordSets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/WiktionaryZ/Expression.php
@@ -533,7 +533,7 @@
534534
535535 function createDefinedMeaningTextAttributeValue($definedMeaningId, $attributeId, $translatedContentId) {
536536 $dbr = &wfGetDB(DB_MASTER);
537 - $dbr->query("INSERT INTO uw_dm_text_attribute_values (defined_meaning_id, attribute_mid, value_tcid, add_transaction_id) " .
 537+ $dbr->query("INSERT INTO uw_text_attribute_values (object_id, attribute_mid, value_tcid, add_transaction_id) " .
538538 "VALUES ($definedMeaningId, $attributeId, $translatedContentId, ". getUpdateTransactionId() .")");
539539 }
540540
@@ -548,7 +548,7 @@
549549 removeTranslatedTexts($textId);
550550
551551 $dbr = &wfGetDB(DB_MASTER);
552 - $dbr->query("UPDATE uw_dm_text_attribute_values SET remove_transaction_id=". getUpdateTransactionId() .
 552+ $dbr->query("UPDATE uw_text_attribute_values SET remove_transaction_id=". getUpdateTransactionId() .
553553 " WHERE value_tcid=$textId" .
554554 " AND remove_transaction_id IS NULL");
555555 }
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZAttributes.php
@@ -113,7 +113,7 @@
114114
115115 global
116116 $definitionAttribute, $definedMeaningAttribute;
117 -
 117+
118118 $definitionAttribute = new Attribute("definition", "Definition", new RecordSetType($translatedTextStructure));
119119 $definedMeaningAttribute = new Attribute("defined-meaning", "Defined meaning", new RecordType(new Structure($definitionAttribute, $alternativeDefinitionsAttribute, $synonymsAndTranslationsAttribute, $relationsAttribute, $classMembershipAttribute, $collectionMembershipAttribute, $textAttributeValuesAttribute)));
120120
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZRecordSets.php
@@ -26,7 +26,7 @@
2727 $syntransTable = new Table('uw_syntrans', true);
2828 $translatedContentTable = new Table('translated_content', true);
2929 $alternativeDefinitionsTable = new Table('uw_alt_meaningtexts', true);
30 -$textAttributeValuesTable = new Table('uw_dm_text_attribute_values', true);
 30+$textAttributeValuesTable = new Table('uw_text_attribute_values', true);
3131
3232 interface QueryTransactionInformation {
3333 public function getRestriction($tableName);
@@ -521,7 +521,7 @@
522522 'value_tcid' => $textValueIdAttribute
523523 ),
524524 $textAttributeValuesTable,
525 - array("defined_meaning_id=$definedMeaningId")
 525+ array("object_id=$definedMeaningId")
526526 );
527527
528528 $recordSet->getStructure->attributes[] = $textValueAttribute;
Index: trunk/extensions/Wikidata/Database scripts/Incremental/18 - Database changes to use text attributes on objects.sql
@@ -0,0 +1,11 @@
 2+--
 3+--Text attributes can be of any object, instead of only defined meanings
 4+--
 5+
 6+ALTER TABLE `uw_dm_text_attribute_values`
 7+ CHANGE `defined_meaning_id` `object_id` INT( 11 ) NOT NULL;
 8+
 9+RENAME TABLE `uw_dm_text_attribute_values` TO `uw_text_attribute_values`;
 10+
 11+INSERT INTO `script_log` (`time`, `script_name`)
 12+ VALUES (NOW(), '18 - Database changes to use text attributes on objects.sql');
\ No newline at end of file

Status & tagging log