//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PortBlog.API.DbContexts;
#nullable disable
namespace PortBlog.API.Migrations
{
[DbContext(typeof(CvBlogContext))]
[Migration("20240425092224_InitialDBMigration")]
partial class InitialDBMigration
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("PortBlog.API.Entities.Academic", b =>
{
b.Property("AcademicId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("AcademicId"));
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Degree")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("DegreeSpecialization")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("EndYear")
.HasColumnType("int");
b.Property("Institution")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("ResumeId")
.HasColumnType("int");
b.Property("StartYear")
.HasColumnType("int");
b.HasKey("AcademicId");
b.HasIndex("ResumeId");
b.ToTable("Academics");
});
modelBuilder.Entity("PortBlog.API.Entities.Blog", b =>
{
b.Property("BlogUrl")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("BlogUrl");
b.ToTable("Blogs");
});
modelBuilder.Entity("PortBlog.API.Entities.Candidate", b =>
{
b.Property("CandidateId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CandidateId"));
b.Property("Address")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Avatar")
.HasColumnType("longtext");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Email")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Gender")
.HasColumnType("longtext");
b.Property("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Phone")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.HasKey("CandidateId");
b.ToTable("Candidates");
});
modelBuilder.Entity("PortBlog.API.Entities.Certification", b =>
{
b.Property("CertificationId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CertificationId"));
b.Property("CertificationLink")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CertificationName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("ExpiryDate")
.HasColumnType("datetime(6)");
b.Property("IssueDate")
.HasColumnType("datetime(6)");
b.Property("IssuingOrganization")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("ResumeId")
.HasColumnType("int");
b.HasKey("CertificationId");
b.HasIndex("ResumeId");
b.ToTable("Certifications");
});
modelBuilder.Entity("PortBlog.API.Entities.ClientLog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("ClientIp")
.IsRequired()
.HasColumnType("longtext");
b.Property("ClientLocation")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("SiteName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("SiteUrl")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.HasKey("Id");
b.ToTable("ClientLogs");
});
modelBuilder.Entity("PortBlog.API.Entities.Experience", b =>
{
b.Property("ExperienceId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ExperienceId"));
b.Property("Company")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("EndDate")
.HasColumnType("datetime(6)");
b.Property("Location")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("ResumeId")
.HasColumnType("int");
b.Property("StartDate")
.HasColumnType("datetime(6)");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.HasKey("ExperienceId");
b.HasIndex("ResumeId");
b.ToTable("Experiences");
});
modelBuilder.Entity("PortBlog.API.Entities.ExperienceDetails", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Details")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("ExperienceId")
.HasColumnType("int");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Order")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExperienceId");
b.ToTable("ExperienceDetails");
});
modelBuilder.Entity("PortBlog.API.Entities.Hobby", b =>
{
b.Property("HobbyId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("HobbyId"));
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("Icon")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Order")
.HasColumnType("int");
b.Property("ResumeId")
.HasColumnType("int");
b.HasKey("HobbyId");
b.HasIndex("ResumeId");
b.ToTable("Hobbies");
});
modelBuilder.Entity("PortBlog.API.Entities.Message", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("Content")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Email")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Subject")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("Id");
b.ToTable("Messages");
});
modelBuilder.Entity("PortBlog.API.Entities.MessageStatusLog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("MessageId")
.HasColumnType("int");
b.Property("Status")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.HasKey("Id");
b.HasIndex("MessageId");
b.ToTable("MessageStatusLogs");
});
modelBuilder.Entity("PortBlog.API.Entities.Post", b =>
{
b.Property("PostId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PostId"));
b.Property("Author")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("BlogUrl")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Category")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Comments")
.HasColumnType("int");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Image")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Likes")
.HasColumnType("int");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("PostUrl")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Slug")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Views")
.HasColumnType("int");
b.HasKey("PostId");
b.HasIndex("BlogUrl");
b.ToTable("Posts");
});
modelBuilder.Entity("PortBlog.API.Entities.Project", b =>
{
b.Property("ProjectId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProjectId"));
b.Property("Category")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Challenges")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("EndDate")
.HasColumnType("datetime(6)");
b.Property("ImagePath")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Impact")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("LessonsLearned")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Responsibilities")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ResumeId")
.HasColumnType("int");
b.Property("Roles")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("StartDate")
.HasColumnType("datetime(6)");
b.Property("Status")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("TechnologiesUsed")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("ProjectId");
b.HasIndex("ResumeId");
b.ToTable("Projects");
});
modelBuilder.Entity("PortBlog.API.Entities.Resume", b =>
{
b.Property("ResumeId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResumeId"));
b.Property("About")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property("CandidateId")
.HasColumnType("int");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Order")
.HasColumnType("int");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.HasKey("ResumeId");
b.HasIndex("CandidateId");
b.ToTable("Resumes");
});
modelBuilder.Entity("PortBlog.API.Entities.ResumeFile", b =>
{
b.Property("FileId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileId"));
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("FileFormat")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("FileName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("FilePath")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("ResumeId")
.HasColumnType("int");
b.Property("Version")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.HasKey("FileId");
b.HasIndex("ResumeId")
.IsUnique();
b.ToTable("Files");
});
modelBuilder.Entity("PortBlog.API.Entities.Skill", b =>
{
b.Property("SkillId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SkillId"));
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ProficiencyLevel")
.HasColumnType("int");
b.Property("ResumeId")
.HasColumnType("int");
b.HasKey("SkillId");
b.HasIndex("ResumeId");
b.ToTable("Skills");
});
modelBuilder.Entity("PortBlog.API.Entities.SocialLinks", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("BlogUrl")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("CreatedDate")
.HasColumnType("datetime(6)");
b.Property("Facebook")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("GitHub")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Instagram")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Linkedin")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ModifiedBy")
.HasColumnType("longtext");
b.Property("ModifiedDate")
.HasColumnType("datetime(6)");
b.Property("PersonalWebsite")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("ResumeId")
.HasColumnType("int");
b.Property("Twitter")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.HasIndex("BlogUrl");
b.HasIndex("ResumeId")
.IsUnique();
b.ToTable("SocialLinks");
});
modelBuilder.Entity("PortBlog.API.Entities.Academic", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Academics")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.Certification", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Certifications")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.Experience", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Experiences")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.ExperienceDetails", b =>
{
b.HasOne("PortBlog.API.Entities.Experience", "Experience")
.WithMany("Details")
.HasForeignKey("ExperienceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Experience");
});
modelBuilder.Entity("PortBlog.API.Entities.Hobby", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Hobbys")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.MessageStatusLog", b =>
{
b.HasOne("PortBlog.API.Entities.Message", "Message")
.WithMany()
.HasForeignKey("MessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Message");
});
modelBuilder.Entity("PortBlog.API.Entities.Post", b =>
{
b.HasOne("PortBlog.API.Entities.Blog", "Blog")
.WithMany("Posts")
.HasForeignKey("BlogUrl")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Blog");
});
modelBuilder.Entity("PortBlog.API.Entities.Project", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Projects")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.Resume", b =>
{
b.HasOne("PortBlog.API.Entities.Candidate", "Candidate")
.WithMany("Resumes")
.HasForeignKey("CandidateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Candidate");
});
modelBuilder.Entity("PortBlog.API.Entities.ResumeFile", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithOne("ResumeFile")
.HasForeignKey("PortBlog.API.Entities.ResumeFile", "ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.Skill", b =>
{
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithMany("Skills")
.HasForeignKey("ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.SocialLinks", b =>
{
b.HasOne("PortBlog.API.Entities.Blog", "Blog")
.WithMany()
.HasForeignKey("BlogUrl");
b.HasOne("PortBlog.API.Entities.Resume", "Resume")
.WithOne("SocialLinks")
.HasForeignKey("PortBlog.API.Entities.SocialLinks", "ResumeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Blog");
b.Navigation("Resume");
});
modelBuilder.Entity("PortBlog.API.Entities.Blog", b =>
{
b.Navigation("Posts");
});
modelBuilder.Entity("PortBlog.API.Entities.Candidate", b =>
{
b.Navigation("Resumes");
});
modelBuilder.Entity("PortBlog.API.Entities.Experience", b =>
{
b.Navigation("Details");
});
modelBuilder.Entity("PortBlog.API.Entities.Resume", b =>
{
b.Navigation("Academics");
b.Navigation("Certifications");
b.Navigation("Experiences");
b.Navigation("Hobbys");
b.Navigation("Projects");
b.Navigation("ResumeFile");
b.Navigation("Skills");
b.Navigation("SocialLinks");
});
#pragma warning restore 612, 618
}
}
}