3 ms·
Ash Framework gives you the ability to define the schema in code, via mix ash_postgres.generate_migrations --name name_of_my_migration but of course now y
by bmelton 3y ago
Ash Framework gives you the ability to define the schema in code, via
mix ash_postgres.generate_migrations --name name_of_my_migration
but of course now you're using a framework (albeit a really good one) that is perhaps a bit less mature than Elixir
- ch4s3 3y agoI'm aware of that, and can see why people like it in Ash, but as with Django I think it makes things less explicit, harder to break up domain specific structures backed by the database, and more magical. It's fine IMHO as an add on with something like Ash, but a data mapper like Ecto shouldn't strive to be an ORM like Django especially in a functional language.
- zachdaniel 3y agoI think its also important for people to realize that 1. its opt-in, if you don't like it don't use it :) 2. we don't do magic migrations. We generate a regular ecto migration from your resource changes. So you can use it as a starting point and hand edit it (and often you should or even must as we can't do things like generating data migrations). 3. you don't have to map your resources one-to-one with tables. We support multiple resources being sourced from the same table, and turning on and off migration generation per resource. It's very common to have an Ash resource backed by a postgres view, or two ash resources backed by the same table. The migration generator merges resource definitions together to create "the strictest table definition that supports both resources". You can also remap field names. So at the end of the day, you can have your cake and eat it too on that front.