-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upsert_person/1
#115
Comments
I'm looking at this issue at the moment. I'll try to replicate the error first Start from scratch to make sure my application is clean:
I'm going to reset the database with
The user is inserted each time the LiveView is mounted or disconnected: On line 12 we see |
Only insert new person
I propose that we had the |
PR #116 should fix this issue |
I thought about using the We can define manually our primary key when the table is created on the migration:
def change do
create table(:people, primary_key: false) do
add(:id, :integer, primary_key: true)
add(:givenName, :binary)
add(:auth_provider, :string)
add(:key_id, :integer)
add(:picture, :binary)
add(:locale, :string)
add(:status_code, :integer)
timestamps()
end
end We can then continue to use the Ultimately because we are using the |
Yeah, If the Agree (in principal) with removing the |
BTW: The implementation on my branch works fine without any further code. 💭 |
If we explain the id for people comes from the What bothered me on the However I think we could remove the |
Yeah, the Definitely going to remove the |
Getting a
foreign_key_constraint
when running this on a fresh laptop:The
person
record is being inserted into Postgres as:For clarity: the problem with this picture is that the same
person
(me) is being inserted into the db multiple times when I login using multiple web browsers ... 🤦♂️Todo:
upsert
theperson
with theid
matching theirjwt.id
so that when they login again they can see theiritems
.The text was updated successfully, but these errors were encountered: