Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

24 řádky
667B

  1. defmodule Pleroma.Repo.Migrations.ChangeAppsScopesToVarcharArray do
  2. use Ecto.Migration
  3. @alter_apps_scopes "ALTER TABLE apps ALTER COLUMN scopes"
  4. def up do
  5. execute(
  6. "#{@alter_apps_scopes} TYPE varchar(255)[] USING string_to_array(scopes, ',')::varchar(255)[];"
  7. )
  8. execute("#{@alter_apps_scopes} SET DEFAULT ARRAY[]::character varying[];")
  9. execute("#{@alter_apps_scopes} SET NOT NULL;")
  10. end
  11. def down do
  12. execute("#{@alter_apps_scopes} DROP NOT NULL;")
  13. execute("#{@alter_apps_scopes} DROP DEFAULT;")
  14. execute(
  15. "#{@alter_apps_scopes} TYPE varchar(255) USING array_to_string(scopes, ',')::varchar(255);"
  16. )
  17. end
  18. end