Merge vers master

This commit is contained in:
2026-06-11 11:09:11 +02:00
87 changed files with 3299 additions and 84 deletions
File diff suppressed because it is too large Load Diff
+246
View File
@@ -0,0 +1,246 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class HOA : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ContactServiceProvider_Providers_ServiceProviderId",
table: "ContactServiceProvider");
migrationBuilder.DropForeignKey(
name: "FK_Contract_Providers_ServiceProviderId",
table: "Contract");
migrationBuilder.DropForeignKey(
name: "FK_ProviderContacts_Providers_ProviderId",
table: "ProviderContacts");
migrationBuilder.DropForeignKey(
name: "FK_Providers_ProviderTypes_ProviderTypeId",
table: "Providers");
migrationBuilder.DropIndex(
name: "IX_ExperienceLevels_StaffId",
table: "ExperienceLevels");
migrationBuilder.DropPrimaryKey(
name: "PK_Providers",
table: "Providers");
migrationBuilder.RenameTable(
name: "Providers",
newName: "ServiceProviders");
migrationBuilder.RenameIndex(
name: "IX_Providers_ProviderTypeId",
table: "ServiceProviders",
newName: "IX_ServiceProviders_ProviderTypeId");
migrationBuilder.AddColumn<int>(
name: "StaffId",
table: "HistoryOfApprovals",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AlterColumn<string>(
name: "Meeting",
table: "Communications",
type: "nvarchar(300)",
maxLength: 300,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(300)",
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Communications",
type: "nvarchar(100)",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100);
migrationBuilder.AlterColumn<string>(
name: "Calling",
table: "Communications",
type: "nvarchar(100)",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100);
migrationBuilder.AddPrimaryKey(
name: "PK_ServiceProviders",
table: "ServiceProviders",
column: "Id");
migrationBuilder.CreateIndex(
name: "IX_ExperienceLevels_StaffId",
table: "ExperienceLevels",
column: "StaffId",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_ContactServiceProvider_ServiceProviders_ServiceProviderId",
table: "ContactServiceProvider",
column: "ServiceProviderId",
principalTable: "ServiceProviders",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Contract_ServiceProviders_ServiceProviderId",
table: "Contract",
column: "ServiceProviderId",
principalTable: "ServiceProviders",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ProviderContacts_ServiceProviders_ProviderId",
table: "ProviderContacts",
column: "ProviderId",
principalTable: "ServiceProviders",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ServiceProviders_ProviderTypes_ProviderTypeId",
table: "ServiceProviders",
column: "ProviderTypeId",
principalTable: "ProviderTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ContactServiceProvider_ServiceProviders_ServiceProviderId",
table: "ContactServiceProvider");
migrationBuilder.DropForeignKey(
name: "FK_Contract_ServiceProviders_ServiceProviderId",
table: "Contract");
migrationBuilder.DropForeignKey(
name: "FK_ProviderContacts_ServiceProviders_ProviderId",
table: "ProviderContacts");
migrationBuilder.DropForeignKey(
name: "FK_ServiceProviders_ProviderTypes_ProviderTypeId",
table: "ServiceProviders");
migrationBuilder.DropIndex(
name: "IX_ExperienceLevels_StaffId",
table: "ExperienceLevels");
migrationBuilder.DropPrimaryKey(
name: "PK_ServiceProviders",
table: "ServiceProviders");
migrationBuilder.DropColumn(
name: "StaffId",
table: "HistoryOfApprovals");
migrationBuilder.RenameTable(
name: "ServiceProviders",
newName: "Providers");
migrationBuilder.RenameIndex(
name: "IX_ServiceProviders_ProviderTypeId",
table: "Providers",
newName: "IX_Providers_ProviderTypeId");
migrationBuilder.AlterColumn<string>(
name: "Meeting",
table: "Communications",
type: "nvarchar(300)",
maxLength: 300,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(300)",
oldMaxLength: 300,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Communications",
type: "nvarchar(100)",
maxLength: 100,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Calling",
table: "Communications",
type: "nvarchar(100)",
maxLength: 100,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100,
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_Providers",
table: "Providers",
column: "Id");
migrationBuilder.CreateIndex(
name: "IX_ExperienceLevels_StaffId",
table: "ExperienceLevels",
column: "StaffId");
migrationBuilder.AddForeignKey(
name: "FK_ContactServiceProvider_Providers_ServiceProviderId",
table: "ContactServiceProvider",
column: "ServiceProviderId",
principalTable: "Providers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Contract_Providers_ServiceProviderId",
table: "Contract",
column: "ServiceProviderId",
principalTable: "Providers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ProviderContacts_Providers_ProviderId",
table: "ProviderContacts",
column: "ProviderId",
principalTable: "Providers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Providers_ProviderTypes_ProviderTypeId",
table: "Providers",
column: "ProviderTypeId",
principalTable: "ProviderTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}
@@ -136,7 +136,6 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Calling")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@@ -144,12 +143,10 @@ namespace PyroFetes.Migrations
.HasColumnType("int");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Meeting")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("nvarchar(300)");
@@ -377,7 +374,8 @@ namespace PyroFetes.Migrations
b.HasKey("Id");
b.HasIndex("StaffId");
b.HasIndex("StaffId")
.IsUnique();
b.ToTable("ExperienceLevels");
});
@@ -396,6 +394,9 @@ namespace PyroFetes.Migrations
b.Property<DateOnly>("ExpirationDate")
.HasColumnType("date");
b.Property<int>("StaffId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("HistoryOfApprovals");
@@ -780,7 +781,7 @@ namespace PyroFetes.Migrations
b.HasIndex("ProviderTypeId");
b.ToTable("Providers");
b.ToTable("ServiceProviders");
});
modelBuilder.Entity("PyroFetes.Models.Setting", b =>
@@ -1332,8 +1333,8 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b =>
{
b.HasOne("PyroFetes.Models.Staff", "Staff")
.WithMany("ExperienceLevels")
.HasForeignKey("StaffId")
.WithOne("ExperienceLevel")
.HasForeignKey("PyroFetes.Models.ExperienceLevel", "StaffId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1910,7 +1911,8 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.Staff", b =>
{
b.Navigation("ExperienceLevels");
b.Navigation("ExperienceLevel")
.IsRequired();
b.Navigation("ShowStaffs");