on edit structures should be replaced, not added.  attachments table unique index changed to enforce this.