analytics/priv/repo/migrations/20191220042658_add_session_start.exs

16 lines
317 B
Elixir
Raw Normal View History

2019-12-20 07:30:29 +03:00
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