I am playing around with EF Core 6.0.0-rc.2.21480.5.
I added an empty migration, just ran the command Add-Migration ShouldBeEmpty without any change to the model.
Checking with such empty migrations is necessary to ensure migrations pulled from other developers work are merged correctly.
As expected the up steps and down steps are empty.
public partial class ShouldBeEmpty : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{ }
protected override void Down(MigrationBuilder migrationBuilder)
{ }
}
Also the Model Snapshot file has not changed.
Now I revert back with the remove migration command Remove-Migration. The newly created file ShouldBeEmpty is removed as a part of rolling back as expected. But as I notice the Model Snapshot file, its checked out, and when I take a diff, I see this.

Note the following.
b.ToTable("Sita", (string)null);
So its not exactly identical as I roll that back. (string)null is being passed additionally to the ToTable method call. It does not seem to pose any problem but just want to know am I missing something here?
I noticed my csproj file that nullable is enabled. I disabled that and tried, but this did not make any difference.
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
This is not a solution, but I found this string(null) issue in efcore's github:
https://github.com/dotnet/efcore/issues/26067
It was closed as not planned, as there are "no functional difference" [as a result of this change], so it seems that they would not bother doing anything about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With