Writes the migrations that create the native backend's tables into the host's migrations, one file each:
create_macaw_auth_users:macaw_auth_users(Macaw.Auth.Native.UserRecord);create_macaw_auth_sessions:macaw_auth_sessions(Macaw.Auth.Native.SessionRecord), referencing the users;add_macaw_auth_second_factor: the second factor's columns onmacaw_auth_usersand themacaw_auth_recovery_codestable (Macaw.Auth.Native.Totp,Macaw.Auth.Native.RecoveryCodeRecord).mix macaw_auth.gen.migration mix macaw_auth.gen.migration --repo MyApp.Repo --migrations-path priv/repo/migrations
The repo's name is --repo, else the configured one (config :macaw_auth, Macaw.Auth.Native, repo: MyApp.Repo); it is only written
into the files as text. The path defaults to priv/repo/migrations.
Each has its own file, and the task writes only those not yet there: a
host that has the users and sessions migrations gets the second
factor's added after them, and a host that has all three is refused, so
no table or column is ever created twice. Files are timestamped like mix ecto.gen.migration's,
one second apart, so they run in order.
The migrations are plain DDL the host owns and can read, and they are
the ones this library's own tests run against SQLite, so what ships is
what is tested. They work on Postgres and SQLite alike: the array
columns are {:array, :string}, a native array on Postgres and JSON
text on SQLite.