I hope to build a Codeigniter library similar to the Drupal CCK, albeit in an extremely simplified version. I am wondering which database structure will work best to achieve my ultimate goal, which can best be described by the following use case:
Interface:
Existing content types:
- Page [edit type] [list of all] [add new page]
- Rating [change type] [list of all] [add new rating]
- DVD Movie [edit type] [list of all] [add new DVD movie]
[create new content type]
The web developer clicks [create a new content type]:
Form: New Content Type
Enter a name: [ _ Observer Comment ____________ ]
Add field:
- : [ _Name __________]
- : [ (< 128 )] ( )
- : [ x]
- [ ]
[ ]
- :
:
: [ _ ____________]
:
- | (< 128 ) |
- | (< 128 ) |
- | (< 1024 ) |
- ForPage | |
:
- : [ _____________]
- : [- -]
- : []
- [ ]
[ ]
- , ... , ?
1: ( phpmyadmin) - ? ?
2: , :
table ContentType (e.g. "Book")
table CustomField (e.g. "Author Name")
table DBRecord (e.g. "Lord Of The Rings vol.1")
table ValueText128 (e.g. "J.R.R. Tolkien")
table ValueSmallInt (e.g. "1954")
...and so on, with a table for each of the datatypes
, , , , , - char (128) ..
- ? CCK? ?