fixed note attachment issues and add migration for dog logical delete