Stop inserting data into parent tables#1
Closed
emord wants to merge 9 commits intoje/fix-postgres-hyphenfrom
Closed
Stop inserting data into parent tables#1emord wants to merge 9 commits intoje/fix-postgres-hyphenfrom
emord wants to merge 9 commits intoje/fix-postgres-hyphenfrom
Conversation
snopoke
approved these changes
Oct 2, 2018
snopoke
left a comment
There was a problem hiding this comment.
Haven't done a full review, let me know if you need me to.
Author
|
This was pointed to by dimagi/commcare-hq#21994 which is now merged. I also rebuilt the current triggers so that they are inserting directly to the child tables. We're still using a tag because I don't think either of these two PRs will get merged upstream. I think depending on the citus stuff we may end up removing this dependency anyways, so I'm going to keep this as pointing to a tag. If we still need this afterwards I will come up with a plan to get this properly versioned. Going to put it in the tech debt trello https://trello.com/c/MxJoiRaV/108-path-forward-for-architect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_nulloption, 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