With AshPostgres, what is the proper way to create a exclusion constraint in a ash resource?
For check constraint, we can do it like this
postgres do table "rate_plans" repo MyApp.Repo check_constraints do check_constraint :start_date, "start_date_before_or_equal_to_end_date", check: "start_date <= end_date", message: "start_date must be before or equal to end_date" end end
postgres do table "rate_plans" repo MyApp.Repo check_constraints do check_constraint :start_date, "start_date_before_or_equal_to_end_date", check: "start_date <= end_date", message: "start_date must be before or equal to end_date" end end
With the above codes, when we run
mix ash.codegen <filename>
mix ash.codegen <filename>
constraints are created. But how can we do the same for exclusion constraint? Thanks.
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.