diff options
Diffstat (limited to 'priv/repo/migrations')
3 files changed, 25 insertions, 20 deletions
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 4d163ce0b..591164be5 100644 --- a/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs +++ b/priv/repo/migrations/20170719152213_add_follower_address_to_user.exs @@ -1,30 +1,10 @@ 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 end - - # Not needed anymore for new setups. - # 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 diff --git a/priv/repo/migrations/20190518032627_create_config.exs b/priv/repo/migrations/20190518032627_create_config.exs new file mode 100644 index 000000000..1e4e3c689 --- /dev/null +++ b/priv/repo/migrations/20190518032627_create_config.exs @@ -0,0 +1,13 @@ +defmodule Pleroma.Repo.Migrations.CreateConfig do + use Ecto.Migration + + def change do + create table(:config) do + add(:key, :string) + add(:value, :binary) + timestamps() + end + + create(unique_index(:config, :key)) + end +end diff --git a/priv/repo/migrations/20190622151019_add_group_key_to_config.exs b/priv/repo/migrations/20190622151019_add_group_key_to_config.exs new file mode 100644 index 000000000..d7a3785d0 --- /dev/null +++ b/priv/repo/migrations/20190622151019_add_group_key_to_config.exs @@ -0,0 +1,12 @@ +defmodule Pleroma.Repo.Migrations.AddGroupKeyToConfig do + use Ecto.Migration + + def change do + alter table("config") do + add(:group, :string) + end + + drop(unique_index("config", :key)) + create(unique_index("config", [:group, :key])) + end +end |