public function deleteUrlAliasesWithoutLocation(): int
    {
        $dbPlatform = $this->connection->getDatabasePlatform();

        $subquery = $this->connection->createQueryBuilder();
        $subquery
            ->select('node_id')
            ->from('ezcontentobject_tree', 't')
            ->where(
                $subquery->expr()->eq(
                    't.node_id',
                    sprintf(
                        'CAST(%s as %s)',
                        $dbPlatform->getSubstringExpression($this->table . '.action', 8),
                        $this->getIntegerType($dbPlatform)
                    )
                )
            )
        ;

        $deleteQuery = $this->connection->createQueryBuilder();
        $deleteQuery
            ->delete($this->table)
            ->where(
                $deleteQuery->expr()->eq(
                    'action_type',
                    $deleteQuery->createPositionalParameter('eznode')
                )
            )
            ->andWhere(
                sprintf('NOT EXISTS (%s)', $subquery->getSQL())
            )
        ;

        return $deleteQuery->execute();
    }