eventuous icon indicating copy to clipboard operation
eventuous copied to clipboard

Error at schema initialization (PostgresException: '42704: type public.stream_message[] does not exist)

Open mjamro opened this issue 1 year ago • 1 comments

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

mjamro avatar Feb 16 '24 15:02 mjamro

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

fbjerggaard avatar Feb 19 '24 20:02 fbjerggaard