Closed patrickkusebauch closed 2 years ago
Can you try to change the function here? https://github.com/prooph/pdo-event-store/blob/master/src/Util/PostgresHelper.php#L44
@prolic I do not understand what is the purpose of that function in the context of this package, as to me, from the bug description, it seems as this function should no be there at all.
What schema are you using in postgres? I would assume if you never used this value it should be default to public
? At least as a workaround, try this public.patrick.kusebauch
instead of this patrick.kusebauch
. In postgres schema and table name are separated by a dot, hence we extract the schema name from the string as everything that is coming before the first dot.
@prolic sorry for the delay. I use the Postgres:12 (git) docker container, with no extra settings. For table definitions, I use the provided SQL.
@patrickkusebauch Can you try to set up a failing test case? You can add it here: https://github.com/prooph/pdo-event-store/blob/master/tests/PostgresEventStoreTest.php#L41
@codeliner I have created a pull request. For the stream name, the heuristic is AggregateRootClass
-AggregateId
. This would represent one stream per aggregate strategy.
I was able to drill it down to this line: https://github.com/prooph/pdo-event-store/blob/8f8c3621a8dacd5fc9ee8299e42dc552188b0ea4/src/PersistenceStrategy/PostgresAggregateStreamStrategy.php#L104
Current behavior/ Steps to reproduce/issue:
.
in aggregateRootId (example:patrick.kusebauch
).PostgresAggregateStreamStrategy
_ff0a332cf5da03cc35df5dcceb1b87ba21af8c95
(41 chars)Full\Path\To\The\Class\Aggregates\User-patrick._ff0a332cf5da03cc35df5dcceb1b87ba21af8c95
event_streams
table's columnstream_name
ischar(41)
Prooph\EventStore\Pdo\Exception\RuntimeException('Error 22001. Maybe the event streams table is not setup? Error-Info: ERROR: value too long for type character(41)')
Expected behavior
Able to create an aggregate with an ID that contains
.