Invoking Schema.CreateSchema() using the SQL Server event store implementation results in the following warning:
Warning! The maximum key length for a nonclustered index is 1700 bytes. The index 'UQ_StreamName' has maximum length of 2000 bytes. For some combination of large values, the insert/update operation will fail.
To Reproduce
Note that the message is only a warning, rather than an error, so you'll never see it unless there is something else that raises an error at the same time.
First, create a schema the normal way:
var schema = new Schema("MySchema");
await schema.CreateSchema(getConnection);
Next, delete all of the newly created stuff, except for the __schema__.StreamMessage type:
drop procedure MySchema.append_events
go
drop procedure MySchema.check_stream
go
drop procedure MySchema.read_all_forwards
go
drop procedure MySchema.read_stream_forwards
go
drop procedure MySchema.read_stream_sub
go
drop table MySchema.Checkpoints
go
drop table MySchema.Messages
go
drop table MySchema.Streams
go
Finally, recreate the schema:
var schema = new Schema("MySchema");
await schema.CreateSchema(getConnection);
This time, you'll get an error (because the __schema__.StreamMessage type already exists — see #272), and you'll also see the warning.
Expected behavior
The warning should not occur. The obvious fix is to shorten the max length of the StreamName column to NVARCHAR(850), which seems plenty long, but I don't know if doing that might cause problems elsewhere.
Desktop (please complete the following information):
OS: Windows 10
SQL Server: 15.0.2101.7 (note that earlier versions have an even shorter max length — 900 bytes)
Describe the bug
Invoking
Schema.CreateSchema()
using the SQL Server event store implementation results in the following warning:To Reproduce
Note that the message is only a warning, rather than an error, so you'll never see it unless there is something else that raises an error at the same time.
First, create a schema the normal way:
Next, delete all of the newly created stuff, except for the
__schema__.StreamMessage
type:Finally, recreate the schema:
This time, you'll get an error (because the
__schema__.StreamMessage
type already exists — see #272), and you'll also see the warning.Expected behavior
The warning should not occur. The obvious fix is to shorten the max length of the
StreamName
column toNVARCHAR(850)
, which seems plenty long, but I don't know if doing that might cause problems elsewhere.Desktop (please complete the following information):