ash_authentication/priv/repo/migrations/20230113020413_add_subject_to_token_resource.exs
James Harton 948298ac1c
improvement(TokenResource)!: Store the token subject in the token resource. (#133)
* improvement(TokenResource)!: Store the token subject in the token resource.

This is a breaking change because you may have to delete tokens in your database so that you can avoid the non-null constraint on subject.

* docs: Add upgrading documentation.
2023-01-13 17:21:57 +13:00

21 lines
418 B
Elixir

defmodule Example.Repo.Migrations.AddSubjectToTokenResource do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
alter table(:tokens) do
add :subject, :text, null: false
end
end
def down do
alter table(:tokens) do
remove :subject
end
end
end