Skip to content

Instantly share code, notes, and snippets.

@joewashington75
Created May 27, 2020 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewashington75/d0fd16d8ee793fdb2e57a120b6b05b76 to your computer and use it in GitHub Desktop.
Save joewashington75/d0fd16d8ee793fdb2e57a120b6b05b76 to your computer and use it in GitHub Desktop.
using Microsoft.EntityFrameworkCore.Migrations;
namespace EFCoreSeparateProject.Migrations.Migrations
{
public partial class InitialMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "EfCore");
migrationBuilder.CreateTable(
name: "Customers",
schema: "EfCore",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FirstName = table.Column<string>(nullable: true),
LastName = table.Column<string>(nullable: true),
AddressLine1 = table.Column<string>(nullable: true),
AddressLine2 = table.Column<string>(nullable: true),
Postcode = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Customers", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Customers",
schema: "EfCore");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment