Fixed deduplicated files from orphan media being deleted as well
Happens when a file is uploaded, then orphaned, and a similar file is used somewhere. The CleanMedia job service didn't consider that case Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
10
lib/mobilizon/storage/custom_functions.ex
Normal file
10
lib/mobilizon/storage/custom_functions.ex
Normal file
@@ -0,0 +1,10 @@
|
||||
defmodule Mobilizon.Storage.CustomFunctions do
|
||||
@moduledoc """
|
||||
Helper module for custom PostgreSQL functions
|
||||
"""
|
||||
defmacro split_part(string, delimiter, position) do
|
||||
quote do
|
||||
fragment("split_part(?, ?, ?)", unquote(string), unquote(delimiter), unquote(position))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user