diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-18 17:23:38 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-18 17:23:38 +0300 |
commit | 26b63540953f6a65bb52531b434fd6ab85aaedfe (patch) | |
tree | bb529911aff0405232b22eda6245791c929732c8 /priv/repo/migrations | |
parent | 2a96283efbd46c017cf9e15ef4fda3188e5e5bca (diff) | |
download | pleroma-26b63540953f6a65bb52531b434fd6ab85aaedfe.tar.gz pleroma-26b63540953f6a65bb52531b434fd6ab85aaedfe.zip |
[#923] Support for multiple (external) registrations per user via Registration.
Diffstat (limited to 'priv/repo/migrations')
-rw-r--r-- | priv/repo/migrations/20190315101315_add_auth_provider_and_auth_provider_uid_to_users.exs | 12 | ||||
-rw-r--r-- | priv/repo/migrations/20190315101315_create_registrations.exs | 16 |
2 files changed, 16 insertions, 12 deletions
diff --git a/priv/repo/migrations/20190315101315_add_auth_provider_and_auth_provider_uid_to_users.exs b/priv/repo/migrations/20190315101315_add_auth_provider_and_auth_provider_uid_to_users.exs deleted file mode 100644 index 90947f85a..000000000 --- a/priv/repo/migrations/20190315101315_add_auth_provider_and_auth_provider_uid_to_users.exs +++ /dev/null @@ -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 diff --git a/priv/repo/migrations/20190315101315_create_registrations.exs b/priv/repo/migrations/20190315101315_create_registrations.exs new file mode 100644 index 000000000..dac86b780 --- /dev/null +++ b/priv/repo/migrations/20190315101315_create_registrations.exs @@ -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 |