Merge pull request 'Add dark and light theme mode to docs, detection, and button...
[akkoma] / priv / repo / migrations / 20190315101315_create_registrations.exs
1 defmodule Pleroma.Repo.Migrations.CreateRegistrations do
2 use Ecto.Migration
3
4 def change do
5 create_if_not_exists table(:registrations, primary_key: false) do
6 add(:id, :uuid, primary_key: true)
7 add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
8 add(:provider, :string)
9 add(:uid, :string)
10 add(:info, :map, default: %{})
11
12 timestamps()
13 end
14
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