//
using System;
using CandidateReviewDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace CandidateReviewDatabaseImplement.Migrations
{
[DbContext(typeof(CandidateReviewDatabase))]
[Migration("20241104182335_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Comment")
.HasColumnType("text");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Rating")
.HasColumnType("integer");
b.Property("ResumeId")
.HasColumnType("integer");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Assessments");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AssessmentId")
.HasColumnType("integer");
b.Property("CriterionId")
.HasColumnType("integer");
b.Property("Value")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AssessmentId");
b.HasIndex("CriterionId");
b.ToTable("AssessmentCriterions");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Address")
.HasColumnType("text");
b.Property("Contacts")
.HasColumnType("text");
b.Property("Description")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("Website")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Companies");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("Type")
.HasColumnType("integer");
b.Property("Weight")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Criterions");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.HasColumnType("text");
b.Property("Education")
.IsRequired()
.HasColumnType("text");
b.Property("Experience")
.IsRequired()
.HasColumnType("text");
b.Property("PhotoFilePath")
.HasColumnType("text");
b.Property("ResumeId")
.HasColumnType("integer");
b.Property("Skills")
.IsRequired()
.HasColumnType("text");
b.Property("Status")
.HasColumnType("integer");
b.Property("Title")
.IsRequired()
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("integer");
b.Property("VacancyId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ResumeId")
.IsUnique();
b.HasIndex("UserId");
b.HasIndex("VacancyId");
b.ToTable("Resumes");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CompanyId")
.IsRequired()
.HasColumnType("integer");
b.Property("Email")
.IsRequired()
.HasColumnType("text");
b.Property("EmailConfirmed")
.HasColumnType("boolean");
b.Property("LastName")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("Password")
.IsRequired()
.HasColumnType("text");
b.Property("PhoneNumber")
.HasColumnType("text");
b.Property("Role")
.HasColumnType("integer");
b.Property("Surname")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CompanyId");
b.ToTable("Users");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CompanyId")
.HasColumnType("integer");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Description")
.HasColumnType("text");
b.Property("JobTitle")
.IsRequired()
.HasColumnType("text");
b.Property("JobType")
.HasColumnType("integer");
b.Property("Requirements")
.IsRequired()
.HasColumnType("text");
b.Property("Responsibilities")
.IsRequired()
.HasColumnType("text");
b.Property("Salary")
.HasColumnType("text");
b.Property("Status")
.HasColumnType("integer");
b.Property("Tags")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CompanyId");
b.ToTable("Vacancies");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
{
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
.WithMany("Assessments")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
{
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
.WithMany("Criterions")
.HasForeignKey("AssessmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CandidateReviewDatabaseImplement.Models.Criterion", "Criterion")
.WithMany("AssessmentCriterions")
.HasForeignKey("CriterionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assessment");
b.Navigation("Criterion");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
{
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
.WithOne("Resume")
.HasForeignKey("CandidateReviewDatabaseImplement.Models.Resume", "ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
.WithMany("Resumes")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CandidateReviewDatabaseImplement.Models.Vacancy", "Vacancy")
.WithMany("Resumes")
.HasForeignKey("VacancyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assessment");
b.Navigation("User");
b.Navigation("Vacancy");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
{
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
.WithMany("Users")
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Company");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
{
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
.WithMany("Vacancies")
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Company");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
{
b.Navigation("Criterions");
b.Navigation("Resume")
.IsRequired();
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
{
b.Navigation("Users");
b.Navigation("Vacancies");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
{
b.Navigation("AssessmentCriterions");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
{
b.Navigation("Assessments");
b.Navigation("Resumes");
});
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
{
b.Navigation("Resumes");
});
#pragma warning restore 612, 618
}
}
}