I am using visual studio, EF Core I have for example Migration files
for example 20210314142045_RemoveCitizenShip3.cs as
using Microsoft.EntityFrameworkCore.Migrations;
namespace CertificateSystem.DB.DB.Migrations
{
public partial class RemoveCitizenShip3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CitizenShip",
schema: "CertificateSystem",
table: "CommercialEntity");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CitizenShip",
schema: "CertificateSystem",
table: "CommercialEntity",
nullable: true);
}
}
}
I want to take my project and publish it to production I understand that Migrations Is not a good way to work with on a production I think the best way to update my database it is to make a Migration on the developing version and create a SQL out of it and execute the SQL on the production
My problem is how do I create a SQL file from a Migration file?
I have read that https://stackoverflow.com/questions/49552550/get-sql-file-for-specific-migration-in-entity-framework-6-c-sharp
And I saw that Script-Migration -From X -to Y do some work but If I want to do it on specific file? How can I do it?
-to RemoveCitizenShip3), or from that file to the latest migration(-from RemoveCitizenShip3)?