|
|
|
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
namespace StubbedContextLib.Migrations
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class migrationTest1 : Migration
|
|
|
|
|
public partial class pm_api : Migration
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
@ -37,7 +37,8 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
AnswerB = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
|
|
|
AnswerC = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
|
|
|
AnswerD = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
|
|
|
CorrectAnswer = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false)
|
|
|
|
|
CorrectAnswer = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false),
|
|
|
|
|
IsValid = table.Column<bool>(type: "bit", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
@ -147,6 +148,25 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "admins",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
IdUsers = table.Column<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
|
|
|
UserId = table.Column<int>(type: "int", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_admins", x => x.IdUsers);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_admins_users_UserId",
|
|
|
|
|
column: x => x.UserId,
|
|
|
|
|
principalTable: "users",
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "quotes",
|
|
|
|
|
columns: table => new
|
|
|
|
@ -210,23 +230,6 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "dailyquotes",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
IdQuote = table.Column<int>(type: "int", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_dailyquotes", x => x.IdQuote);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_dailyquotes_quotes_IdQuote",
|
|
|
|
|
column: x => x.IdQuote,
|
|
|
|
|
principalTable: "quotes",
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "favorites",
|
|
|
|
|
columns: table => new
|
|
|
|
@ -268,19 +271,19 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "question",
|
|
|
|
|
columns: new[] { "Id", "AnswerA", "AnswerB", "AnswerC", "AnswerD", "CorrectAnswer", "Text" },
|
|
|
|
|
columns: new[] { "Id", "AnswerA", "AnswerB", "AnswerC", "AnswerD", "CorrectAnswer", "IsValid", "Text" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ 1, "Gimli", "Aragorn", "Frodon", "Gandalf", "B", "Qui est le leader de la Communauté de l'Anneau ?" },
|
|
|
|
|
{ 2, "Serdaigle", "Gryffondor", "Serpentard", "Poufsouffle", "B", "Dans quelle maison Harry Potter est-il ?" },
|
|
|
|
|
{ 3, "Saroumane", "Sauron", "Gollum", "Gothmog", "B", "Qui est le Seigneur des Ténèbres dans la saga Le Seigneur des Anneaux ?" },
|
|
|
|
|
{ 4, "Han Solo", "Princesse Leia", "Chewbacca", "R2-D2", "A", "Dans le film Star Wars : Episode IV, qui sauve Luke Skywalker de l'Étoile de la Mort ?" },
|
|
|
|
|
{ 5, "Reine Jadis", "Aslan", "Edmund", "Lucy", "B", "Qui est le souverain de Narnia dans Le Lion, la Sorcière Blanche et l'Armoire Magique ?" },
|
|
|
|
|
{ 6, "Smaug", "Falkor", "Norbert", "Shenron", "A", "Quel est le nom du dragon dans Le Hobbit ?" },
|
|
|
|
|
{ 7, "Bella Swan", "Edward Cullen", "Jacob Black", "Victoria", "A", "Qui est la première personne à être mordue par un vampire dans Twilight ?" },
|
|
|
|
|
{ 8, "Obi-Wan Kenobi", "Yoda", "Han Solo", "Luke Skywalker", "A", "Quel personnage dit Que la Force soit avec toi dans Star Wars ?" },
|
|
|
|
|
{ 9, "Dr. Ellie Sattler", "Alan Grant", "John Hammond", "Dennis Nedry", "B", "Dans Jurassic Park, quel est le nom du paléontologue sur l'île ?" },
|
|
|
|
|
{ 10, "Cersei Lannister", "Arya Stark", "Daenerys Targaryen", "Sansa Stark", "C", "Dans Game of Thrones, qui est surnommée la Mère des Dragons ?" }
|
|
|
|
|
{ 1, "Gimli", "Aragorn", "Frodon", "Gandalf", "B", true, "Qui est le leader de la Communauté de l'Anneau ?" },
|
|
|
|
|
{ 2, "Serdaigle", "Gryffondor", "Serpentard", "Poufsouffle", "B", false, "Dans quelle maison Harry Potter est-il ?" },
|
|
|
|
|
{ 3, "Saroumane", "Sauron", "Gollum", "Gothmog", "B", true, "Qui est le Seigneur des Ténèbres dans la saga Le Seigneur des Anneaux ?" },
|
|
|
|
|
{ 4, "Han Solo", "Princesse Leia", "Chewbacca", "R2-D2", "A", true, "Dans le film Star Wars : Episode IV, qui sauve Luke Skywalker de l'Étoile de la Mort ?" },
|
|
|
|
|
{ 5, "Reine Jadis", "Aslan", "Edmund", "Lucy", "B", true, "Qui est le souverain de Narnia dans Le Lion, la Sorcière Blanche et l'Armoire Magique ?" },
|
|
|
|
|
{ 6, "Smaug", "Falkor", "Norbert", "Shenron", "A", true, "Quel est le nom du dragon dans Le Hobbit ?" },
|
|
|
|
|
{ 7, "Bella Swan", "Edward Cullen", "Jacob Black", "Victoria", "A", true, "Qui est la première personne à être mordue par un vampire dans Twilight ?" },
|
|
|
|
|
{ 8, "Obi-Wan Kenobi", "Yoda", "Han Solo", "Luke Skywalker", "A", true, "Quel personnage dit Que la Force soit avec toi dans Star Wars ?" },
|
|
|
|
|
{ 9, "Dr. Ellie Sattler", "Alan Grant", "John Hammond", "Dennis Nedry", "B", true, "Dans Jurassic Park, quel est le nom du paléontologue sur l'île ?" },
|
|
|
|
|
{ 10, "Cersei Lannister", "Arya Stark", "Daenerys Targaryen", "Sansa Stark", "C", true, "Dans Game of Thrones, qui est surnommée la Mère des Dragons ?" }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
@ -369,7 +372,7 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
{ 7, "Je suis la dernière Targaryen. Je suis la reine des dragons", 7, 3, 1, true, 1, 11025 },
|
|
|
|
|
{ 8, "Je ne suis pas prêt à affronter ça. C'est trop pour moi.", 8, 5, 1, true, 1, 11025 },
|
|
|
|
|
{ 9, "Aidez-moi, Obi-Wan Kenobi, vous êtes mon seul espoir.", 9, 5, 1, true, 1, 11025 },
|
|
|
|
|
{ 10, "La quoi ?", 10, 4, 1, true, 1, 11025 }
|
|
|
|
|
{ 10, "La quoi ?", 10, 4, 1, false, 1, 11025 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
@ -381,15 +384,6 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
{ 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "dailyquotes",
|
|
|
|
|
column: "IdQuote",
|
|
|
|
|
values: new object[]
|
|
|
|
|
{
|
|
|
|
|
1,
|
|
|
|
|
5
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "favorites",
|
|
|
|
|
columns: new[] { "IdQuote", "IdUsers" },
|
|
|
|
@ -406,6 +400,11 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
{ 10, 5 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_admins_UserId",
|
|
|
|
|
table: "admins",
|
|
|
|
|
column: "UserId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_characters_IdImage",
|
|
|
|
|
table: "characters",
|
|
|
|
@ -456,10 +455,10 @@ namespace StubbedContextLib.Migrations
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "comments");
|
|
|
|
|
name: "admins");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "dailyquotes");
|
|
|
|
|
name: "comments");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "favorites");
|