doc: added comments and updated to latest ashautentication version and required changes

This commit is contained in:
carla 2025-06-19 15:34:24 +02:00 committed by carla
parent a6fcaa1640
commit 7bfde5e230
19 changed files with 74 additions and 478 deletions

View file

@ -1,32 +0,0 @@
defmodule Mv.Repo.Migrations.AccountMigration 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
create table(:users, primary_key: false) do
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
add :email, :text
add :password_hash, :text
add :oicd_id, :text
add :member_id,
references(:members,
column: :id,
name: "users_member_id_fkey",
type: :uuid,
prefix: "public"
)
end
end
def down do
drop constraint(:users, "users_member_id_fkey")
drop table(:users)
end
end

View file

@ -1,19 +0,0 @@
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

@ -1,31 +0,0 @@
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