When there is a new NOT NULL column the migration script is generated as:
ALTER TABLE [dbo].[ExampleTable] ADD [ExampleColumn] [bit] NOT NULL
in real case scenarios, the table is probably not empty and the sql will probably fail.
We could add a setting option to generate the above line like this instead:
ALTER TABLE [dbo].[ExampleTable] ADD [ExampleColumn] [bit] NULL
GO
UPDATE [dbo].[ExampleTable] SET [ExampleColumn] = 0 <----- some default or something to let the user know it has to write manually
GO
ALTER TABLE [dbo].[ExampleTable] ALTER COLUMN [ExampleColumn] [bit] NOT NULL
GO
When there is a new NOT NULL column the migration script is generated as:
ALTER TABLE [dbo].[ExampleTable] ADD [ExampleColumn] [bit] NOT NULL
in real case scenarios, the table is probably not empty and the sql will probably fail.
We could add a setting option to generate the above line like this instead: