I have a database where the users have different projects. A user can have multiple projects but a project can have only one user.
I get a problem if i’m going to delete a user without deleting his projects. MySql won’t let me delete the user unless i first delete the projects.
Is there a way i can delete the user and keep the projects?
You have set up your schema with foreign key constraints, so the project table rows insist on the presence of the owning user.
This kind of “deletion” ïs usually done by soft deletion: by adding an “inactive” column to your tables, and setting it to “Yes” or nonzero or something like that when you want to mark a particular row as deleted.