I am refactoring the social data table in to two tables.
had a small offline discussion with Srinath yesterday, it was suggested
that it's better to have individual columns for (mosey) common vales and
leave them NULL when not using.
following is an example.

Activity Table

+-------------+---------+---------------------------------+-----------------------+
| id          | tenant  | context_id (parent id)[indexed] |
body          |
+-------------+---------+---------------------------------+-----------------------+
| 1aa2-33c3b1 | xyz.com | 5ac2-5c7gf1                     |
{"actor":"manu", ...} |
+-------------+---------+---------------------------------+-----------------------+

Social Object Table

+-------------+---------+---------------------------------+--------------+--------------+----------+------------+-----------------------+
|     id      | tenant  | context_id (parent id)[indexed] | rating_value |
rating_count | up_votes | down_votes |         body          |
+-------------+---------+---------------------------------+--------------+--------------+----------+------------+-----------------------+
| 1aa2-33c3b1 | xyz.com | 1aa2-33c3b1                     | 5            |
10           | NULL     | NULL       | {"actor":"manu", ...} |
| 9f86-df18e2 | xyz.com | 1aa2-33c3b1                     | NULL         |
NULL         | 2        | 3          | {"actor":"doe", ...}  |
+-------------+---------+---------------------------------+--------------+--------------+----------+------------+-----------------------+

-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to