Entry table, with Name and UniqueID (PK)
Property Table, with PropertyName and ID (PK)
EntryProperty Table with EntryID (FK), PropertyID (FK), UniqueID (PK), Value.
ck
2009-03-23 09:29:51
Entry table, with Name and UniqueID (PK)
Property Table, with PropertyName and ID (PK)
EntryProperty Table with EntryID (FK), PropertyID (FK), UniqueID (PK), Value.
Well, the problem for me is figuring out how to handle entries having multiple duplicate properties. Do I create a new table for each entry or what?
Well, no :-)
Assuming you have an Entry and Property table, my guess is that you would need a table with the following columns:
id, entry_id, property_id, property_value, timestamp
Does that help or did I get it all wrong?
CREATE TABLE entries (
INTEGER id NOT NULL AUTOINCREMENT,
VARCHAR(XX) name,
PRIMARY KEY(id)
)
CREATE TABLE properties (
INTEGER id NOT NULL AUTOINCREMENT,
VARCHAR(XX) name,
VARCHAR(XX) value,
INTEGER entryid NOT NULL,
FOREIGN KEY(entryid) REFERENCES entries (id)
)