Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

24 строки
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