Introduce application tokens

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-02-15 19:31:23 +01:00
parent 39768693c5
commit 2ee329ff7b
30 changed files with 1533 additions and 32 deletions

View File

@@ -0,0 +1,14 @@
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)
timestamps()
end
create(unique_index(:application_tokens, [:user_id, :application_id]))
end
end