Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
This commit is contained in:
commit
44bfb491ea
60 changed files with 826 additions and 245 deletions
|
|
@ -3,7 +3,6 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
|
|||
import Ecto.Query
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Bookmark
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Repo
|
||||
|
||||
def up do
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateSafeJsonbSet do
|
||||
use Ecto.Migration
|
||||
alias Pleroma.User
|
||||
|
||||
def change do
|
||||
execute("""
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Pleroma.Repo.Migrations.UpdateObanJobsTable do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
Oban.Migrations.up(version: 8)
|
||||
end
|
||||
|
||||
def down do
|
||||
Oban.Migrations.down(version: 7)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue