[#923] Support for multiple (external) registrations per user via Registration.

This commit is contained in:
Ivan Tashkinov 2019-03-18 17:23:38 +03:00
commit 26b6354095
9 changed files with 93 additions and 50 deletions

View file

@ -1,12 +0,0 @@
defmodule Pleroma.Repo.Migrations.AddAuthProviderAndAuthProviderUidToUsers do
use Ecto.Migration
def change do
alter table(:users) do
add :auth_provider, :string
add :auth_provider_uid, :string
end
create unique_index(:users, [:auth_provider, :auth_provider_uid])
end
end

View file

@ -0,0 +1,16 @@
defmodule Pleroma.Repo.Migrations.CreateRegistrations do
use Ecto.Migration
def change do
create table(:registrations) do
add :user_id, references(:users, type: :uuid, on_delete: :delete_all)
add :provider, :string
add :uid, :string
add :info, :map, default: %{}
timestamps()
end
create unique_index(:registrations, [:provider, :uid])
end
end