Index: trunk/extensions/Wikidata/WiktionaryZ/Expression.php |
— | — | @@ -533,7 +533,7 @@ |
534 | 534 | |
535 | 535 | function createDefinedMeaningTextAttributeValue($definedMeaningId, $attributeId, $translatedContentId) { |
536 | 536 | $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) " . |
538 | 538 | "VALUES ($definedMeaningId, $attributeId, $translatedContentId, ". getUpdateTransactionId() .")"); |
539 | 539 | } |
540 | 540 | |
— | — | @@ -548,7 +548,7 @@ |
549 | 549 | removeTranslatedTexts($textId); |
550 | 550 | |
551 | 551 | $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() . |
553 | 553 | " WHERE value_tcid=$textId" . |
554 | 554 | " AND remove_transaction_id IS NULL"); |
555 | 555 | } |
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZAttributes.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | |
115 | 115 | global |
116 | 116 | $definitionAttribute, $definedMeaningAttribute; |
117 | | - |
| 117 | + |
118 | 118 | $definitionAttribute = new Attribute("definition", "Definition", new RecordSetType($translatedTextStructure)); |
119 | 119 | $definedMeaningAttribute = new Attribute("defined-meaning", "Defined meaning", new RecordType(new Structure($definitionAttribute, $alternativeDefinitionsAttribute, $synonymsAndTranslationsAttribute, $relationsAttribute, $classMembershipAttribute, $collectionMembershipAttribute, $textAttributeValuesAttribute))); |
120 | 120 | |
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZRecordSets.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | $syntransTable = new Table('uw_syntrans', true); |
28 | 28 | $translatedContentTable = new Table('translated_content', true); |
29 | 29 | $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); |
31 | 31 | |
32 | 32 | interface QueryTransactionInformation { |
33 | 33 | public function getRestriction($tableName); |
— | — | @@ -521,7 +521,7 @@ |
522 | 522 | 'value_tcid' => $textValueIdAttribute |
523 | 523 | ), |
524 | 524 | $textAttributeValuesTable, |
525 | | - array("defined_meaning_id=$definedMeaningId") |
| 525 | + array("object_id=$definedMeaningId") |
526 | 526 | ); |
527 | 527 | |
528 | 528 | $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 |