analytics/priv/repo/migrations/20201130083829_add_email_verification_codes.exs
Uku Taht aa7ae87811
Onboarding UX improvements (#441)
* WIP

* Actually activate the user

* Send email verification codes

* Send activation code with email

* Only show onboarding steps during first site creation

* Add worker to config

* Consistent form styles

* Send welcome email when user activates account

* Add changelog entry

* Use https in new site form

* Correct spelling in email
2020-12-15 11:30:45 +02:00

18 lines
522 B
Elixir

defmodule Plausible.Repo.Migrations.AddEmailVerificationCodes do
use Ecto.Migration
def up do
create table(:email_verification_codes, primary_key: false) do
add :code, :integer, null: false
add :user_id, references(:users, on_delete: :delete_all)
add :issued_at, :naive_datetime
end
execute "INSERT INTO email_verification_codes (code) SELECT code FROM GENERATE_SERIES (1000, 9999) AS s(code) order by random();"
end
def down do
drop table(:email_verification_codes)
end
end