summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-08-07 22:05:17 +0300
committerrinpatch <rinpatch@sdf.org>2020-08-10 11:55:58 +0300
commita818587467feb1f5d5ad1f9499e61dcd7184e864 (patch)
tree04c6f7a62a702f998d279278bc23e9dc668f9c39 /priv
parent0149dd01469b7c52f4abe173157b8b5cc4442ff6 (diff)
20200802170532_fix_legacy_tags: Select only fields the migration needs
Selecting the full struct will break as soon as a new field is added.
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200802170532_fix_legacy_tags.exs5
1 files changed, 4 insertions, 1 deletions
diff --git a/priv/repo/migrations/20200802170532_fix_legacy_tags.exs b/priv/repo/migrations/20200802170532_fix_legacy_tags.exs
index f7274b44e..a84b5d0f6 100644
--- a/priv/repo/migrations/20200802170532_fix_legacy_tags.exs
+++ b/priv/repo/migrations/20200802170532_fix_legacy_tags.exs
@@ -18,7 +18,10 @@ defmodule Pleroma.Repo.Migrations.FixLegacyTags do
def change do
legacy_tags = Map.keys(@old_new_map)
- from(u in User, where: fragment("? && ?", u.tags, ^legacy_tags))
+ from(u in User,
+ where: fragment("? && ?", u.tags, ^legacy_tags),
+ select: struct(u, [:tags, :id])
+ )
|> Repo.all()
|> Enum.each(fn user ->
fix_tags_changeset(user)