From: Ivan Tashkinov Date: Fri, 22 Feb 2019 11:00:18 +0000 (+0300) Subject: Fixed `scopes` of apps / authorizations / tokens from apps initially created with... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b227ccab827471359f539d23a14413e70ad67e33;p=akkoma Fixed `scopes` of apps / authorizations / tokens from apps initially created with space-delimited `scope`. --- diff --git a/priv/repo/migrations/20190222104808_data_migration_normalize_scopes.exs b/priv/repo/migrations/20190222104808_data_migration_normalize_scopes.exs new file mode 100644 index 000000000..d44e5096b --- /dev/null +++ b/priv/repo/migrations/20190222104808_data_migration_normalize_scopes.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo.Migrations.DataMigrationNormalizeScopes do + use Ecto.Migration + + def up do + for t <- [:apps, :oauth_authorizations, :oauth_tokens] do + execute "UPDATE #{t} SET scopes = string_to_array(array_to_string(scopes, ' '), ' ');" + end + end + + def down, do: :noop +end