S
shapper
Hello,
I need an advice:
I have 3 tables: Posts, Events and Files.
Each post, event and file can be a associated to one or many tags.
My idea was to create only one Tags table.
Note that each tag can have various associations.
It can be associate to various posts, events and files simultaneous.
My idea was to create a Tags table as follows:
[Tags] > TagId (PK), PostId (FK), EventId (FK), FileId (FK).
- Is this the way to do this?
- Will I have problems with .NET 3.5 LINQ?
The other 2 options I see are:
1. Having only one FK in table Tags, i.e. TargetId, which could be
associated with PostId, EventId or FileId ...
This does seem right to me.
2. Have 3 Tags tables: for posts, for Events and for Files.
I would like to avoid having 3 tables but ...
I need to extend my decision to categories, ratings, etc.
So option 2 really seems bad idea.
Could, someone, please advice me on this?
Thanks,
Miguel
I need an advice:
I have 3 tables: Posts, Events and Files.
Each post, event and file can be a associated to one or many tags.
My idea was to create only one Tags table.
Note that each tag can have various associations.
It can be associate to various posts, events and files simultaneous.
My idea was to create a Tags table as follows:
[Tags] > TagId (PK), PostId (FK), EventId (FK), FileId (FK).
- Is this the way to do this?
- Will I have problems with .NET 3.5 LINQ?
The other 2 options I see are:
1. Having only one FK in table Tags, i.e. TargetId, which could be
associated with PostId, EventId or FileId ...
This does seem right to me.
2. Have 3 Tags tables: for posts, for Events and for Files.
I would like to avoid having 3 tables but ...
I need to extend my decision to categories, ratings, etc.
So option 2 really seems bad idea.
Could, someone, please advice me on this?
Thanks,
Miguel