If a resource is associated with any note, is_associated is 1, it it’s not is_associated is 0. From the moment is_associated is 0, a timer starts and after x days the resource is deleted.