Custom SQL in migration does not run
18:16 15 Jun 2026
            migrationBuilder.AddColumn(
                name: "ExternalId",
                table: "VariableType",
                type: "int",
                nullable: true);

            migrationBuilder.Sql("UPDATE VariableType SET ExternalId = id_DescriptionType");

The migration adds the column, but all rows have a value of 0 in the ExternalId column. All rows have a unique, non-zero value for id_DescriptionType.

c# entity-framework entity-framework-migrations