Agops Solutions
New member
- Local time
- Today, 23:14
- Joined
- Nov 4, 2011
- Messages
- 4
Hi All,
I'm working on a database for a back-office admin system. One of the requirements is that all documents going out (and all those coming back in with signatures, etc on) need to be archived in such a way that documents for any entity can be easily retrieved.
I've googled around, revised my database normalisation and checked out the link given at the top of this forum, but I can't find anything that quite matches what I'm doing (although I'm sure it's a common problem).
To save boring you with the intricacies of the industry I'm working in, lets say this is a DB for an events management agency and has a structure similar to the one outlined below:
Agent-||---o<Artist-||---o<Booking
I then have a table linking documents for a given entity to the location of the document in the filesystem, which looks something like the following
Documents
ID
Timestamp
Template ID
Foreign Table
Foreign Key
File Path
If I want to find all the documents relating to a given booking, I can then look up all records in the Documents table with [Foreign Table] = 'Booking' and [Foreign Key] = [Booking].[ID].
Also, say the company gets an FOI request from an agent, it's fairly simple to retrieve all the documents relating to the agent, all of their artists and all of those artists' bookings.
If the company tells me that they want to start generating and archiving documents related to a Venues table, for example, I can integrate this minimal code and no change to the data-structure.
This is implemented and working well at the moment and is better than a few alternatives I thought through, but it's not a model I've seen elsewhere which worries me and somehow it just doesn't 'feel' quite right. I don't want it coming back to bite me in a couple of years when a situation I haven't anticipated comes up. So I guess my questions are:
- Is there a better/more conventional way of doing this?
- Are there any problems this model might cause?
- Does this violate any normal forms?
- If this does violate any normal forms, is it one of those rare situations where technically poor normalisation actually results in better implementation?
I'm about to implement some new features which relate to this structure and may be implementing some other features based on a similar structure, which is why I'm revisiting it now.
Many thanks for any help with this
I'm working on a database for a back-office admin system. One of the requirements is that all documents going out (and all those coming back in with signatures, etc on) need to be archived in such a way that documents for any entity can be easily retrieved.
I've googled around, revised my database normalisation and checked out the link given at the top of this forum, but I can't find anything that quite matches what I'm doing (although I'm sure it's a common problem).
To save boring you with the intricacies of the industry I'm working in, lets say this is a DB for an events management agency and has a structure similar to the one outlined below:
Agent-||---o<Artist-||---o<Booking
I then have a table linking documents for a given entity to the location of the document in the filesystem, which looks something like the following
Documents
ID
Timestamp
Template ID
Foreign Table
Foreign Key
File Path
If I want to find all the documents relating to a given booking, I can then look up all records in the Documents table with [Foreign Table] = 'Booking' and [Foreign Key] = [Booking].[ID].
Also, say the company gets an FOI request from an agent, it's fairly simple to retrieve all the documents relating to the agent, all of their artists and all of those artists' bookings.
If the company tells me that they want to start generating and archiving documents related to a Venues table, for example, I can integrate this minimal code and no change to the data-structure.
This is implemented and working well at the moment and is better than a few alternatives I thought through, but it's not a model I've seen elsewhere which worries me and somehow it just doesn't 'feel' quite right. I don't want it coming back to bite me in a couple of years when a situation I haven't anticipated comes up. So I guess my questions are:
- Is there a better/more conventional way of doing this?
- Are there any problems this model might cause?
- Does this violate any normal forms?
- If this does violate any normal forms, is it one of those rare situations where technically poor normalisation actually results in better implementation?
I'm about to implement some new features which relate to this structure and may be implementing some other features based on a similar structure, which is why I'm revisiting it now.
Many thanks for any help with this