fix webapp deletion vs. user deletion vs. job deletion
The webapp-job webapp-user and the user-job associations have dependent: :delete_all
or dependent: :destroy
which is problematic because:
- if a webapp is deleted by its owner, then all its jobs are immediately deleted, which is wrong because the jobs belonging to other users should remain on the server (during one month).
- datastore files are not deleted in the process
- running jobs are ignored in the process
Deleted webapps and users should be kept in the database (with a status DELETED
) until all jobs referring to them are purged. Also the short_name should be changed int the process so that it can be reused for another app.