More specific types in Ecto.Migration.references

Is there a way to instantiate a more specific type for a foreign key reference?

add :ref_id, references(:tbl, type: :string)

creates a VARCHAR(255)

I’m looking to create a CHAR(32), specifically to reference a table used by a separate django backend.

You should be able to do type: :"CHAR(32)" I’d think?


yes that works! Thanks!

1 Like