Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocked-domains-users
# Conflicts: # lib/pleroma/following_relationship.exstable
commit
f00ff20768
@ -0,0 +1,29 @@
|
||||
defmodule Pleroma.Repo.Migrations.ChangeFollowingRelationshipsStateToInteger do
|
||||
use Ecto.Migration
|
||||
|
||||
@alter_following_relationship_state "ALTER TABLE following_relationships ALTER COLUMN state"
|
||||
|
||||
def up do
|
||||
execute("""
|
||||
#{@alter_following_relationship_state} TYPE integer USING
|
||||
CASE
|
||||
WHEN state = 'pending' THEN 1
|
||||
WHEN state = 'accept' THEN 2
|
||||
WHEN state = 'reject' THEN 3
|
||||
ELSE 0
|
||||
END;
|
||||
""")
|
||||
end
|
||||
|
||||
def down do
|
||||
execute("""
|
||||
#{@alter_following_relationship_state} TYPE varchar(255) USING
|
||||
CASE
|
||||
WHEN state = 1 THEN 'pending'
|
||||
WHEN state = 2 THEN 'accept'
|
||||
WHEN state = 3 THEN 'reject'
|
||||
ELSE ''
|
||||
END;
|
||||
""")
|
||||
end
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
defmodule Pleroma.Repo.Migrations.AddFollowingRelationshipsFollowingIdIndex do
|
||||
use Ecto.Migration
|
||||
|
||||
# [:follower_index] index is useless because of [:follower_id, :following_id] index
|
||||
# [:following_id] index makes sense because of user's followers-targeted queries
|
||||
def change do
|
||||
drop_if_exists(index(:following_relationships, [:follower_id]))
|
||||
|
||||
create_if_not_exists(index(:following_relationships, [:following_id]))
|
||||
end
|
||||
end
|
Loading…
Reference in new issue