Attachments not deleted nor relation deleted after plugin refresh

Hi, I was working on a plugin of my own and decided to make a plugin:refresh. The problem is that the model attachments were not deleted and nor the db relations at system_files table. So now, when adding new records I’m having unwanted attachments as the model ids match. Shouldn’t the attachments be deleted on plugin refresh? Could this be a bug? I’m using OC 3.4.11

The refresh command runs the down() migration methods to drop the tables, so it won’t include model events used to delete attachments. There is a command to clean those up. Try running the following:

php artisan october:util purge orphans

Thank you! I’ll try that.