analytics/priv/repo/migrations/20191220042658_add_session_start.exs
2019-12-20 12:30:29 +08:00

16 lines
317 B
Elixir

defmodule Plausible.Repo.Migrations.AddSessionStart do
use Ecto.Migration
def change do
alter table(:sessions) do
add :start, :naive_datetime
end
execute "UPDATE sessions set start = timestamp"
alter table(:sessions) do
modify :start, :naive_datetime, null: false
end
end
end