sql writer - refs on delete and on update action
fk naming fix