https://bugzilla.wikimedia.org/show_bug.cgi?id=28488

--- Comment #3 from Krinkle <krinklem...@gmail.com> 2011-04-12 22:06:44 UTC ---
Fyi:

This request (alteast the way I intended it) does not suggest to deprecate any
tables (including categorylinks) at all.
A central, effecient, clean categorylinks table is perfet (aggregated to only
contain the current status, which it does now).


However, if you would want to go that route (I didn't mean to suggest that, but
it's an interesting thought nonetheless), it doesn't have to be a problem:


-- example start --

Article [[Page]] was categorized in Lorem and Foo. In Foo it is sorted under
"Mysort".

mw_revision:
* example row of an edit that changed categories
rev_id: 123
rev_text_id: 120
rev_comment: "Re-categorized [removed: [[Category:Foo|Foo]]; added:
[[Category:Bar|Bar]] ]"
// comment is like the nulledits for changing protection settings
rev_props_id: 8

mw_magicpropsthingtable:
prop_id: 7 |  prop_type: categorylink | prop_val: 'Lorem'
prop_id: 7 |  prop_type: categorylink | prop_val: 'Foo'
prop_id: 8 |  prop_type: categorylink | prop_val: 'Lorem'
prop_id: 8 |  prop_type: categorylink | prop_val: 'Bar'


-- example end --

While writing this I just realized the sortykey would have to be stored as
well, and also that this value doesn't have to be indexed, only retrieved when
needed. So it may be better to use a single row [1] and serialize it into a
blob:

mw_magicpropsthingtable:
prop_id: 7 |  prop_blob: serialize(array(
 'categorylinks' => array(
   array( 'Lorem', 'Mysort' ),
   array( 'Bar', ''),
 ))
prop_id: 8 |  prop_blob: serialize(array(
 'categorylinks' => array(
   array( 'Foo', '' ),
   array( 'Lorem', 'Mysort'),
 ))


The prop_blob would a multi-line text (like log_params) or serialized php (like
old_flags, as example above).


--
Krinkle

[1]: This would also solve the problem with getting an id for prop_id, it can
be an auto-increment now.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to