add update procedures and re-organise all the SQL things

now possible to generate a whole file with comments yah