Setting the default foreign key type in Ash!

The default foreign key type is
:uuid
, and you can change it with attribute_type on a relationship, eg.

belongs_to :class, MyApp.Characters.Class, attribute_type: :integer


But if you're working with an existing database schema that has all-integer foreign keys, for example, you can change the default in your config file:

config :ash, default_belongs_to_type: :integer


Now you don't have to specify it on every single relationship! ✨
Was this page helpful?