summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-10-09 16:55:58 +0200
committerlain <lain@soykaf.club>2019-10-09 16:55:58 +0200
commit0d7109254b82ffd1b31c6e90ea3fa2a80f9783c0 (patch)
treecddede83dc96295a7c2a6263df7aa138dd295d65
parent0ff1985304617142a813d5c546a4896f824a0c41 (diff)
Migrations: Create index after filling up the db.
-rw-r--r--priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs2
-rw-r--r--priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs1
2 files changed, 1 insertions, 2 deletions
diff --git a/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs b/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs
index fb38fa29c..c0548b6d6 100644
--- a/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs
+++ b/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs
@@ -5,7 +5,5 @@ defmodule Pleroma.Repo.Migrations.AddApIdColumnToObjects do
alter table(:objects) do
add :ap_id, :string
end
-
- create unique_index(:objects, [:ap_id])
end
end
diff --git a/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs b/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs
index 55834b3e1..81ecc27f7 100644
--- a/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs
+++ b/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs
@@ -3,5 +3,6 @@ defmodule Pleroma.Repo.Migrations.FillObjectApIdField do
def change do
execute("update objects set ap_id = data->>'id'")
+ create unique_index(:objects, [:ap_id])
end
end