defmodule OpenAgents.Repo.Migrations.AllowChatAccountApiTokenScope do
use Ecto.Migration
def up do
drop constraint(:api_tokens, :api_tokens_scopes_allowed)
create constraint(:api_tokens, :api_tokens_scopes_allowed,
check: "scopes <@ ARRAY['chat:account', 'forge:write']::varchar[]"
)
end
def down do
drop constraint(:api_tokens, :api_tokens_scopes_allowed)
create constraint(:api_tokens, :api_tokens_scopes_allowed,
check: "scopes <@ ARRAY['forge:write']::varchar[]"
)
end
end