logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

20190315101315_create_registrations.exs (731B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.CreateRegistrations do
  5. use Ecto.Migration
  6. def change do
  7. create_if_not_exists table(:registrations, primary_key: false) do
  8. add(:id, :uuid, primary_key: true)
  9. add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
  10. add(:provider, :string)
  11. add(:uid, :string)
  12. add(:info, :map, default: %{})
  13. timestamps()
  14. end
  15. create_if_not_exists(unique_index(:registrations, [:provider, :uid]))
  16. create_if_not_exists(unique_index(:registrations, [:user_id, :provider, :uid]))
  17. end
  18. end