X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Frepo%2Fmigrations%2F20170906152508_create_o_auth_token.exs;h=bfad98b764e3b25a1daa33b94f183368e11a6858;hb=c95859e45b18dec1d00f721ef3c5b4bb1406ea37;hp=ed56bbf364ed93bbbb8b129e49a468bd2d2224fc;hpb=fee360e581d9aced145d21429eba5a63b3f682d1;p=akkoma diff --git a/priv/repo/migrations/20170906152508_create_o_auth_token.exs b/priv/repo/migrations/20170906152508_create_o_auth_token.exs index ed56bbf36..bfad98b76 100644 --- a/priv/repo/migrations/20170906152508_create_o_auth_token.exs +++ b/priv/repo/migrations/20170906152508_create_o_auth_token.exs @@ -2,12 +2,12 @@ defmodule Pleroma.Repo.Migrations.CreateOAuthToken do use Ecto.Migration def change do - create table(:oauth_tokens) do - add :app_id, references(:apps) - add :user_id, references(:users) - add :token, :string - add :refresh_token, :string - add :valid_until, :naive_datetime_usec + create_if_not_exists table(:oauth_tokens) do + add(:app_id, references(:apps)) + add(:user_id, references(:users)) + add(:token, :string) + add(:refresh_token, :string) + add(:valid_until, :naive_datetime_usec) timestamps() end