diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-22 14:00:18 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-22 14:00:18 +0300 |
commit | b227ccab827471359f539d23a14413e70ad67e33 (patch) | |
tree | 9ec70a047d3b425cae9042c67580543528caa565 | |
parent | 5a4e2905fecfd21cf92f6b2844f15f5ee84b33f5 (diff) | |
download | pleroma-b227ccab827471359f539d23a14413e70ad67e33.tar.gz pleroma-b227ccab827471359f539d23a14413e70ad67e33.zip |
Fixed `scopes` of apps / authorizations / tokens from apps initially created with space-delimited `scope`.
-rw-r--r-- | priv/repo/migrations/20190222104808_data_migration_normalize_scopes.exs | 11 |
1 files changed, 11 insertions, 0 deletions
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 |