Currently I only have 1 folder per user for the media he uploads, but in the future I might want to split it to different folders.
At first I was thinking to have another column in the users table that's called media_folder which will store the folder path.
But then I was thinking it's not a good idea in case I want to be more flexible and add more folders, then I was thinking to create another "folders" DB which will be the relationship between the user_id and his folder_path
Well, in the future, a user may have multiple folders, if these folders will belong to one and only user, then this is a many-to-one relationship, and the best approach (is like you said) would be to create a "folders" table that has a "user_id" and a "path" columns
If you intend to make functionalities like sharing folders between users, or a user might invite people to see that folder or whatever, you may want to have that "users_folders" table to store "user_id" and "folder_id" (and may have many columns, for example to determine the permissions given to that user on that folder etc..).
@OussamaMater Thanks, good idea, by the way if I also generate thumnails for each uploaded photo/video - and it's usually a folder called "thumbnails" inside the user's main media folders - should I also make a thumbnails table? Or just name the thumbnail the same name as the image like xxxx_thumbnail and then I know which one to take?
@Ligonsker I would keep it simple and go for the 2nd method, always keep in mind, if you don't really need it yet, then you don't, reach out to the tables solution if you feel like it started to become unmaintainable, with more code.