1
Vote

When creating SchemeVersion DB table no default version is created

description

You cannot mark the very first version as the code tries to get the current SchemaVersion from the DB. When attempting to do so, if the changes table has no records, an exception is thrown.

Why not simply insert a 0.0.0 record into this table when called the service method "CreateSchemaLogTable()"?

To get around this, I simply called:
INSERT INTO [DBNAME].[dbo].[SchemaChanges]
       ([Major]
       ,[Minor]
       ,[Point]
       ,[ScriptName]
       ,[DateApplied])
 VALUES
       (0
       ,0
       ,0
       ,'Init'
       ,GETDATE())
GO

comments