4c6f9a4ba8
Database Migration, Repositories, Automapper, Logger, StaticFiles
663 lines
36 KiB
C#
663 lines
36 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PortBlog.API.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class InitialDBMigration : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterDatabase()
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Blogs",
|
|
columns: table => new
|
|
{
|
|
BlogUrl = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Blogs", x => x.BlogUrl);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Candidates",
|
|
columns: table => new
|
|
{
|
|
CandidateId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
FirstName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
LastName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Gender = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Email = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Phone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Address = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Avatar = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Candidates", x => x.CandidateId);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ClientLogs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
SiteName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
SiteUrl = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ClientIp = table.Column<string>(type: "longtext", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ClientLocation = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ClientLogs", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Messages",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Email = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Subject = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Content = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Messages", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Posts",
|
|
columns: table => new
|
|
{
|
|
PostId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Slug = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Category = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Author = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
PostUrl = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Likes = table.Column<int>(type: "int", nullable: false),
|
|
Views = table.Column<int>(type: "int", nullable: false),
|
|
Comments = table.Column<int>(type: "int", nullable: false),
|
|
Image = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
BlogUrl = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Posts", x => x.PostId);
|
|
table.ForeignKey(
|
|
name: "FK_Posts_Blogs_BlogUrl",
|
|
column: x => x.BlogUrl,
|
|
principalTable: "Blogs",
|
|
principalColumn: "BlogUrl",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Resumes",
|
|
columns: table => new
|
|
{
|
|
ResumeId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
About = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Order = table.Column<int>(type: "int", nullable: false),
|
|
CandidateId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Resumes", x => x.ResumeId);
|
|
table.ForeignKey(
|
|
name: "FK_Resumes_Candidates_CandidateId",
|
|
column: x => x.CandidateId,
|
|
principalTable: "Candidates",
|
|
principalColumn: "CandidateId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "MessageStatusLogs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
MessageId = table.Column<int>(type: "int", nullable: false),
|
|
Status = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_MessageStatusLogs", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_MessageStatusLogs_Messages_MessageId",
|
|
column: x => x.MessageId,
|
|
principalTable: "Messages",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Academics",
|
|
columns: table => new
|
|
{
|
|
AcademicId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Institution = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
StartYear = table.Column<int>(type: "int", nullable: false),
|
|
EndYear = table.Column<int>(type: "int", nullable: false),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
Degree = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DegreeSpecialization = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Academics", x => x.AcademicId);
|
|
table.ForeignKey(
|
|
name: "FK_Academics_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Certifications",
|
|
columns: table => new
|
|
{
|
|
CertificationId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
CertificationName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IssuingOrganization = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CertificationLink = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IssueDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
ExpiryDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Certifications", x => x.CertificationId);
|
|
table.ForeignKey(
|
|
name: "FK_Certifications_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Experiences",
|
|
columns: table => new
|
|
{
|
|
ExperienceId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Company = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Location = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Experiences", x => x.ExperienceId);
|
|
table.ForeignKey(
|
|
name: "FK_Experiences_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Files",
|
|
columns: table => new
|
|
{
|
|
FileId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
FileName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
FileFormat = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
FilePath = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Version = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Files", x => x.FileId);
|
|
table.ForeignKey(
|
|
name: "FK_Files_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Hobbies",
|
|
columns: table => new
|
|
{
|
|
HobbyId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Order = table.Column<int>(type: "int", nullable: false),
|
|
Icon = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Hobbies", x => x.HobbyId);
|
|
table.ForeignKey(
|
|
name: "FK_Hobbies_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Projects",
|
|
columns: table => new
|
|
{
|
|
ProjectId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Category = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Roles = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Challenges = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
LessonsLearned = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Impact = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Responsibilities = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
TechnologiesUsed = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
Status = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ImagePath = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Projects", x => x.ProjectId);
|
|
table.ForeignKey(
|
|
name: "FK_Projects_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Skills",
|
|
columns: table => new
|
|
{
|
|
SkillId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProficiencyLevel = table.Column<int>(type: "int", nullable: false),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Skills", x => x.SkillId);
|
|
table.ForeignKey(
|
|
name: "FK_Skills_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "SocialLinks",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
GitHub = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Linkedin = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Instagram = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Facebook = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Twitter = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
PersonalWebsite = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
BlogUrl = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ResumeId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_SocialLinks", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_SocialLinks_Blogs_BlogUrl",
|
|
column: x => x.BlogUrl,
|
|
principalTable: "Blogs",
|
|
principalColumn: "BlogUrl");
|
|
table.ForeignKey(
|
|
name: "FK_SocialLinks_Resumes_ResumeId",
|
|
column: x => x.ResumeId,
|
|
principalTable: "Resumes",
|
|
principalColumn: "ResumeId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ExperienceDetails",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Details = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Order = table.Column<int>(type: "int", nullable: false),
|
|
ExperienceId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ModifiedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
ModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ExperienceDetails", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_ExperienceDetails_Experiences_ExperienceId",
|
|
column: x => x.ExperienceId,
|
|
principalTable: "Experiences",
|
|
principalColumn: "ExperienceId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Academics_ResumeId",
|
|
table: "Academics",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Certifications_ResumeId",
|
|
table: "Certifications",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ExperienceDetails_ExperienceId",
|
|
table: "ExperienceDetails",
|
|
column: "ExperienceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Experiences_ResumeId",
|
|
table: "Experiences",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Files_ResumeId",
|
|
table: "Files",
|
|
column: "ResumeId",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Hobbies_ResumeId",
|
|
table: "Hobbies",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MessageStatusLogs_MessageId",
|
|
table: "MessageStatusLogs",
|
|
column: "MessageId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Posts_BlogUrl",
|
|
table: "Posts",
|
|
column: "BlogUrl");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Projects_ResumeId",
|
|
table: "Projects",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Resumes_CandidateId",
|
|
table: "Resumes",
|
|
column: "CandidateId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Skills_ResumeId",
|
|
table: "Skills",
|
|
column: "ResumeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_SocialLinks_BlogUrl",
|
|
table: "SocialLinks",
|
|
column: "BlogUrl");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_SocialLinks_ResumeId",
|
|
table: "SocialLinks",
|
|
column: "ResumeId",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Academics");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Certifications");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ClientLogs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ExperienceDetails");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Files");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Hobbies");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "MessageStatusLogs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Posts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Projects");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Skills");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "SocialLinks");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Experiences");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Messages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Blogs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Resumes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Candidates");
|
|
}
|
|
}
|
|
}
|