When creating models in a database, it is better to create a model for a particular use case instead of having one model for more than one use case. The reason is that in one table there might be some data that others should not have access to and if two models have Many-to-many relationship, an entity from one model can be assigned to more than one entity in another.
Let’s take Images as an example. We can store them as Blob in a database as it is just a series of Bytes. Instead of creating an Image model, where note images and user images will be stored, it is much better to create UserImage and NoteImage model where we have different relationships between models. A user can have One-to-one relationship (we don’t want other users to use our images) while note can have One-to-many relationship.
