2019-10-08 05:57:28 -04:00
|
|
|
defmodule Pleroma.Repo.Migrations.FillObjectApIdField do
|
|
|
|
use Ecto.Migration
|
2019-10-11 10:13:13 -04:00
|
|
|
alias Pleroma.Clippy
|
2019-10-08 05:57:28 -04:00
|
|
|
|
|
|
|
def change do
|
2019-10-11 10:13:13 -04:00
|
|
|
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))
|
2019-10-08 05:57:28 -04:00
|
|
|
execute("update objects set ap_id = data->>'id'")
|
2019-10-09 10:55:58 -04:00
|
|
|
create unique_index(:objects, [:ap_id])
|
2019-10-08 05:57:28 -04:00
|
|
|
end
|
|
|
|
end
|