mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 18:48:06 +03:00
aa7ae87811
* 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
18 lines
522 B
Elixir
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
|