dwyl / alog

🌲 alog (Append-only Log) is an easy way to start using the Lambda/Kappa architecture in your Elixir/Phoenix Apps while still using PostgreSQL (with Ecto).
GNU General Public License v2.0
15 stars 2 forks source link

Is alog being used in my project? #17

Open Cleop opened 5 years ago

Cleop commented 5 years ago

In my project file venue.ex I believed we were using the alog update function and I was receiving an error when trying to update a venue with 1 new associated field. It would update the field I was changing but it would reverse a change from an existing associated change.

This is the error message that occurs when you try to perform the update: image

It appears that cs_score is being listed as both a string key and atom key.

On looking closer it doesn't appear like alog is being used and we are duplicating some of the update fn code:

    |> Map.put(:id, nil)
    |> Map.put(:inserted_at, nil)
    |> Map.put(:updated_at, nil)
    |> Resources.put_many_to_many_assoc(attrs, :venue_types, CsGuide.Categories.VenueType, :name)
    |> Resources.put_many_to_many_assoc(attrs, :drinks, CsGuide.Resources.Drink, :entry_id)

So I checked whether Alog was being used when we created a venue but it turns out that it's not either.

I also tested the update fn to see if the error occurred just on associated fields but it occurs on all fields.