I have a new layout to figure it has 3 tables
UnfiledFiles
SortedFiles
FileVersion
The process will start with an UnfiledFile Record and a FileVersion and several versions may be added all joined to the same UnfiledFile
From there I am going to need to tie all the Versions for a particular UnfiledFile record with a SortedFile Record.
What organization would you see this working best with?
Why store
UnfiledFilesandSortedFilesas separate tables? It appears that being unfiled versus sorted is just an attribute of a file.So you need two tables:
FilesandVersions.Versionscontains a foreign key toFiles.Filescontains an attribute columnis_sorted.If you want to make it clear which files you’re querying, you can create views: