@@ -1,4 +1,4 @@  | 
                                                    ||
| 1 | -<?php declare(strict_types=1);  | 
                                                        |
| 1 | +<?php declare(strict_types = 1);  | 
                                                        |
| 2 | 2 | |
| 3 | 3 | namespace SmoothPhp\LaravelAdapter\Console;  | 
                                                        
| 4 | 4 | |
@@ -55,10 +55,10 @@ discard block  | 
                                                    ||
| 55 | 55 | public function load($id) : DomainEventStream  | 
                                                        
| 56 | 56 |      { | 
                                                        
| 57 | 57 | $rows = $this->db->table($this->eventStoreTableName)  | 
                                                        
| 58 | - ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on'])  | 
                                                        |
| 59 | -                         ->where('uuid', $id) | 
                                                        |
| 60 | -                         ->orderBy('playhead', 'asc') | 
                                                        |
| 61 | - ->get();  | 
                                                        |
| 58 | + ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on'])  | 
                                                        |
| 59 | +                            ->where('uuid', $id) | 
                                                        |
| 60 | +                            ->orderBy('playhead', 'asc') | 
                                                        |
| 61 | + ->get();  | 
                                                        |
| 62 | 62 | $events = [];  | 
                                                        
| 63 | 63 | |
| 64 | 64 |          foreach ($rows as $row) { | 
                                                        
@@ -153,12 +153,12 @@ discard block  | 
                                                    ||
| 153 | 153 | $lastId = 0;  | 
                                                        
| 154 | 154 |          do { | 
                                                        
| 155 | 155 |              $rows = $this->db->table($this->db->raw("`{$this->eventStoreTableName}` FORCE INDEX (eventstore_type_index)")) | 
                                                        
| 156 | - ->select(['id', 'uuid', 'playhead', 'metadata', 'payload', 'recorded_on'])  | 
                                                        |
| 157 | -                             ->whereIn('type', $eventTypes) | 
                                                        |
| 158 | -                             ->where('id', '>', $lastId) | 
                                                        |
| 159 | - ->take($take)  | 
                                                        |
| 160 | -                             ->orderBy('id') | 
                                                        |
| 161 | - ->get();  | 
                                                        |
| 156 | + ->select(['id', 'uuid', 'playhead', 'metadata', 'payload', 'recorded_on'])  | 
                                                        |
| 157 | +                                ->whereIn('type', $eventTypes) | 
                                                        |
| 158 | +                                ->where('id', '>', $lastId) | 
                                                        |
| 159 | + ->take($take)  | 
                                                        |
| 160 | +                                ->orderBy('id') | 
                                                        |
| 161 | + ->get();  | 
                                                        |
| 162 | 162 | $events = [];  | 
                                                        
| 163 | 163 |              foreach ($rows as $row) { | 
                                                        
| 164 | 164 | $events[] = $this->deserializeEvent($row);  |