User A uploads A file X to the server, and user B adds the file to the favorites folder. User A wants to delete the file, but user B adds it to the favorites. How can this problem be solved? If you do not delete an association, you can still access the original path. User A uploads A file X to the server, and user B adds the file to the favorites folder. User A wants to delete the file, but user B uses
What should I do if my account is added to my favorites? If you do not delete an association, you can still access the original path.
Reply content:
User A uploads A file X to the server, and user B adds the file to the favorites folder. User A wants to delete the file, but user B uses
What should I do if my account is added to my favorites? If you do not delete an association, you can still access the original path.
Usually, when designing a database, the attachment table must be a separate table and be associated with the user table. As per your needs, you only need to delete the association relationship of user A or another identifier of user A to record whether the attachment is deleted. It has nothing to do with user B and does not need to operate user B's data.
Involves three objects: User, file, and relationship]
If a user deletes a published file, the [ownership] relationship should be removed. Instead of deleting files.
To prevent files from being deleted and stored on the server without any favorites, you can set a regular monitoring function, directly clear automatically.