sqliteef6migrations
sqliteef6migrations copied to clipboard
Add support for more data types when adding a new column with default value
When I tried to add a new column with a default value, the default value was not included in the SQL statement. For example,
public override void Up()
{
AddColumn("dbo.TestTable", "ExtraColumn", c => c.Int(nullable: false, defaultValue: 1));
}
The generated SQL would be "ALTER TABLE "TestTable" ADD COLUMN "ExtraColumn"int not null" If the table already has some data in it, there would be an error during migration: "Cannot add a NOT NULL column with default value NULL"
This pull request adds support for more data types for the default value other than DateTime.