diff --git a/documentation/migrations.md b/documentation/migrations_and_tasks.md similarity index 58% rename from documentation/migrations.md rename to documentation/migrations_and_tasks.md index 1757d14..392e670 100644 --- a/documentation/migrations.md +++ b/documentation/migrations_and_tasks.md @@ -1,9 +1,24 @@ # Migrations +## Tasks + +The available tasks are: + +* `mix ash_postgres.create` +* `mix ash_postgres.drop` +* `mix ash_postgres.migrate` (use `mix ash_postgres.migrate --tenants` to run tenant migrations) + AshPostgres is built on top of ecto, so much of its behavior is pass-through/orchestration of that tooling. -For instance, you can use `mix ash_postgres.generate_migrations` to generate a snapshot and a migration to take -your resources from the previous version to this version. For more information, see the module documentation here: +## Basic Workflow + +* Make resource changes +* Run `mix ash_postgres.generate_migrations` to generate migrations and resource snapshots +* Run `mix ash_postgres.migrate` to run those migrations +* Run `mix ash_postgres.migrate --tenants` *as well* if you have multi-tenant resources. + + +For more information on generating migrations, see the module documentation here: `Mix.Tasks.AshPostgres.GenerateMigrations`, or run `mix help ash_postgres.generate_migrations` For running your migrations, there is a mix task that will find all of the repos configured in your apis and run their @@ -16,4 +31,5 @@ For tenant migrations (see the multitenancy guides for more) generated by multit ## Multiple Repos -If you are using multiple repos, you will likely need to use `mix ecto.migrate` and manage it separately for each repo. +If you are using multiple repos, you will likely need to use `mix ecto.migrate` and manage it separately for each repo, as the options would +be applied to both repo, which wouldn't make sense. diff --git a/mix.exs b/mix.exs index 534c64c..86f7f92 100644 --- a/mix.exs +++ b/mix.exs @@ -53,6 +53,7 @@ defmodule AshPostgres.MixProject do logo: "logos/small-logo.png", extras: [ "README.md", + "documentation/migrations_and_tasks.md", "documentation/multitenancy.md" ], groups_for_extras: [