You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
leap-hit-server/code/server/DataBase/Migrations/20230316103854_mymigrations...

190 lines
6.0 KiB

// <auto-generated />
using System;
using DataBase.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DataBase.Migrations
{
[DbContext(typeof(PongDbContext))]
[Migration("20230316103854_mymigrations")]
partial class mymigrations
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.3");
modelBuilder.Entity("DataBase.Entity.Chat", b =>
{
b.Property<int>("chatId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("player1")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("player2")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("chatId");
b.HasIndex("player1");
b.HasIndex("player2");
b.ToTable("Chats", (string)null);
});
modelBuilder.Entity("DataBase.Entity.Game", b =>
{
b.Property<int>("gameId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("durationGame")
.HasColumnType("INTEGER");
b.Property<string>("loser")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("nbMaxEchanges")
.HasColumnType("INTEGER");
b.Property<int>("scoreLoser")
.HasColumnType("INTEGER");
b.Property<int>("scoreWinner")
.HasColumnType("INTEGER");
b.Property<string>("winner")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("gameId");
b.HasIndex("loser");
b.HasIndex("winner");
b.ToTable("Games", (string)null);
});
modelBuilder.Entity("DataBase.Entity.Message", b =>
{
b.Property<int>("messageId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("chat")
.HasColumnType("INTEGER");
b.Property<string>("message")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("player")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime>("timestamp")
.HasColumnType("TEXT");
b.HasKey("messageId");
b.HasIndex("chat");
b.HasIndex("player");
b.ToTable("Messages", (string)null);
});
modelBuilder.Entity("DataBase.Entity.Player", b =>
{
b.Property<string>("playerId")
.HasColumnType("TEXT");
b.Property<string>("name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("nbBallTouchTotal")
.HasColumnType("INTEGER");
b.Property<int>("timePlayed")
.HasColumnType("INTEGER");
b.HasKey("playerId");
b.ToTable("Players", (string)null);
});
modelBuilder.Entity("DataBase.Entity.Chat", b =>
{
b.HasOne("DataBase.Entity.Player", "PlayerId1")
.WithMany()
.HasForeignKey("player1")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataBase.Entity.Player", "PlayerId2")
.WithMany()
.HasForeignKey("player2")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PlayerId1");
b.Navigation("PlayerId2");
});
modelBuilder.Entity("DataBase.Entity.Game", b =>
{
b.HasOne("DataBase.Entity.Player", "PlayerLoser")
.WithMany()
.HasForeignKey("loser")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataBase.Entity.Player", "PlayerWinner")
.WithMany()
.HasForeignKey("winner")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PlayerLoser");
b.Navigation("PlayerWinner");
});
modelBuilder.Entity("DataBase.Entity.Message", b =>
{
b.HasOne("DataBase.Entity.Chat", "ChatId")
.WithMany()
.HasForeignKey("chat")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataBase.Entity.Player", "PlayerId")
.WithMany()
.HasForeignKey("player")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ChatId");
b.Navigation("PlayerId");
});
#pragma warning restore 612, 618
}
}
}