From adc83007e475f9c985709ceec7152f25bd240a94 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 10 Jul 2025 15:30:21 -0500 Subject: [PATCH] restore users table --- ...250710202030_restore_users_auth_tables.exs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 priv/repo/migrations/20250710202030_restore_users_auth_tables.exs diff --git a/priv/repo/migrations/20250710202030_restore_users_auth_tables.exs b/priv/repo/migrations/20250710202030_restore_users_auth_tables.exs new file mode 100644 index 0000000..d2411f1 --- /dev/null +++ b/priv/repo/migrations/20250710202030_restore_users_auth_tables.exs @@ -0,0 +1,25 @@ +defmodule Aprsme.Repo.Migrations.RestoreUsersAuthTables do + use Ecto.Migration + + def change do + create table(:users) do + add :email, :citext, null: false + add :hashed_password, :string, null: false + add :confirmed_at, :naive_datetime + timestamps(type: :utc_datetime) + end + + create unique_index(:users, [:email]) + + create table(:users_tokens) do + add :user_id, references(:users, on_delete: :delete_all), null: false + add :token, :binary, null: false + add :context, :string, null: false + add :sent_to, :string + timestamps(updated_at: false, type: :utc_datetime) + end + + create index(:users_tokens, [:user_id]) + create unique_index(:users_tokens, [:context, :token]) + end +end