I have a task to associate 1:N documents to a record in my hardware table. This file could be a warranty, or whatever. In SQLServer I set up a FileStream group and made a table for only the file and the other required columns (id, internal id (a guid), and a varbinary(MAX) column). I have another table that will store the file information (name, size, mime type), and the file's id in from the files table. I call this table Document_Info. Is this a good name? Describing the relationship between my hardware table and the Document_Info table I'm struggling with.
I'm considering storing the hardware's id in the Document_Info table and create another column representing what this document is related to. That would help me integrate other future tables that also need to relate 1:1 or 1:N if they need to store files as well. I just specify a new type and I'm good. id's can be the same as long as their id type is different.
How this all relates to my hardware model is, by principle, it doesn't because a model's fields represents a table's columns. Yet, I have to store this hardware's documents somewhere, but the question is where?