X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=priv%2Frepo%2Fmigrations%2F20170719152213_add_follower_address_to_user.exs;h=be5eca36cb2858ade52dcb09aa88624b156fd069;hb=73609211a425922a5068d3912a36b82abe24e12c;hp=bd3c93bd5105511b215cc383f4df4eb4a929056b;hpb=396c32a6da5d028675b2d3c4154ac9045596ad31;p=akkoma diff --git a/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs b/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs index bd3c93bd5..be5eca36c 100644 --- a/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs +++ b/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs @@ -1,33 +1,15 @@ defmodule Pleroma.Repo.Migrations.AddFollowerAddressToUser do use Ecto.Migration - import Ecto.Query - import Supervisor.Spec - alias Pleroma.{Repo, User} def up do alter table(:users) do - add :follower_address, :string, unique: true + add(:follower_address, :string, unique: true) end - flush() - - children = [ - # Start the endpoint when the application starts - supervisor(Pleroma.Web.Endpoint, []) - ] - opts = [strategy: :one_for_one, name: Pleroma.Supervisor] - Supervisor.start_link(children, opts) - - Enum.each(Repo.all(User), fn (user) -> - if !user.follower_address do - cs = Ecto.Changeset.change(user, %{follower_address: User.ap_followers(user)}) - Repo.update!(cs) - end - end) end def down do alter table(:users) do - remove :follower_address + remove(:follower_address) end end end