Stop inserting data into parent tables #1
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@dimagi/scale-team This is a change list after merging maxtepkeev#45 into the branch that we run on prod. There is some background in maxtepkeev#26 and maxtepkeev#43 but the gist of it is the way architect works by default is to insert into the parent & child tables, return the id, delete from the parent table.
By default this does nothing differently. If we add the
return_null
option, this will change it to only inserting into the child table and not returning the ID. this can break in django if we try to use the returned record (i.e. you need to handle the primary key in python code), but I plan to use this for UCRs so we only need to worry about sqlalchemy