From 87f7729cf9b9ad5731446aa86bd30c28e3a8937c Mon Sep 17 00:00:00 2001 From: Adrian Gruntkowski Date: Mon, 16 Oct 2023 12:56:36 +0200 Subject: [PATCH] Add `email_activation_codes` table (#3426) * Add email_activation_codes table * Change code column in migration to string --- .../20231011101825_add_email_activation_codes.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 priv/repo/migrations/20231011101825_add_email_activation_codes.exs diff --git a/priv/repo/migrations/20231011101825_add_email_activation_codes.exs b/priv/repo/migrations/20231011101825_add_email_activation_codes.exs new file mode 100644 index 000000000..830deda0a --- /dev/null +++ b/priv/repo/migrations/20231011101825_add_email_activation_codes.exs @@ -0,0 +1,14 @@ +defmodule Plausible.Repo.Migrations.AddEmailActivationCodes do + use Ecto.Migration + + def change do + create table(:email_activation_codes) do + add :code, :text, null: false + add :user_id, references(:users, on_delete: :delete_all), null: false + + add :issued_at, :naive_datetime, null: false + end + + create unique_index(:email_activation_codes, :user_id) + end +end