Skip to content

Is deleting HAS_MANY related records necessary? #46

@vollossy

Description

@vollossy

Hello, thanks for sucha good library. But I have some doubts about related records deleting in case of HAS_MANY relation. For example if I have model Question which has many questions and only one right question i would implement it in DB like such:

Question table: id(pk), text, right_variant_id
Variant table: id(pk),text,question_id

So, when i'm inserting it's okay all stuff save correctly. But when I'm trying to update relation, I'm getting an error, because of deleting records from variant which is dependency of question. So what do you think about this situation? My suggestion is to add a check for a changes in related records list and remove only deleted records.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions