diff options
author | lain <lain@soykaf.club> | 2019-10-10 12:38:51 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-10-10 12:38:51 +0000 |
commit | d7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e (patch) | |
tree | f99394ee5d40b8c1bff6301acd683e13dc23edc8 /priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs | |
parent | 6c278cfe09fb9fd5220743d8f69c6e232623a09b (diff) | |
parent | 9fd5176c35d21846fb8368ea7bc0285f9cd74ad4 (diff) | |
download | pleroma-d7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e.tar.gz pleroma-d7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e.zip |
Merge branch 'develop' into 'reactions'
# Conflicts:
# CHANGELOG.md
Diffstat (limited to 'priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs')
-rw-r--r-- | priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs b/priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs index 72decd401..eb6fcb012 100644 --- a/priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs +++ b/priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs @@ -4,14 +4,20 @@ defmodule Pleroma.Repo.Migrations.ChangeAppsScopesToVarcharArray do @alter_apps_scopes "ALTER TABLE apps ALTER COLUMN scopes" def up do - execute "#{@alter_apps_scopes} TYPE varchar(255)[] USING string_to_array(scopes, ',')::varchar(255)[];" - execute "#{@alter_apps_scopes} SET DEFAULT ARRAY[]::character varying[];" - execute "#{@alter_apps_scopes} SET NOT NULL;" + execute( + "#{@alter_apps_scopes} TYPE varchar(255)[] USING string_to_array(scopes, ',')::varchar(255)[];" + ) + + execute("#{@alter_apps_scopes} SET DEFAULT ARRAY[]::character varying[];") + execute("#{@alter_apps_scopes} SET NOT NULL;") end def down do - execute "#{@alter_apps_scopes} DROP NOT NULL;" - execute "#{@alter_apps_scopes} DROP DEFAULT;" - execute "#{@alter_apps_scopes} TYPE varchar(255) USING array_to_string(scopes, ',')::varchar(255);" + execute("#{@alter_apps_scopes} DROP NOT NULL;") + execute("#{@alter_apps_scopes} DROP DEFAULT;") + + execute( + "#{@alter_apps_scopes} TYPE varchar(255) USING array_to_string(scopes, ',')::varchar(255);" + ) end end |