[v6r12] new ps and fk dfc

This PR contains a new sql schema with enforced Foreign Key, as well as stored procedure. The managers to call the various PS are also included. It also contains numerous bug fixes 
Good question. But if filename is not "", then we use the LFN later on. So I can probably replace it yes. But this part of the code is anyway a bit strange to me and I am not sure to fully understand it, which is why I did not want to change it too much :-)