diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-14 14:28:26 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-14 14:28:26 +0300 |
commit | 949e35e26deaf6dc7c2e552b1b8db63de8a87445 (patch) | |
tree | c69e375955b491b489b5bb1ff22e11f949c82946 /priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs | |
parent | 063baca5e4f3a100c0d45dffb14e4968599ef43b (diff) | |
download | pleroma-949e35e26deaf6dc7c2e552b1b8db63de8a87445.tar.gz pleroma-949e35e26deaf6dc7c2e552b1b8db63de8a87445.zip |
[#468] OAuth scopes-related data migration simplification.
Diffstat (limited to 'priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs')
-rw-r--r-- | priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs b/priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs new file mode 100644 index 000000000..7afbcbd76 --- /dev/null +++ b/priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo.Migrations.DataMigrationPopulateOAuthScopes do + use Ecto.Migration + + def up do + for t <- [:oauth_authorizations, :oauth_tokens] do + execute "UPDATE #{t} SET scopes = apps.scopes FROM apps WHERE #{t}.app_id = apps.id;" + end + end + + def down, do: :noop +end |