There is a table in the database in which messages are stored. id, to whom, from whom, subject, text, date sent, status of the message How to implement the attached files? I thought to create a field in which data will be stored in the form of json with links to these files. But this is a violation of the first normal form. Is there another option to create a table in which the message messages and the path to the file will be stored. How to solve the problem correctly? Attached files need only be received, selections on them, etc. do not need to be done.

  • If samples are not needed for them, then store in JSON and don’t worry - it will save you from unnecessary JOINs in the queries, and normalization is not always good, in order to increase performance, it can be ignored - SergeyTsaplin

1 answer 1

There is another option to create a table in which the message ID and the path to the file will be stored.

IMHO the correct option.