|
|
@ -13,7 +13,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "GroupEntity",
|
|
|
|
name: "Groups",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
@ -24,7 +24,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_GroupEntity", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_Groups", x => x.Id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
@ -52,7 +52,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "VocabularyEntity",
|
|
|
|
name: "Vocabularys",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
word = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
word = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
@ -60,9 +60,9 @@ namespace StubbedContextLib.Migrations
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_VocabularyEntity", x => x.word);
|
|
|
|
table.PrimaryKey("PK_Vocabularys", x => x.word);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_VocabularyEntity_Langues_LangueName",
|
|
|
|
name: "FK_Vocabularys_Langues_LangueName",
|
|
|
|
column: x => x.LangueName,
|
|
|
|
column: x => x.LangueName,
|
|
|
|
principalTable: "Langues",
|
|
|
|
principalTable: "Langues",
|
|
|
|
principalColumn: "name",
|
|
|
|
principalColumn: "name",
|
|
|
@ -89,9 +89,9 @@ namespace StubbedContextLib.Migrations
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_Users", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_Users", x => x.Id);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_Users_GroupEntity_GroupId",
|
|
|
|
name: "FK_Users_Groups_GroupId",
|
|
|
|
column: x => x.GroupId,
|
|
|
|
column: x => x.GroupId,
|
|
|
|
principalTable: "GroupEntity",
|
|
|
|
principalTable: "Groups",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
@ -103,7 +103,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "VocabularyListEntity",
|
|
|
|
name: "VocabularyLists",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
@ -114,9 +114,9 @@ namespace StubbedContextLib.Migrations
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_VocabularyListEntity", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_VocabularyLists", x => x.Id);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_VocabularyListEntity_Users_UserId",
|
|
|
|
name: "FK_VocabularyLists_Users_UserId",
|
|
|
|
column: x => x.UserId,
|
|
|
|
column: x => x.UserId,
|
|
|
|
principalTable: "Users",
|
|
|
|
principalTable: "Users",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
@ -134,21 +134,21 @@ namespace StubbedContextLib.Migrations
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_GroupEntityVocabularyListEntity", x => new { x.GroupVocabularyListId, x.VocsGroupsId });
|
|
|
|
table.PrimaryKey("PK_GroupEntityVocabularyListEntity", x => new { x.GroupVocabularyListId, x.VocsGroupsId });
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_GroupEntityVocabularyListEntity_GroupEntity_VocsGroupsId",
|
|
|
|
name: "FK_GroupEntityVocabularyListEntity_Groups_VocsGroupsId",
|
|
|
|
column: x => x.VocsGroupsId,
|
|
|
|
column: x => x.VocsGroupsId,
|
|
|
|
principalTable: "GroupEntity",
|
|
|
|
principalTable: "Groups",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_GroupEntityVocabularyListEntity_VocabularyListEntity_GroupVocabularyListId",
|
|
|
|
name: "FK_GroupEntityVocabularyListEntity_VocabularyLists_GroupVocabularyListId",
|
|
|
|
column: x => x.GroupVocabularyListId,
|
|
|
|
column: x => x.GroupVocabularyListId,
|
|
|
|
principalTable: "VocabularyListEntity",
|
|
|
|
principalTable: "VocabularyLists",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "TranslateEntity",
|
|
|
|
name: "Translates",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
@ -158,11 +158,11 @@ namespace StubbedContextLib.Migrations
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_TranslateEntity", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_Translates", x => x.Id);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_TranslateEntity_VocabularyListEntity_VocabularyListVocId",
|
|
|
|
name: "FK_Translates_VocabularyLists_VocabularyListVocId",
|
|
|
|
column: x => x.VocabularyListVocId,
|
|
|
|
column: x => x.VocabularyListVocId,
|
|
|
|
principalTable: "VocabularyListEntity",
|
|
|
|
principalTable: "VocabularyLists",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -178,21 +178,21 @@ namespace StubbedContextLib.Migrations
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_TranslateEntityVocabularyEntity", x => new { x.TransVocword, x.VoctranslationsId });
|
|
|
|
table.PrimaryKey("PK_TranslateEntityVocabularyEntity", x => new { x.TransVocword, x.VoctranslationsId });
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_TranslateEntityVocabularyEntity_TranslateEntity_VoctranslationsId",
|
|
|
|
name: "FK_TranslateEntityVocabularyEntity_Translates_VoctranslationsId",
|
|
|
|
column: x => x.VoctranslationsId,
|
|
|
|
column: x => x.VoctranslationsId,
|
|
|
|
principalTable: "TranslateEntity",
|
|
|
|
principalTable: "Translates",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_TranslateEntityVocabularyEntity_VocabularyEntity_TransVocword",
|
|
|
|
name: "FK_TranslateEntityVocabularyEntity_Vocabularys_TransVocword",
|
|
|
|
column: x => x.TransVocword,
|
|
|
|
column: x => x.TransVocword,
|
|
|
|
principalTable: "VocabularyEntity",
|
|
|
|
principalTable: "Vocabularys",
|
|
|
|
principalColumn: "word",
|
|
|
|
principalColumn: "word",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
table: "GroupEntity",
|
|
|
|
table: "Groups",
|
|
|
|
columns: new[] { "Id", "Num", "sector", "year" },
|
|
|
|
columns: new[] { "Id", "Num", "sector", "year" },
|
|
|
|
values: new object[] { 1L, 1, "informatics", 1 });
|
|
|
|
values: new object[] { 1L, 1, "informatics", 1 });
|
|
|
|
|
|
|
|
|
|
|
@ -226,17 +226,17 @@ namespace StubbedContextLib.Migrations
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
table: "VocabularyEntity",
|
|
|
|
table: "Vocabularys",
|
|
|
|
columns: new[] { "word", "LangueName" },
|
|
|
|
columns: new[] { "word", "LangueName" },
|
|
|
|
values: new object[] { "Bonjour", "French" });
|
|
|
|
values: new object[] { "Bonjour", "French" });
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
table: "VocabularyListEntity",
|
|
|
|
table: "VocabularyLists",
|
|
|
|
columns: new[] { "Id", "Image", "Name", "UserId" },
|
|
|
|
columns: new[] { "Id", "Image", "Name", "UserId" },
|
|
|
|
values: new object[] { 1L, "image1", "Liste1", 1L });
|
|
|
|
values: new object[] { 1L, "image1", "Liste1", 1L });
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
table: "TranslateEntity",
|
|
|
|
table: "Translates",
|
|
|
|
columns: new[] { "Id", "VocabularyListVocId", "WordsId" },
|
|
|
|
columns: new[] { "Id", "VocabularyListVocId", "WordsId" },
|
|
|
|
values: new object[] { 1L, 1L, "1" });
|
|
|
|
values: new object[] { 1L, 1L, "1" });
|
|
|
|
|
|
|
|
|
|
|
@ -245,16 +245,16 @@ namespace StubbedContextLib.Migrations
|
|
|
|
table: "GroupEntityVocabularyListEntity",
|
|
|
|
table: "GroupEntityVocabularyListEntity",
|
|
|
|
column: "VocsGroupsId");
|
|
|
|
column: "VocsGroupsId");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
|
|
|
name: "IX_TranslateEntity_VocabularyListVocId",
|
|
|
|
|
|
|
|
table: "TranslateEntity",
|
|
|
|
|
|
|
|
column: "VocabularyListVocId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_TranslateEntityVocabularyEntity_VoctranslationsId",
|
|
|
|
name: "IX_TranslateEntityVocabularyEntity_VoctranslationsId",
|
|
|
|
table: "TranslateEntityVocabularyEntity",
|
|
|
|
table: "TranslateEntityVocabularyEntity",
|
|
|
|
column: "VoctranslationsId");
|
|
|
|
column: "VoctranslationsId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
|
|
|
name: "IX_Translates_VocabularyListVocId",
|
|
|
|
|
|
|
|
table: "Translates",
|
|
|
|
|
|
|
|
column: "VocabularyListVocId");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_Users_GroupId",
|
|
|
|
name: "IX_Users_GroupId",
|
|
|
|
table: "Users",
|
|
|
|
table: "Users",
|
|
|
@ -266,14 +266,14 @@ namespace StubbedContextLib.Migrations
|
|
|
|
column: "RoleId");
|
|
|
|
column: "RoleId");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_VocabularyEntity_LangueName",
|
|
|
|
name: "IX_VocabularyLists_UserId",
|
|
|
|
table: "VocabularyEntity",
|
|
|
|
table: "VocabularyLists",
|
|
|
|
column: "LangueName");
|
|
|
|
column: "UserId");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_VocabularyListEntity_UserId",
|
|
|
|
name: "IX_Vocabularys_LangueName",
|
|
|
|
table: "VocabularyListEntity",
|
|
|
|
table: "Vocabularys",
|
|
|
|
column: "UserId");
|
|
|
|
column: "LangueName");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
/// <inheritdoc />
|
|
|
@ -286,13 +286,13 @@ namespace StubbedContextLib.Migrations
|
|
|
|
name: "TranslateEntityVocabularyEntity");
|
|
|
|
name: "TranslateEntityVocabularyEntity");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "TranslateEntity");
|
|
|
|
name: "Translates");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "VocabularyEntity");
|
|
|
|
name: "Vocabularys");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "VocabularyListEntity");
|
|
|
|
name: "VocabularyLists");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "Langues");
|
|
|
|
name: "Langues");
|
|
|
@ -301,7 +301,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
name: "Users");
|
|
|
|
name: "Users");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "GroupEntity");
|
|
|
|
name: "Groups");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "Roles");
|
|
|
|
name: "Roles");
|