Ash FrameworkAF
Ash Framework7mo ago
22 replies
Oliver

Foreign key reference naming and Ash.Generator

On my resource I have:

references do
      reference :region, name: "FK_dfwoyi1w884tqx68rctmbut4u"
...snip...


Using an invalid region_id in a seed I get this error:
 ** (Ash.Error.Unknown) 
     Unknown Error

     * ** (Ecto.ConstraintError) constraint error when attempting to insert struct:

         * "FK_dfwoyi1w884tqx68rctmbut4u" (foreign_key_constraint)


Are FKs combined with seed_generate in Ash.Generator not supposed to work?

The error says that:
* "outcrop_region_id_fkey" (foreign_key_constraint)


Is defined on the changeset, which makes it seem like the foreign key is not applied as it should.
Solution
regression perhaps? want a failing pr submitted to ash_postgres?
Was this page helpful?