|
|
|
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
namespace DataBase.Migrations
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class Migrations : Migration
|
|
|
|
|
public partial class mymigrations : Migration
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
@ -17,8 +17,7 @@ namespace DataBase.Migrations
|
|
|
|
|
name: "Players",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
playerId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
playerId = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
nbBallTouchTotal = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
timePlayed = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
@ -34,8 +33,8 @@ namespace DataBase.Migrations
|
|
|
|
|
{
|
|
|
|
|
chatId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
player1 = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
player2 = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
player1 = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
player2 = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
@ -62,8 +61,8 @@ namespace DataBase.Migrations
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
durationGame = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
nbMaxEchanges = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
winner = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
loser = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
winner = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
loser = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
scoreWinner = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
scoreLoser = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
@ -92,7 +91,7 @@ namespace DataBase.Migrations
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
message = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
timestamp = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
|
|
|
player = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
player = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
chat = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
@ -117,27 +116,27 @@ namespace DataBase.Migrations
|
|
|
|
|
columns: new[] { "playerId", "name", "nbBallTouchTotal", "timePlayed" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ 1, "Rami", 20, 120 },
|
|
|
|
|
{ 2, "Hugo", 90, 250 }
|
|
|
|
|
{ "test", "Rami", 20, 120 },
|
|
|
|
|
{ "test2", "Hugo", 90, 250 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "Chats",
|
|
|
|
|
columns: new[] { "chatId", "player1", "player2" },
|
|
|
|
|
values: new object[] { 1, 1, 2 });
|
|
|
|
|
values: new object[] { 1, "test", "test2" });
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "Games",
|
|
|
|
|
columns: new[] { "gameId", "durationGame", "loser", "nbMaxEchanges", "scoreLoser", "scoreWinner", "winner" },
|
|
|
|
|
values: new object[] { 1, 65, 2, 5, 2, 6, 1 });
|
|
|
|
|
values: new object[] { 1, 65, "test2", 5, 2, 6, "test" });
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "Messages",
|
|
|
|
|
columns: new[] { "messageId", "chat", "message", "player", "timestamp" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ 1, 1, "Salut mon gars !", 1, new DateTime(2023, 2, 16, 17, 5, 12, 0, DateTimeKind.Unspecified) },
|
|
|
|
|
{ 2, 1, "Comment tu vas ?", 2, new DateTime(2023, 2, 16, 17, 12, 35, 0, DateTimeKind.Unspecified) }
|
|
|
|
|
{ 1, 1, "Salut mon gars !", "test", new DateTime(2023, 2, 16, 17, 5, 12, 0, DateTimeKind.Unspecified) },
|
|
|
|
|
{ 2, 1, "Comment tu vas ?", "test2", new DateTime(2023, 2, 16, 17, 12, 35, 0, DateTimeKind.Unspecified) }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|