diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-10-21 14:19:15 +0700 |
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-10-21 14:19:15 +0700 |
| commit | 4ea1a61b008c932bc83fcd6cd07bb7f4c251204a (patch) | |
| tree | c763bd3a2a21ee3e40384ee323076bbb577b7ccb /priv/repo/migrations/20190213185503_change_apps_scopes_to_varchar_array.exs | |
| parent | 8ad015ef64e0d2a4cd9f2979ff08d28be3a635e5 (diff) | |
| parent | 62e3d76a450c1b34ba8d0c88a184ec861ed90f29 (diff) | |
| download | pleroma-4ea1a61b008c932bc83fcd6cd07bb7f4c251204a.tar.gz pleroma-4ea1a61b008c932bc83fcd6cd07bb7f4c251204a.zip | |
Merge branch 'develop' into refactor/following-relationships
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 |
