Guides or advice for migrating to Ash?
I have a small app with 3 tables in Postgres using Ecto.Table. I am migrating them to use Ash.Resource.
When I run
mix ash_postgres.generate_migrations
for the first time, the generated migrations are to create tables that already exist and the table structures are different. Are there any guides or do you have any advice for reconciling the differences?
Original ecto migration:
New generated migration:
Thanks in advance. Excited to move to Ash.2 Replies
The best way to handle this is generally to generate migrations once, replace the generated migrations with migrations that would change your schema to the new schema, and then move forward with the generated migrations. Generating the migrations once will store the snapshots, and then only new changes will be generated in the future.
So, for example, you might replace the generated migration with something like:
Might take a couple iterations to get right, but AFAIK that is the best way to go about it 🙂
Thanks. I'll give that a go!