Yes its correct one to many relationship. However you have inconsistency in your column namig, once you do snake case, once camel case, once id is uppercased, once lowercased.
Aug 23, 2018
5
Level 1
Help with Has Many Relationships Database Table
I have 2 Tables proposals & Proposal Attachments. each proposal has a docx file & Pdf File. let me know the below table design is correct
proposals
----------------------------------------------------
| id | proposalNo | ProposalTitle | Status |
----------------------------------------------------
| 1 | PRO 123 | sample | 0 |
----------------------------------------------------
proposal_attachments
---------------------------------------------------------------------------------------
| id | proposal_id | version_ID | Status | fileName | filetype |
--------------------------------------------------------------------------------------
| 1 | 1 | 1 | 1 | Sample1.docx | doctype |
---------- -------------------------------------------------------------------------
| 2 | 1 | 1 | 1 | Sample1.pdf | pdf |
----------------------------------------------------------------------------------------
| 3 | 1 | 2 | 1 | Sample1.docx | doctype |
----------------------------------------------------------------------------------------
| 4 | 1 | 2 | 1 | Sample1.pdf | pdf |
--------------------------------------------------------------------------------------
is this the correct design of Table or Not?
Level 1
@Yorki Let me know it the proper way of saving doc and pdf of the same version?
or
| id | proposal_id | version_ID | Status | filetitle | fileNamedoc | fileNamePDF
-----------------------------------------------------------------------------------------------------------
Please or to participate in this conversation.