pleroma/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs

12 lines
409 B
Elixir
Raw Permalink Normal View History

defmodule Pleroma.Repo.Migrations.FillObjectApIdField do
use Ecto.Migration
alias Pleroma.Clippy
def change do
Clippy.puts("ATTENTION! This migration might take hours! If you don't want to run it now, abort this with CTRL+C! I'll wait 30 seconds now.")
2019-10-11 10:17:34 -04:00
:timer.sleep(:timer.seconds(30))
execute("update objects set ap_id = data->>'id'")
create unique_index(:objects, [:ap_id])
end
end