PhoenixKit progress: Install into any Phoenix app with one command
Installing PhoenixKit into an existing Phoenix app now takes one command. The installer is built on Igniter, the code-generation toolkit for Elixir, so it edits your project’s files the same careful way each time instead of leaving you a list of manual steps.
What mix phoenix_kit.install does
- finds your app’s Ecto repository and checks that it runs on PostgreSQL;
- generates the database migration for PhoenixKit’s tables, and offers to run it right away;
- adds PhoenixKit’s configuration to
config/config.exs; - sets up the mailer for development, and a template for production;
- adds PhoenixKit’s routes to your router.
Options cover the less common setups: a specific repository (--repo), a router in another place (--router-path), or PhoenixKit’s tables in a PostgreSQL schema of their own (--prefix auth --create-schema), for teams that want them kept apart. Prefer to do it by hand? A manual installation takes five steps.
Migrations that can grow
PhoenixKit’s database migrations are versioned the way Oban does it: your app has one small migration that says which PhoenixKit version of the schema it wants. When a new PhoenixKit needs new tables, mix phoenix_kit.update adds the next step, so updating a dependency never means rewriting old migrations.