analytics/priv/repo/migrations/20200317093028_add_trial_expiry_to_users.exs
2020-03-18 16:27:46 +02:00

16 lines
358 B
Elixir

defmodule Plausible.Repo.Migrations.AddTrialExpiryToUsers do
use Ecto.Migration
def change do
alter table(:users) do
add :trial_expiry_date, :date
end
execute("UPDATE users SET trial_expiry_date=inserted_at::date + interval '30 days'")
alter table(:users) do
modify :trial_expiry_date, :date, null: false
end
end
end