//
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Infrastructure.Migrations
{
[DbContext(typeof(OptifitDbContext))]
[Migration("20250207101932_TESTTrainingProgMig")]
partial class TESTTrainingProgMig
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Category")
.HasColumnType("INTEGER");
b.Property("NbReps")
.HasColumnType("INTEGER");
b.Property("NbSets")
.HasColumnType("INTEGER");
b.Property("RestingTime")
.HasColumnType("INTEGER");
b.Property("SessionId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("TemplateId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SessionId");
b.HasIndex("TemplateId");
b.ToTable("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.Exercice_template", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Duration")
.HasColumnType("REAL");
b.Property("Equipment")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ImageId")
.HasColumnType("TEXT");
b.Property("Instructions")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("VideoId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Exercice_template");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Day")
.HasColumnType("INTEGER");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Target")
.HasColumnType("INTEGER");
b.Property("TrainingProgramId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("TrainingProgramId");
b.ToTable("Sessions");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Difficulty")
.HasColumnType("INTEGER");
b.Property("Goal")
.HasColumnType("INTEGER");
b.Property("Lang")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("OwnerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("WeekDuration")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Programs");
});
modelBuilder.Entity("Infrastructure.Entities.User", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Age")
.HasColumnType("INTEGER");
b.Property("EGoal")
.HasColumnType("TEXT");
b.Property("EHealthProblem")
.HasColumnType("INTEGER");
b.Property("ESleepLevel")
.HasColumnType("INTEGER");
b.Property("ESport")
.HasColumnType("INTEGER");
b.Property("ESportLevel")
.HasColumnType("INTEGER");
b.Property("HashPassword")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Height")
.HasColumnType("REAL");
b.Property("Logo")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("NbSessionPerWeek")
.HasColumnType("INTEGER");
b.Property("OAuthId")
.HasColumnType("TEXT");
b.Property("OAuthProvider")
.HasColumnType("TEXT");
b.Property("Sexe")
.HasColumnType("INTEGER");
b.Property("Weight")
.HasColumnType("REAL");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.HasOne("Infrastructure.Entities.Session", "Session")
.WithMany("Exercices")
.HasForeignKey("SessionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Infrastructure.Entities.Exercice_template", "Template")
.WithMany()
.HasForeignKey("TemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Session");
b.Navigation("Template");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.HasOne("Infrastructure.Entities.TrainingProgram", "TrainingProgram")
.WithMany("Sessions")
.HasForeignKey("TrainingProgramId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TrainingProgram");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Navigation("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Navigation("Sessions");
});
#pragma warning restore 612, 618
}
}
}