【发布时间】:2011-03-29 17:25:07
【问题描述】:
我有一个 CMS 系统,可以像这样跨表存储数据:
Entries Table
+----+-------+------+--------+--------+
| id | title | text | index1 | index2 |
+----+-------+------+--------+--------+
Entries META Table
+----+----------+-------+-------+
| id | entry_id | value | param |
+----+----------+-------+-------+
Files Table
+----+----------+----------+
| id | entry_id | filename |
+----+----------+----------+
Entries-to-Tags Table
+----+----------+--------+
| id | entry_id | tag_id |
+----+----------+--------+
Tags Table
+----+-----+
| id | tag |
+----+-----+
我正在尝试实施一个修订系统,有点像 SO。如果我只是为Entries Table 做这件事,我打算只在一个单独的表中保留对该表的所有更改的副本。因为我必须为至少 4 个表执行此操作(TAGS 表不需要修改),所以这似乎根本不是一个优雅的解决方案。
你们会怎么做呢?
请注意,元表是在EAV (entity-attribute-value)中建模的。
提前谢谢你。
【问题讨论】:
标签: mysql database version-control revision entity-attribute-value