Error Details:
SqliteException(787): while executing statement, FOREIGN KEY constraint failed, constraint failed (code 787)
  Causing statement: INSERT INTO "memory_asset_entity" ("asset_id", "memory_id") VALUES (?, ?) ON CONFLICT("asset_id", "memory_id") DO NOTHING, parameters: 9c3ea7a4-958c-4815-9207-9d7f5ed58484, 7db83893-2d95-4075-abca-6d81d864476f

The stack trace is this: 
package:sqlite3/src/implementation/exception.dart 87                               throwException
package:sqlite3/src/implementation/statement.dart 109                              StatementImplementation._execute
package:sqlite3/src/implementation/statement.dart 289                              StatementImplementation.executeWith
package:sqlite3/src/statement.dart 81                                              CommonPreparedStatement.execute
package:drift/src/sqlite3/database.dart 131                                        Sqlite3Delegate.runBatchSync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched.<fn>
dart:async/future.dart 315                                                         new Future.sync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched
package:drift/src/runtime/executor/helpers/engines.dart 128                        _BaseExecutor.runBatched.<fn>
package:drift/src/runtime/executor/helpers/engines.dart 62                         _BaseExecutor._synchronized
package:drift/src/runtime/executor/helpers/engines.dart 122                        _BaseExecutor.runBatched
package:drift/src/remote/server_impl.dart 170                                      ServerImplementation._runBatched
package:drift/src/remote/communication.dart 165                                    DriftCommunication.setRequestHandler.<fn>
===== asynchronous gap ===========================
package:drift/src/remote/communication.dart 113                                    DriftCommunication.request
package:drift/src/remote/client_impl.dart 84                                       _BaseExecutor.runBatched
package:drift/src/runtime/api/batch.dart 215                                       Batch._runWith
package:drift/src/runtime/api/batch.dart 199                                       Batch._commit
package:immich_mobile/infrastructure/repositories/sync_stream.repository.dart 408  SyncStreamRepository.updateMemoryAssetsV1
package:immich_mobile/domain/services/sync_stream.service.dart 67                  SyncStreamService._processBatch
package:immich_mobile/domain/services/sync_stream.service.dart 48                  SyncStreamService._handleEvents
package:immich_mobile/infrastructure/repositories/sync_api.repository.dart 110     SyncApiRepository.streamChanges
package:immich_mobile/domain/services/sync_stream.service.dart 30                  SyncStreamService.sync
package:immich_mobile/utils/isolate.dart 57                                        runInIsolateGentle.<fn>.<fn>
package:immich_mobile/utils/isolate.dart 36                                        runInIsolateGentle.<fn>
package:worker_manager/src/worker/worker_io.dart 106                               WorkerImpl._anotherIsolate.<fn>
```