|
|
@ -27,7 +27,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "TableBook",
|
|
|
|
name: "BooksSet",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
@ -40,21 +40,16 @@ namespace StubbedContextLib.Migrations
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_TableBook", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_BooksSet", x => x.Id);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_TableBook_PersonSet_OwnerId",
|
|
|
|
name: "FK_BooksSet_PersonSet_OwnerId",
|
|
|
|
column: x => x.OwnerId,
|
|
|
|
column: x => x.OwnerId,
|
|
|
|
principalTable: "PersonSet",
|
|
|
|
principalTable: "PersonSet",
|
|
|
|
principalColumn: "Id");
|
|
|
|
principalColumn: "Id");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
table: "PersonSet",
|
|
|
|
table: "BooksSet",
|
|
|
|
columns: new[] { "Id", "FirstName", "LastName" },
|
|
|
|
|
|
|
|
values: new object[] { 1, "coco", "test" });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
|
|
|
table: "TableBook",
|
|
|
|
|
|
|
|
columns: new[] { "Id", "Author", "Isbn", "OwnerId", "PersonId", "Title" },
|
|
|
|
columns: new[] { "Id", "Author", "Isbn", "OwnerId", "PersonId", "Title" },
|
|
|
|
values: new object[,]
|
|
|
|
values: new object[,]
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -62,9 +57,14 @@ namespace StubbedContextLib.Migrations
|
|
|
|
{ 2L, "test2", "test2", null, 1, "test2" }
|
|
|
|
{ 2L, "test2", "test2", null, 1, "test2" }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
|
|
|
table: "PersonSet",
|
|
|
|
|
|
|
|
columns: new[] { "Id", "FirstName", "LastName" },
|
|
|
|
|
|
|
|
values: new object[] { 1, "coco", "test" });
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_TableBook_OwnerId",
|
|
|
|
name: "IX_BooksSet_OwnerId",
|
|
|
|
table: "TableBook",
|
|
|
|
table: "BooksSet",
|
|
|
|
column: "OwnerId");
|
|
|
|
column: "OwnerId");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -72,7 +72,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "TableBook");
|
|
|
|
name: "BooksSet");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "PersonSet");
|
|
|
|
name: "PersonSet");
|