Skip to content

Instantly share code, notes, and snippets.

@SafaElmali
Created May 3, 2019 22:10
Show Gist options
  • Save SafaElmali/aa1a97df0a31c3bf1d119dc78f1fe125 to your computer and use it in GitHub Desktop.
Save SafaElmali/aa1a97df0a31c3bf1d119dc78f1fe125 to your computer and use it in GitHub Desktop.
Migration file
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EFCore.Migrations
{
public partial class FirstMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PRODUCT",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
NAME = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PRODUCT", x => x.ID);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PRODUCT");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment