[#923] Support for multiple (external) registrations per user via Registration.
This commit is contained in:
parent
2a96283efb
commit
26b6354095
9 changed files with 93 additions and 50 deletions
|
|
@ -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
|
||||
16
priv/repo/migrations/20190315101315_create_registrations.exs
Normal file
16
priv/repo/migrations/20190315101315_create_registrations.exs
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue