eventuous
eventuous copied to clipboard
Error at schema initialization (PostgresException: '42704: type public.stream_message[] does not exist)
Describe the bug
Schema classes for Postgres, Redis and SqlServer do this:
var names = Assembly.GetManifestResourceNames().Where(x => x.EndsWith(".sql")).OrderBy(x => x);
When you have invariant globalization enabled in csproj
<PropertyGroup>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
it breaks initialization of Eventous as the order of scripts after OrdeBy is different and _Schema.sql lands at the end.
"AppendEvents.sql",
"CheckStream.sql",
"ReadAllForwards.sql",
"ReadStreamForwards.sql",
"ReadStreamSub.sql"
"_Schema.sql",
This results in Npgsql.PostgresException: '42704: type public.stream_message[] does not exist' exception.
To Reproduce
Set <InvariantGlobalization>true</InvariantGlobalization> in csproj. Run the booking demo app.
Expected behavior
Initialization works
Would probably be a pretty easy fix by prefixing the files with a number for sorting. This would probably be a good idea to do for sqlserver as well