Hello guys! I’m experiencing something weird. I’m using two composite types in two different project, in one it works out of the box but not the other.
The first one defines a composite field for a Fraction with (numerator, denominator), works fine. The second defines a money type (amount, current), just like the Money lib says to use the composite field but I get the following error when trying to fetch record.
** (Postgrex.QueryError) type `money` can not be handled by the types module Postgrex.DefaultTypes
The project that works:
- The Type: galerie/lib/fraction.ex at main · nicklayb/galerie · GitHub
- The migration: galerie/priv/repo/migrations/20230717234956_create_fraction_type.exs at main · nicklayb/galerie · GitHub
The project that doesn’t work:
- The type: loupe/test/support/money.ex at composite_field · nicklayb/loupe · GitHub
- The migration: loupe/test/support/repo/migrations/20230414090000_create_tables.exs at 9a593e096c7774564d5d757ea873bf5742390c6a · nicklayb/loupe · GitHub
The only differences I see in both is the one that works uses the type in the actual project and is a Phoenix app, the other is a lib and only use the type in tests (I’m not using the money lib because it’s only for testing that I need a composite field) (modifié)