So I don’t know if this is acceptable or not.
I have the following tables: Document and Content Reviewers
Content_Reviewers has fields: cr_id, fk_ProductID. fk_DocumentID, Name, ContactInfo
1, 1, 3, 'Derek', '555-555-5555 Lives in Washington'
2 3, 35, 'James', 'California'
Document has fields: doc_id, fk_productID, sectionName, parentID, text
1, 1, 'Title', 0, ''
2, 1, 'Contributors', 0 'People who helped in some fashion'
3, 1, 'Editors', 2, 'People who helped edit the document'
...
35, 4, 'Editors', 33, 'People who helped edit the document'
So what i am trying to accomplish is that i can have many products, some or all products could have Editiors or the Contributors section. If they do i want to be able to link the ‘Content_Reviewers’ table with that section.
So my first inclinations are to:
- Setup a new Sections table to avoid duplication of
'SectionName'and'Text' - Add a new column such as
TableDatatoDocumentthat would contain the name of table associated to it?Content_Reviewers? (this is what i am not sure on how to do well)
The idea is that there could be at least a dozen sections with their own individual tables associated with that section but not necessary always available in a product.
Thanks.
This is a many to many cardinality. Should create a linking table
example:
Document Table, has id
Product Table, has id
create a document_product Table
fk_Document.id
fk_Product.id
and make a combination unique key by both fk_Document.id and fk_Product.id to make sure no duplicate.