continuous-integration/drone/push Build is passing Details

Login
Louis LABORIE 4 months ago
parent 6a8ef3d1e9
commit c392815ae5

@ -0,0 +1,197 @@
// <auto-generated />
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("20250212145647_Initialize")]
partial class Initialize
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Image")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbRepetitions")
.HasColumnType("INTEGER");
b.Property<int>("NbSeries")
.HasColumnType("INTEGER");
b.Property<string>("SessionId")
.HasColumnType("TEXT");
b.Property<string>("Video")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SessionId");
b.ToTable("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("TrainingProgramId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("TrainingProgramId");
b.ToTable("Sessions");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Difficulty")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("WeekDuration")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Programs");
});
modelBuilder.Entity("Infrastructure.Entities.User", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("Age")
.HasColumnType("INTEGER");
b.Property<string>("EGoal")
.HasColumnType("TEXT");
b.Property<int>("EHealthProblem")
.HasColumnType("INTEGER");
b.Property<int?>("ESleepLevel")
.HasColumnType("INTEGER");
b.Property<int?>("ESport")
.HasColumnType("INTEGER");
b.Property<int?>("ESportLevel")
.HasColumnType("INTEGER");
b.Property<string>("HashPassword")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Height")
.HasColumnType("REAL");
b.Property<string>("Logo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbSessionPerWeek")
.HasColumnType("INTEGER");
b.Property<string>("OAuthId")
.HasColumnType("TEXT");
b.Property<string>("OAuthProvider")
.HasColumnType("TEXT");
b.Property<bool>("Sexe")
.HasColumnType("INTEGER");
b.Property<float>("Weight")
.HasColumnType("REAL");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.HasOne("Infrastructure.Entities.Session", null)
.WithMany("Exercices")
.HasForeignKey("SessionId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.HasOne("Infrastructure.Entities.TrainingProgram", null)
.WithMany("Sessions")
.HasForeignKey("TrainingProgramId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Navigation("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Navigation("Sessions");
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,125 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Migrations
{
/// <inheritdoc />
public partial class Initialize : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Programs",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
WeekDuration = table.Column<int>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Difficulty = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Programs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Age = table.Column<int>(type: "INTEGER", nullable: false),
Height = table.Column<float>(type: "REAL", nullable: false),
Weight = table.Column<float>(type: "REAL", nullable: false),
Sexe = table.Column<bool>(type: "INTEGER", nullable: false),
Logo = table.Column<string>(type: "TEXT", nullable: false),
NbSessionPerWeek = table.Column<int>(type: "INTEGER", nullable: false),
EGoal = table.Column<string>(type: "TEXT", nullable: true),
EHealthProblem = table.Column<int>(type: "INTEGER", nullable: false),
ESport = table.Column<int>(type: "INTEGER", nullable: true),
ESleepLevel = table.Column<int>(type: "INTEGER", nullable: true),
ESportLevel = table.Column<int>(type: "INTEGER", nullable: true),
HashPassword = table.Column<string>(type: "TEXT", nullable: false),
OAuthProvider = table.Column<string>(type: "TEXT", nullable: true),
OAuthId = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Sessions",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Duration = table.Column<float>(type: "REAL", nullable: false),
TrainingProgramId = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Sessions", x => x.Id);
table.ForeignKey(
name: "FK_Sessions_Programs_TrainingProgramId",
column: x => x.TrainingProgramId,
principalTable: "Programs",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Exercices",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Duration = table.Column<float>(type: "REAL", nullable: false),
Image = table.Column<string>(type: "TEXT", nullable: false),
Video = table.Column<string>(type: "TEXT", nullable: false),
NbSeries = table.Column<int>(type: "INTEGER", nullable: false),
NbRepetitions = table.Column<int>(type: "INTEGER", nullable: false),
SessionId = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Exercices", x => x.Id);
table.ForeignKey(
name: "FK_Exercices_Sessions_SessionId",
column: x => x.SessionId,
principalTable: "Sessions",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Exercices_SessionId",
table: "Exercices",
column: "SessionId");
migrationBuilder.CreateIndex(
name: "IX_Sessions_TrainingProgramId",
table: "Sessions",
column: "TrainingProgramId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Exercices");
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.DropTable(
name: "Sessions");
migrationBuilder.DropTable(
name: "Programs");
}
}
}

@ -0,0 +1,196 @@
// <auto-generated />
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("20250212152834_Second")]
partial class Second
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Image")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbRepetitions")
.HasColumnType("INTEGER");
b.Property<int>("NbSeries")
.HasColumnType("INTEGER");
b.Property<string>("SessionId")
.HasColumnType("TEXT");
b.Property<string>("Video")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SessionId");
b.ToTable("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("TrainingProgramId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("TrainingProgramId");
b.ToTable("Sessions");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Difficulty")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("WeekDuration")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Programs");
});
modelBuilder.Entity("Infrastructure.Entities.User", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("Age")
.HasColumnType("INTEGER");
b.Property<string>("EGoal")
.HasColumnType("TEXT");
b.Property<int>("EHealthProblem")
.HasColumnType("INTEGER");
b.Property<int?>("ESleepLevel")
.HasColumnType("INTEGER");
b.Property<int?>("ESport")
.HasColumnType("INTEGER");
b.Property<int?>("ESportLevel")
.HasColumnType("INTEGER");
b.Property<string>("HashPassword")
.HasColumnType("TEXT");
b.Property<float>("Height")
.HasColumnType("REAL");
b.Property<string>("Logo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbSessionPerWeek")
.HasColumnType("INTEGER");
b.Property<string>("OAuthId")
.HasColumnType("TEXT");
b.Property<string>("OAuthProvider")
.HasColumnType("TEXT");
b.Property<bool>("Sexe")
.HasColumnType("INTEGER");
b.Property<float>("Weight")
.HasColumnType("REAL");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.HasOne("Infrastructure.Entities.Session", null)
.WithMany("Exercices")
.HasForeignKey("SessionId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.HasOne("Infrastructure.Entities.TrainingProgram", null)
.WithMany("Sessions")
.HasForeignKey("TrainingProgramId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Navigation("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Navigation("Sessions");
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Migrations
{
/// <inheritdoc />
public partial class Second : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "HashPassword",
table: "Users",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "HashPassword",
table: "Users",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
}
}
}

@ -0,0 +1,193 @@
// <auto-generated />
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Infrastructure.Migrations
{
[DbContext(typeof(OptifitDbContext))]
partial class OptifitDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Image")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbRepetitions")
.HasColumnType("INTEGER");
b.Property<int>("NbSeries")
.HasColumnType("INTEGER");
b.Property<string>("SessionId")
.HasColumnType("TEXT");
b.Property<string>("Video")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SessionId");
b.ToTable("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Duration")
.HasColumnType("REAL");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("TrainingProgramId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("TrainingProgramId");
b.ToTable("Sessions");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Difficulty")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("WeekDuration")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Programs");
});
modelBuilder.Entity("Infrastructure.Entities.User", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("Age")
.HasColumnType("INTEGER");
b.Property<string>("EGoal")
.HasColumnType("TEXT");
b.Property<int>("EHealthProblem")
.HasColumnType("INTEGER");
b.Property<int?>("ESleepLevel")
.HasColumnType("INTEGER");
b.Property<int?>("ESport")
.HasColumnType("INTEGER");
b.Property<int?>("ESportLevel")
.HasColumnType("INTEGER");
b.Property<string>("HashPassword")
.HasColumnType("TEXT");
b.Property<float>("Height")
.HasColumnType("REAL");
b.Property<string>("Logo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("NbSessionPerWeek")
.HasColumnType("INTEGER");
b.Property<string>("OAuthId")
.HasColumnType("TEXT");
b.Property<string>("OAuthProvider")
.HasColumnType("TEXT");
b.Property<bool>("Sexe")
.HasColumnType("INTEGER");
b.Property<float>("Weight")
.HasColumnType("REAL");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("Infrastructure.Entities.Exercice", b =>
{
b.HasOne("Infrastructure.Entities.Session", null)
.WithMany("Exercices")
.HasForeignKey("SessionId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.HasOne("Infrastructure.Entities.TrainingProgram", null)
.WithMany("Sessions")
.HasForeignKey("TrainingProgramId");
});
modelBuilder.Entity("Infrastructure.Entities.Session", b =>
{
b.Navigation("Exercices");
});
modelBuilder.Entity("Infrastructure.Entities.TrainingProgram", b =>
{
b.Navigation("Sessions");
});
#pragma warning restore 612, 618
}
}
}

@ -26,7 +26,7 @@ builder.Services.AddScoped<ITrainingProgramRepository, TrainingProgramRepository
builder.Services.AddControllers();
builder.Services.AddDbContext<OptifitDbContext>(options =>
options.UseSqlite("Data Source=../Server/FirstTest.db", b => b.MigrationsAssembly("Infrastructure")));
options.UseSqlite("Data Source=FirstTest.db", b => b.MigrationsAssembly("Infrastructure")));
// Register AutoMapper
builder.Services.AddAutoMapper(typeof(UserProfile));

Loading…
Cancel
Save