mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2025-01-02 13:24:47 +00:00
8984bd7636
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
16 lines
563 B
Elixir
16 lines
563 B
Elixir
defmodule Mobilizon.Repo.Migrations.CreateApplicationTokens do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:application_tokens) do
|
|
add(:user_id, references(:users, on_delete: :delete_all), null: false)
|
|
add(:application_id, references(:applications, on_delete: :delete_all), null: false)
|
|
add(:authorization_code, :string, null: true)
|
|
add(:status, :string, default: "pending", null: false)
|
|
add(:scope, :string)
|
|
timestamps()
|
|
end
|
|
|
|
create(unique_index(:application_tokens, [:user_id, :application_id]))
|
|
end
|
|
end
|