chore(AshAuthenticationPhoenix): added library and updated ressources testing password strategy

This commit is contained in:
carla 2025-06-03 08:39:28 +02:00 committed by carla
parent f154eea055
commit 192ceaed45
24 changed files with 682 additions and 25 deletions

View file

@ -0,0 +1,19 @@
defmodule Mv.Repo.Migrations.AddAccountsDomainExtensions1 do
@moduledoc """
Installs any extensions that are mentioned in the repo's `installed_extensions/0` callback
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
execute("CREATE EXTENSION IF NOT EXISTS \"citext\"")
end
def down do
# Uncomment this if you actually want to uninstall the extensions
# when this migration is rolled back:
# execute("DROP EXTENSION IF EXISTS \"citext\"")
end
end

View file

@ -0,0 +1,31 @@
defmodule Mv.Repo.Migrations.AddAccountsDomain do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
rename table(:users), :password_hash, to: :hashed_password
alter table(:users) do
modify :email, :citext, null: false
modify :id, :uuid, default: fragment("gen_random_uuid()")
end
create unique_index(:users, [:email], name: "users_unique_email_index")
end
def down do
drop_if_exists unique_index(:users, [:email], name: "users_unique_email_index")
alter table(:users) do
modify :id, :uuid, default: fragment("uuid_generate_v7()")
modify :email, :text, null: true
end
rename table(:users), :hashed_password, to: :password_hash
end
end