//
using System;
using Entity_Framework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Entity_Framework.Migrations
{
[DbContext(typeof(BDDContext))]
[Migration("20230322173709_test")]
partial class test
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.3");
modelBuilder.Entity("Entity_Framework.Entity.Circuits", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Circuits");
b.HasData(
new
{
Id = 1,
Name = "test_CIRCUIT"
});
});
modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("IdPiloteProprietaire")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("IdPiloteProprietaire")
.IsUnique();
b.HasIndex("Name")
.IsUnique();
b.ToTable("Ecuries");
});
modelBuilder.Entity("Entity_Framework.Entity.Images", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IdPilote")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("IdPilote")
.IsUnique();
b.ToTable("Images");
});
modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Email")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Password")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Pseudo")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Email")
.IsUnique();
b.HasIndex("Pseudo")
.IsUnique();
b.ToTable("Pilotes");
b.HasData(
new
{
Id = 1,
Email = "test@gmail.com",
Password = "7NcYcNGWMxapfjrDQIyYNa2M8PPBvHA1J8MCZVNPda4=",
Pseudo = "test_PILOTE"
});
});
modelBuilder.Entity("Entity_Framework.Entity.Points", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("A_Steer")
.HasColumnType("REAL");
b.Property("Distance")
.HasColumnType("REAL");
b.Property("G_Lat")
.HasColumnType("REAL");
b.Property("G_Lon")
.HasColumnType("REAL");
b.Property("IdTours")
.HasColumnType("INTEGER");
b.Property("Latitude")
.HasColumnType("REAL");
b.Property("Longitude")
.HasColumnType("REAL");
b.Property("NGearASCII")
.HasColumnType("REAL");
b.Property("P_BreakF")
.HasColumnType("REAL");
b.Property("R_Pedal")
.HasColumnType("REAL");
b.Property("Timer")
.HasColumnType("REAL");
b.Property("V_Car")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("IdTours");
b.ToTable("Points");
});
modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b =>
{
b.Property("IdPilote")
.HasColumnType("INTEGER");
b.Property("IdEcurie")
.HasColumnType("INTEGER");
b.Property("EcurieId")
.HasColumnType("INTEGER");
b.Property("Grade")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PiloteId")
.HasColumnType("INTEGER");
b.HasKey("IdPilote", "IdEcurie");
b.HasIndex("EcurieId");
b.HasIndex("PiloteId");
b.ToTable("RelationEcuriePilote");
});
modelBuilder.Entity("Entity_Framework.Entity.Sessions", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Date")
.HasColumnType("TEXT");
b.Property("IdCircuit")
.HasColumnType("INTEGER");
b.Property("IdPilote")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Type")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("IdCircuit");
b.HasIndex("IdPilote");
b.ToTable("Sessions");
});
modelBuilder.Entity("Entity_Framework.Entity.Tours", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("IdSession")
.HasColumnType("INTEGER");
b.Property("Numero")
.HasColumnType("INTEGER");
b.Property("Temps")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("IdSession");
b.ToTable("Tours");
});
modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b =>
{
b.HasOne("Entity_Framework.Entity.Pilotes", "PiloteProprietaire")
.WithOne("EcuriePropriétaire")
.HasForeignKey("Entity_Framework.Entity.Ecuries", "IdPiloteProprietaire")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PiloteProprietaire");
});
modelBuilder.Entity("Entity_Framework.Entity.Images", b =>
{
b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote")
.WithOne("Image")
.HasForeignKey("Entity_Framework.Entity.Images", "IdPilote")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Pilote");
});
modelBuilder.Entity("Entity_Framework.Entity.Points", b =>
{
b.HasOne("Entity_Framework.Entity.Tours", "Tours")
.WithMany("Points")
.HasForeignKey("IdTours")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tours");
});
modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b =>
{
b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie")
.WithMany("PilotesRelation")
.HasForeignKey("EcurieId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote")
.WithMany("Ecurie")
.HasForeignKey("PiloteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ecurie");
b.Navigation("Pilote");
});
modelBuilder.Entity("Entity_Framework.Entity.Sessions", b =>
{
b.HasOne("Entity_Framework.Entity.Circuits", "Circuit")
.WithMany("Course")
.HasForeignKey("IdCircuit")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote")
.WithMany("Sessions")
.HasForeignKey("IdPilote")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Circuit");
b.Navigation("Pilote");
});
modelBuilder.Entity("Entity_Framework.Entity.Tours", b =>
{
b.HasOne("Entity_Framework.Entity.Sessions", "Session")
.WithMany("Tours")
.HasForeignKey("IdSession")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Session");
});
modelBuilder.Entity("Entity_Framework.Entity.Circuits", b =>
{
b.Navigation("Course");
});
modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b =>
{
b.Navigation("PilotesRelation");
});
modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b =>
{
b.Navigation("Ecurie");
b.Navigation("EcuriePropriétaire")
.IsRequired();
b.Navigation("Image")
.IsRequired();
b.Navigation("Sessions");
});
modelBuilder.Entity("Entity_Framework.Entity.Sessions", b =>
{
b.Navigation("Tours");
});
modelBuilder.Entity("Entity_Framework.Entity.Tours", b =>
{
b.Navigation("Points");
});
#pragma warning restore 612, 618
}
}
}