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/20230216153344_initMigratio...

180 lines
5.6 KiB

// <auto-generated />
using System;
using DataBase;
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("20230216153344_initMigration")]
partial class initMigration
{
/// <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<int>("recipient")
.HasColumnType("INTEGER");
b.Property<int>("sender")
.HasColumnType("INTEGER");
b.HasKey("chatId");
b.HasIndex("recipient");
b.HasIndex("sender");
b.ToTable("Chats");
});
modelBuilder.Entity("DataBase.Entity.Game", b =>
{
b.Property<int>("gameId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("durationGame")
.HasColumnType("INTEGER");
b.Property<int>("loser")
.HasColumnType("INTEGER");
b.Property<int>("nbMaxEchanges")
.HasColumnType("INTEGER");
b.Property<int>("winner")
.HasColumnType("INTEGER");
b.HasKey("gameId");
b.HasIndex("loser");
b.HasIndex("winner");
b.ToTable("Games");
});
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<int>("player")
.HasColumnType("INTEGER");
b.Property<TimeSpan>("timestamp")
.HasColumnType("TEXT");
b.HasKey("messageId");
b.HasIndex("chat");
b.HasIndex("player");
b.ToTable("Messages");
});
modelBuilder.Entity("DataBase.Entity.Player", b =>
{
b.Property<int>("playerId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
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");
});
modelBuilder.Entity("DataBase.Entity.Chat", b =>
{
b.HasOne("DataBase.Entity.Player", "PlayerRecipient")
.WithMany()
.HasForeignKey("recipient")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataBase.Entity.Player", "PlayerSender")
.WithMany()
.HasForeignKey("sender")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PlayerRecipient");
b.Navigation("PlayerSender");
});
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
}
}
}