Pass options to underlying type in `storage_type/1`

Hi! I’ve created an Amount type using Ash.Type.NewType like so:

defmodule MyApp.Types.Amount do
  use Ash.Type.NewType,
    subtype_of: :decimal,
    constraints: [precision: 19, scale: 2]

This is working fine, but since I’m using Postgres, I’d like to enforce the constraints at the DB level: I want Ash to generate migrations using NUMERIC(19, 2). Would it be possible to do something like this?

@impl true
def storage_type(_constraints) do
	[:numeric, precision: 19, scale: 2]
end

Maybe we could augment NewType’s API and add an option like enforce_constraints_in_database: true? If the subtype supports it, this would take the constraints options and pass them down to Ecto.

Currently this is done via defining a migration_type callback. The options aren’t documented right now (which we should fix) but: AshPostgres.Type — ash_postgres v2.8.0

def migration_type(_) do
   {:decimal, precision, scale} | {:decimal, precision}
end

Thanks, @zachdaniel!