School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,728 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ProfessionalProfile.DatabaseContext;
#nullable disable
namespace ProfessionalProfile.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240514164956_UwU")]
partial class UwU
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
{
b.Property<int>("answerId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("answerId"));
b.Property<string>("answerText")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("isCorrect")
.HasColumnType("bit");
b.Property<int>("questionId")
.HasColumnType("int");
b.HasKey("answerId");
b.HasIndex("questionId");
b.ToTable("Answers");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
{
b.Property<int>("assesmentResultId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("assesmentResultId"));
b.Property<int>("assesmentTestId")
.HasColumnType("int");
b.Property<int>("score")
.HasColumnType("int");
b.Property<DateTime>("testDate")
.HasColumnType("datetime2");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("assesmentResultId");
b.HasIndex("assesmentTestId")
.IsUnique();
b.HasIndex("userId")
.IsUnique();
b.ToTable("AssessmentResult");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.Property<int>("assessmentTestId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("assessmentTestId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("skillid")
.HasColumnType("int");
b.Property<string>("testName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("assessmentTestId");
b.HasIndex("skillid");
b.HasIndex("userId");
b.ToTable("AssessmentTest");
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.Property<int>("bcId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("bcId"));
b.Property<string>("summary")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("uniqueUrl")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("bcId");
b.HasIndex("userId");
b.ToTable("BusinessCard");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
{
b.Property<int>("certificateId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("certificateId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("expirationDate")
.HasColumnType("datetime2");
b.Property<string>("issuedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("issuedDate")
.HasColumnType("datetime2");
b.Property<string>("name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("certificateId");
b.HasIndex("userId");
b.ToTable("Certificate");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
{
b.Property<int>("educationId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("educationId"));
b.Property<string>("degree")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("fieldOfStudy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("graduationDate")
.HasColumnType("datetime2");
b.Property<string>("institution")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("educationId");
b.HasIndex("userId");
b.ToTable("Education");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
{
b.Property<int>("endorsementId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("endorsementId"));
b.Property<int>("endorserId")
.HasColumnType("int");
b.Property<int>("recipientid")
.HasColumnType("int");
b.Property<int>("skillId")
.HasColumnType("int");
b.HasKey("endorsementId");
b.HasIndex("endorserId");
b.HasIndex("recipientid");
b.HasIndex("skillId");
b.ToTable("Endorsement");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
{
b.Property<int>("notificationId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("notificationId"));
b.Property<string>("activity")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("details")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("isRead")
.HasColumnType("bit");
b.Property<DateTime>("timestamp")
.HasColumnType("datetime2");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("notificationId");
b.HasIndex("userId");
b.ToTable("Notification");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanViewCertificates")
.HasColumnType("bit");
b.Property<bool>("CanViewEducation")
.HasColumnType("bit");
b.Property<bool>("CanViewProjects")
.HasColumnType("bit");
b.Property<bool>("CanViewSkills")
.HasColumnType("bit");
b.Property<bool>("CanViewVolunteering")
.HasColumnType("bit");
b.Property<bool>("CanViewWorkExperience")
.HasColumnType("bit");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Privacy");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
{
b.Property<int>("projectId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("projectId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("projectName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("technologies")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("projectId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Project");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
{
b.Property<int>("questionId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("questionId"));
b.Property<int>("assesmentTestId")
.HasColumnType("int");
b.Property<string>("questionText")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("questionId");
b.HasIndex("assesmentTestId");
b.ToTable("Question");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.Property<int>("skillId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("skillId"));
b.Property<int?>("BusinessCardbcId")
.HasColumnType("int");
b.Property<string>("name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("skillId");
b.HasIndex("BusinessCardbcId");
b.ToTable("Skill");
});
modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
{
b.Property<int>("userId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("userId"));
b.Property<string>("address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("darkTheme")
.HasColumnType("bit");
b.Property<DateTime>("dateOfBirth")
.HasColumnType("datetime2");
b.Property<string>("email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("firstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("lastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("phone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("picture")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("summary")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("websiteURL")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("userId");
b.ToTable("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
{
b.Property<int>("volunteeringId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("volunteeringId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("organisation")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("role")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("volunteeringId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Volunteering");
});
modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
{
b.Property<int>("workId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("workId"));
b.Property<string>("achievements")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("company")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("employmentPeriod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("jobTitle")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("location")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("responsibilities")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("workId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("WorkExperience");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
{
b.HasOne("ProfessionalProfile.Domain.Question", "Question")
.WithMany()
.HasForeignKey("questionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Question");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
{
b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
.WithOne("AssessmentResult")
.HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "assesmentTestId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("AssessmentResult")
.HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "userId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("AssessmentTest");
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.HasOne("ProfessionalProfile.Domain.Skill", "Skill")
.WithMany()
.HasForeignKey("skillid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Skill");
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "Endorser")
.WithMany()
.HasForeignKey("endorserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "Recipient")
.WithMany()
.HasForeignKey("recipientid")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.Skill", null)
.WithMany("endorsements")
.HasForeignKey("skillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Endorser");
b.Navigation("Recipient");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany("Notifications")
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Privacy")
.HasForeignKey("ProfessionalProfile.Domain.Privacy", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Project")
.HasForeignKey("ProfessionalProfile.Domain.Project", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
{
b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
.WithMany()
.HasForeignKey("assesmentTestId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssessmentTest");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.HasOne("ProfessionalProfile.Domain.BusinessCard", null)
.WithMany("keySkills")
.HasForeignKey("BusinessCardbcId");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Volunteering")
.HasForeignKey("ProfessionalProfile.Domain.Volunteering", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("WorkExperience")
.HasForeignKey("ProfessionalProfile.Domain.WorkExperience", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.Navigation("AssessmentResult")
.IsRequired();
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.Navigation("keySkills");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.Navigation("endorsements");
});
modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
{
b.Navigation("AssessmentResult");
b.Navigation("Notifications");
b.Navigation("Privacy");
b.Navigation("Project");
b.Navigation("Volunteering");
b.Navigation("WorkExperience");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,516 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ProfessionalProfile.Migrations
{
/// <inheritdoc />
public partial class UwU : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "User",
columns: table => new
{
userId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
firstName = table.Column<string>(type: "nvarchar(max)", nullable: false),
lastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
email = table.Column<string>(type: "nvarchar(max)", nullable: false),
password = table.Column<string>(type: "nvarchar(max)", nullable: false),
phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
summary = table.Column<string>(type: "nvarchar(max)", nullable: false),
dateOfBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
darkTheme = table.Column<bool>(type: "bit", nullable: false),
address = table.Column<string>(type: "nvarchar(max)", nullable: false),
websiteURL = table.Column<string>(type: "nvarchar(max)", nullable: false),
picture = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_User", x => x.userId);
});
migrationBuilder.CreateTable(
name: "BusinessCard",
columns: table => new
{
bcId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
summary = table.Column<string>(type: "nvarchar(max)", nullable: false),
uniqueUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BusinessCard", x => x.bcId);
table.ForeignKey(
name: "FK_BusinessCard_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Certificate",
columns: table => new
{
certificateId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
name = table.Column<string>(type: "nvarchar(max)", nullable: false),
issuedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
description = table.Column<string>(type: "nvarchar(max)", nullable: false),
issuedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
expirationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
userId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Certificate", x => x.certificateId);
table.ForeignKey(
name: "FK_Certificate_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Education",
columns: table => new
{
educationId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
degree = table.Column<string>(type: "nvarchar(max)", nullable: false),
institution = table.Column<string>(type: "nvarchar(max)", nullable: false),
fieldOfStudy = table.Column<string>(type: "nvarchar(max)", nullable: false),
graduationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Education", x => x.educationId);
table.ForeignKey(
name: "FK_Education_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Notification",
columns: table => new
{
notificationId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
activity = table.Column<string>(type: "nvarchar(max)", nullable: false),
timestamp = table.Column<DateTime>(type: "datetime2", nullable: false),
details = table.Column<string>(type: "nvarchar(max)", nullable: false),
isRead = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Notification", x => x.notificationId);
table.ForeignKey(
name: "FK_Notification_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Privacy",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
CanViewEducation = table.Column<bool>(type: "bit", nullable: false),
CanViewWorkExperience = table.Column<bool>(type: "bit", nullable: false),
CanViewSkills = table.Column<bool>(type: "bit", nullable: false),
CanViewProjects = table.Column<bool>(type: "bit", nullable: false),
CanViewCertificates = table.Column<bool>(type: "bit", nullable: false),
CanViewVolunteering = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Privacy", x => x.Id);
table.ForeignKey(
name: "FK_Privacy_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Project",
columns: table => new
{
projectId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
projectName = table.Column<string>(type: "nvarchar(max)", nullable: false),
description = table.Column<string>(type: "nvarchar(max)", nullable: false),
technologies = table.Column<string>(type: "nvarchar(max)", nullable: false),
userId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Project", x => x.projectId);
table.ForeignKey(
name: "FK_Project_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Volunteering",
columns: table => new
{
volunteeringId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
organisation = table.Column<string>(type: "nvarchar(max)", nullable: false),
role = table.Column<string>(type: "nvarchar(max)", nullable: false),
description = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Volunteering", x => x.volunteeringId);
table.ForeignKey(
name: "FK_Volunteering_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "WorkExperience",
columns: table => new
{
workId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
userId = table.Column<int>(type: "int", nullable: false),
jobTitle = table.Column<string>(type: "nvarchar(max)", nullable: false),
company = table.Column<string>(type: "nvarchar(max)", nullable: false),
location = table.Column<string>(type: "nvarchar(max)", nullable: false),
employmentPeriod = table.Column<string>(type: "nvarchar(max)", nullable: false),
responsibilities = table.Column<string>(type: "nvarchar(max)", nullable: false),
achievements = table.Column<string>(type: "nvarchar(max)", nullable: false),
description = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WorkExperience", x => x.workId);
table.ForeignKey(
name: "FK_WorkExperience_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skill",
columns: table => new
{
skillId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
name = table.Column<string>(type: "nvarchar(max)", nullable: false),
BusinessCardbcId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Skill", x => x.skillId);
table.ForeignKey(
name: "FK_Skill_BusinessCard_BusinessCardbcId",
column: x => x.BusinessCardbcId,
principalTable: "BusinessCard",
principalColumn: "bcId");
});
migrationBuilder.CreateTable(
name: "AssessmentTest",
columns: table => new
{
assessmentTestId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
testName = table.Column<string>(type: "nvarchar(max)", nullable: false),
userId = table.Column<int>(type: "int", nullable: false),
description = table.Column<string>(type: "nvarchar(max)", nullable: false),
skillid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AssessmentTest", x => x.assessmentTestId);
table.ForeignKey(
name: "FK_AssessmentTest_Skill_skillid",
column: x => x.skillid,
principalTable: "Skill",
principalColumn: "skillId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AssessmentTest_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Endorsement",
columns: table => new
{
endorsementId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
endorserId = table.Column<int>(type: "int", nullable: false),
recipientid = table.Column<int>(type: "int", nullable: false),
skillId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Endorsement", x => x.endorsementId);
table.ForeignKey(
name: "FK_Endorsement_Skill_skillId",
column: x => x.skillId,
principalTable: "Skill",
principalColumn: "skillId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Endorsement_User_endorserId",
column: x => x.endorserId,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Endorsement_User_recipientid",
column: x => x.recipientid,
principalTable: "User",
principalColumn: "userId",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AssessmentResult",
columns: table => new
{
assesmentResultId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
assesmentTestId = table.Column<int>(type: "int", nullable: false),
score = table.Column<int>(type: "int", nullable: false),
userId = table.Column<int>(type: "int", nullable: false),
testDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AssessmentResult", x => x.assesmentResultId);
table.ForeignKey(
name: "FK_AssessmentResult_AssessmentTest_assesmentTestId",
column: x => x.assesmentTestId,
principalTable: "AssessmentTest",
principalColumn: "assessmentTestId");
table.ForeignKey(
name: "FK_AssessmentResult_User_userId",
column: x => x.userId,
principalTable: "User",
principalColumn: "userId");
});
migrationBuilder.CreateTable(
name: "Question",
columns: table => new
{
questionId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
questionText = table.Column<string>(type: "nvarchar(max)", nullable: false),
assesmentTestId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Question", x => x.questionId);
table.ForeignKey(
name: "FK_Question_AssessmentTest_assesmentTestId",
column: x => x.assesmentTestId,
principalTable: "AssessmentTest",
principalColumn: "assessmentTestId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Answers",
columns: table => new
{
answerId = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
answerText = table.Column<string>(type: "nvarchar(max)", nullable: false),
questionId = table.Column<int>(type: "int", nullable: false),
isCorrect = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Answers", x => x.answerId);
table.ForeignKey(
name: "FK_Answers_Question_questionId",
column: x => x.questionId,
principalTable: "Question",
principalColumn: "questionId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Answers_questionId",
table: "Answers",
column: "questionId");
migrationBuilder.CreateIndex(
name: "IX_AssessmentResult_assesmentTestId",
table: "AssessmentResult",
column: "assesmentTestId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AssessmentResult_userId",
table: "AssessmentResult",
column: "userId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AssessmentTest_skillid",
table: "AssessmentTest",
column: "skillid");
migrationBuilder.CreateIndex(
name: "IX_AssessmentTest_userId",
table: "AssessmentTest",
column: "userId");
migrationBuilder.CreateIndex(
name: "IX_BusinessCard_userId",
table: "BusinessCard",
column: "userId");
migrationBuilder.CreateIndex(
name: "IX_Certificate_userId",
table: "Certificate",
column: "userId");
migrationBuilder.CreateIndex(
name: "IX_Education_userId",
table: "Education",
column: "userId");
migrationBuilder.CreateIndex(
name: "IX_Endorsement_endorserId",
table: "Endorsement",
column: "endorserId");
migrationBuilder.CreateIndex(
name: "IX_Endorsement_recipientid",
table: "Endorsement",
column: "recipientid");
migrationBuilder.CreateIndex(
name: "IX_Endorsement_skillId",
table: "Endorsement",
column: "skillId");
migrationBuilder.CreateIndex(
name: "IX_Notification_userId",
table: "Notification",
column: "userId");
migrationBuilder.CreateIndex(
name: "IX_Privacy_userId",
table: "Privacy",
column: "userId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Project_userId",
table: "Project",
column: "userId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Question_assesmentTestId",
table: "Question",
column: "assesmentTestId");
migrationBuilder.CreateIndex(
name: "IX_Skill_BusinessCardbcId",
table: "Skill",
column: "BusinessCardbcId");
migrationBuilder.CreateIndex(
name: "IX_Volunteering_userId",
table: "Volunteering",
column: "userId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_WorkExperience_userId",
table: "WorkExperience",
column: "userId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Answers");
migrationBuilder.DropTable(
name: "AssessmentResult");
migrationBuilder.DropTable(
name: "Certificate");
migrationBuilder.DropTable(
name: "Education");
migrationBuilder.DropTable(
name: "Endorsement");
migrationBuilder.DropTable(
name: "Notification");
migrationBuilder.DropTable(
name: "Privacy");
migrationBuilder.DropTable(
name: "Project");
migrationBuilder.DropTable(
name: "Volunteering");
migrationBuilder.DropTable(
name: "WorkExperience");
migrationBuilder.DropTable(
name: "Question");
migrationBuilder.DropTable(
name: "AssessmentTest");
migrationBuilder.DropTable(
name: "Skill");
migrationBuilder.DropTable(
name: "BusinessCard");
migrationBuilder.DropTable(
name: "User");
}
}
}
@@ -0,0 +1,725 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ProfessionalProfile.DatabaseContext;
#nullable disable
namespace ProfessionalProfile.Migrations
{
[DbContext(typeof(DataContext))]
partial class DataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
{
b.Property<int>("answerId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("answerId"));
b.Property<string>("answerText")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("isCorrect")
.HasColumnType("bit");
b.Property<int>("questionId")
.HasColumnType("int");
b.HasKey("answerId");
b.HasIndex("questionId");
b.ToTable("Answers");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
{
b.Property<int>("assesmentResultId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("assesmentResultId"));
b.Property<int>("assesmentTestId")
.HasColumnType("int");
b.Property<int>("score")
.HasColumnType("int");
b.Property<DateTime>("testDate")
.HasColumnType("datetime2");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("assesmentResultId");
b.HasIndex("assesmentTestId")
.IsUnique();
b.HasIndex("userId")
.IsUnique();
b.ToTable("AssessmentResult");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.Property<int>("assessmentTestId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("assessmentTestId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("skillid")
.HasColumnType("int");
b.Property<string>("testName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("assessmentTestId");
b.HasIndex("skillid");
b.HasIndex("userId");
b.ToTable("AssessmentTest");
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.Property<int>("bcId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("bcId"));
b.Property<string>("summary")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("uniqueUrl")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("bcId");
b.HasIndex("userId");
b.ToTable("BusinessCard");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
{
b.Property<int>("certificateId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("certificateId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("expirationDate")
.HasColumnType("datetime2");
b.Property<string>("issuedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("issuedDate")
.HasColumnType("datetime2");
b.Property<string>("name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("certificateId");
b.HasIndex("userId");
b.ToTable("Certificate");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
{
b.Property<int>("educationId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("educationId"));
b.Property<string>("degree")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("fieldOfStudy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("graduationDate")
.HasColumnType("datetime2");
b.Property<string>("institution")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("educationId");
b.HasIndex("userId");
b.ToTable("Education");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
{
b.Property<int>("endorsementId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("endorsementId"));
b.Property<int>("endorserId")
.HasColumnType("int");
b.Property<int>("recipientid")
.HasColumnType("int");
b.Property<int>("skillId")
.HasColumnType("int");
b.HasKey("endorsementId");
b.HasIndex("endorserId");
b.HasIndex("recipientid");
b.HasIndex("skillId");
b.ToTable("Endorsement");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
{
b.Property<int>("notificationId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("notificationId"));
b.Property<string>("activity")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("details")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("isRead")
.HasColumnType("bit");
b.Property<DateTime>("timestamp")
.HasColumnType("datetime2");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("notificationId");
b.HasIndex("userId");
b.ToTable("Notification");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanViewCertificates")
.HasColumnType("bit");
b.Property<bool>("CanViewEducation")
.HasColumnType("bit");
b.Property<bool>("CanViewProjects")
.HasColumnType("bit");
b.Property<bool>("CanViewSkills")
.HasColumnType("bit");
b.Property<bool>("CanViewVolunteering")
.HasColumnType("bit");
b.Property<bool>("CanViewWorkExperience")
.HasColumnType("bit");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Privacy");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
{
b.Property<int>("projectId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("projectId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("projectName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("technologies")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("projectId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Project");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
{
b.Property<int>("questionId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("questionId"));
b.Property<int>("assesmentTestId")
.HasColumnType("int");
b.Property<string>("questionText")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("questionId");
b.HasIndex("assesmentTestId");
b.ToTable("Question");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.Property<int>("skillId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("skillId"));
b.Property<int?>("BusinessCardbcId")
.HasColumnType("int");
b.Property<string>("name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("skillId");
b.HasIndex("BusinessCardbcId");
b.ToTable("Skill");
});
modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
{
b.Property<int>("userId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("userId"));
b.Property<string>("address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("darkTheme")
.HasColumnType("bit");
b.Property<DateTime>("dateOfBirth")
.HasColumnType("datetime2");
b.Property<string>("email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("firstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("lastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("phone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("picture")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("summary")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("websiteURL")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("userId");
b.ToTable("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
{
b.Property<int>("volunteeringId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("volunteeringId"));
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("organisation")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("role")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("volunteeringId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("Volunteering");
});
modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
{
b.Property<int>("workId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("workId"));
b.Property<string>("achievements")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("company")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("employmentPeriod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("jobTitle")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("location")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("responsibilities")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("userId")
.HasColumnType("int");
b.HasKey("workId");
b.HasIndex("userId")
.IsUnique();
b.ToTable("WorkExperience");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
{
b.HasOne("ProfessionalProfile.Domain.Question", "Question")
.WithMany()
.HasForeignKey("questionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Question");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
{
b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
.WithOne("AssessmentResult")
.HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "assesmentTestId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("AssessmentResult")
.HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "userId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("AssessmentTest");
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.HasOne("ProfessionalProfile.Domain.Skill", "Skill")
.WithMany()
.HasForeignKey("skillid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Skill");
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany()
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "Endorser")
.WithMany()
.HasForeignKey("endorserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.User", "Recipient")
.WithMany()
.HasForeignKey("recipientid")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("ProfessionalProfile.Domain.Skill", null)
.WithMany("endorsements")
.HasForeignKey("skillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Endorser");
b.Navigation("Recipient");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithMany("Notifications")
.HasForeignKey("userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Privacy")
.HasForeignKey("ProfessionalProfile.Domain.Privacy", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Project")
.HasForeignKey("ProfessionalProfile.Domain.Project", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
{
b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
.WithMany()
.HasForeignKey("assesmentTestId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssessmentTest");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.HasOne("ProfessionalProfile.Domain.BusinessCard", null)
.WithMany("keySkills")
.HasForeignKey("BusinessCardbcId");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("Volunteering")
.HasForeignKey("ProfessionalProfile.Domain.Volunteering", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
{
b.HasOne("ProfessionalProfile.Domain.User", "User")
.WithOne("WorkExperience")
.HasForeignKey("ProfessionalProfile.Domain.WorkExperience", "userId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
{
b.Navigation("AssessmentResult")
.IsRequired();
});
modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
{
b.Navigation("keySkills");
});
modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
{
b.Navigation("endorsements");
});
modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
{
b.Navigation("AssessmentResult");
b.Navigation("Notifications");
b.Navigation("Privacy");
b.Navigation("Project");
b.Navigation("Volunteering");
b.Navigation("WorkExperience");
});
#pragma warning restore 612, 618
}
}
}