Commented out the elaborate error reporting when moving a file to a folder with the same name. Postgres seems to have problems querying a table that has just had an aborted transaction. Copied simpler error reporting of file copy instead.
removed on delete cascade on folder_id of fs_root_folders (see datamodel comment why); also added before and after trigger to clean up CR after package instance deletion
Removed on delete cascade on folder_id of fs_root_folders (see datamodel comments why); also added a before and after trigger to clean up CR when package instance is deleted.