Ncqrs.Eventing.Storage.SQL.TableCreationScript.sql

45 views
Skip to first unread message

theBoringCoder

unread,
May 8, 2013, 1:38:14 PM5/8/13
to ncqr...@googlegroups.com
I have a few questions about the table structure, and while I have the gut-feeling that things were done for performance reasons...I'm going to ask anyhow--just so I don't assume.

With regards to the "Events" table: why is there not a unique constraint on Events.Id?  Like this:

		ALTER TABLE [Events] ADD CONSTRAINT UQ_Events_Id UNIQUE ([Id])

With regards to the EventSources table: why is the Id field not marked as the primary key?

With regards to the Events and Snapshots tables: why are there no foreign-key relationships between them and the EventSources table?

With regards to the PipelineState table: why is there no foreign-key relationship from the "LastProcessedEventId" field back to the Events table's Id field?

Like I said, I'm pretty sure these were left out for performance reasons, but I want to make sure my assumption is correct before dismissing the question from my mind.

thanks,

Tom
theBoringCoder
Reply all
Reply to author
Forward
0 new messages