-- NOTE: This file is auto generated by ./sql-generator

-- MoveRepository.getByEntity
select
  *
from
  "move_history"
where
  "entityId" = $1
  and "pathType" = $2

-- MoveRepository.delete
delete from "move_history"
where
  "id" = $1
returning
  *

-- MoveRepository.cleanMoveHistory
delete from "move_history"
where
  "move_history"."entityId" not in (
    select
      "id"
    from
      "assets"
    where
      "assets"."id" = "move_history"."entityId"
  )
  and "move_history"."pathType" = 'original'

-- MoveRepository.cleanMoveHistorySingle
delete from "move_history"
where
  "move_history"."pathType" = 'original'
  and "entityId" = $1
