defmodule OhMyExOhIrcd.Repo.Migrations.CreateImageTokens do
use Ecto.Migration
def change do
create table(:image_tokens) do
add :channel_id, references(:channels, on_delete: :delete_all), null: false
# The account this token is bound to; the announced identity is
# derived from the token, never from the request body.
add :user_id, references(:users, on_delete: :delete_all), null: false
add :token_hash, :binary, null: false
# Display name shown in announcements, fixed at mint time.
add :who, :string, null: false
add :label, :string
add :last_used_at, :utc_datetime
add :revoked_at, :utc_datetime
timestamps(type: :utc_datetime)
end
create unique_index(:image_tokens, [:token_hash])
create index(:image_tokens, [:channel_id])
create index(:image_tokens, [:user_id])
end
end
neiam
/oh-my-ex-oh-ircd
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
873 B · text
History
3a1226c