2
I’m implementing my TCC, about photos and such.. But now I got a question when creating the tables... I’m using Laravel ok?
Next, I have the following tables:
users - roles - photos - tags
works as follows: There are functions of: 1) Fotografo 2) Client(who would be the photographer’s client)
That is, a photographer will have several clients.
In table photos, I had thought of the columns:
| photos |
| id |
| path |
| imageable_id |
| imageable_type|
The imageable_type because for example, the photographer will have his profile image, the client also, the photographer may have company image, and when there was a photo essay, there will be several photos linking the photographer to the client. But in this case would be missing a column to link the photographer with the client?
For the tags
| tags |
| id |
| description |
| taggable_id |
| taggable_type |
This one I think is easier because the type, will either be a tag for the photo or will be a tag for an essay, that’s all...
But in relation to photos even, what kind of relationship is it? Polimorphic Manytomany??
I hope you explained it successfully, thank you!