analytics/priv/repo/migrations/20191025055334_add_name_to_events.exs
2019-10-25 14:06:11 +08:00

21 lines
352 B
Elixir

defmodule Plausible.Repo.Migrations.AddNameToEvents do
use Ecto.Migration
use Plausible.Repo
def change do
alter table(:events) do
add :name, :string
end
flush()
Repo.update_all(Plausible.Event, set: [name: "pageview"])
flush()
alter table(:events) do
modify :name, :string, null: false
end
end
end