1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.ChangeAppsScopesToVarcharArray do
8 @alter_apps_scopes "ALTER TABLE apps ALTER COLUMN scopes"
12 "#{@alter_apps_scopes} TYPE varchar(255)[] USING string_to_array(scopes, ',')::varchar(255)[];"
15 execute("#{@alter_apps_scopes} SET DEFAULT ARRAY[]::character varying[];")
16 execute("#{@alter_apps_scopes} SET NOT NULL;")
20 execute("#{@alter_apps_scopes} DROP NOT NULL;")
21 execute("#{@alter_apps_scopes} DROP DEFAULT;")
24 "#{@alter_apps_scopes} TYPE varchar(255) USING array_to_string(scopes, ',')::varchar(255);"