execute "CREATE TYPE public.money_with_currency AS (amount integer, currency varchar(3))"
execute "CREATE TYPE public.money_with_currency AS (amount integer, currency varchar(3))"
in a migration file to actually create the custom type inside postgres.
Of course, I can just create a migration file and add that line there manually, that would just work. But, if possible, I would like to do this thing in a more automatic way since that would prevent me from forgetting to add that migration when I copy that custom type to other projects.
Is there any way to do that today? Or creating the migration manually is the only option?
Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog. - money/lib/money/ecto/composite_type.ex at v1.12.2 ยท elixirm...
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.