Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33095647
20190213185503_change_apps_scopes_to_varchar_array.exs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
826 B
Referenced Files
None
Subscribers
None
20190213185503_change_apps_scopes_to_varchar_array.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Repo.Migrations.ChangeAppsScopesToVarcharArray
do
use
Ecto.Migration
@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;"
)
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);"
)
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Tue, Jan 20, 9:25 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
933694
Default Alt Text
20190213185503_change_apps_scopes_to_varchar_array.exs (826 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment