Commit c50f44d
committed
Add key attributes to the
`Key`, `ContentType`, and `ParentID` have historically been stored in `Attributes` as indexed attributes—but they've always been treated as exceptions. They've mostly been filtered out of `AttributeIndex`—or, more recently, at the `GetTopics` stored procedure level (ba4112d). There is a frequent need to extract them (and only them) from `Attributes` for the sake of joins. For reporting and maintenance, they've the most commonly queried fields. And, generally, not only are they not versioned, but it doesn't necessarily make sense to version them—for instance, versioning `ParentID` would cause problems since it would conflic with the actual nested set hierarchy. And, of course, there's no referential integrity for the `ParentID`.
Given this, I've migrated them to be columns on the `Topics` table. This makes them first class citizens that are much easier to query and join against, and also provides better data integrity since their requirement can be enforced—as can their referential integrity in terms of `ParentID`.
This just establishes the schema. Future commits will need to migrate the data, and then update the various SQL calls to reflect that change. Until those are entirely complete, this change will continue to exist in a limbo, with the data being maintained and pulled from both locations.Topics table1 parent 5ad799c commit c50f44d
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
0 commit comments