using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Recurit.Exam.Service.Migrations { /// public partial class addtabledocument : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ProfileImgId", table: "Candidates", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateTable( name: "Documents", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FileName = table.Column(type: "varchar(255)", maxLength: 255, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FileSize = table.Column(type: "int", nullable: false), FileType = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Detail = table.Column(type: "text", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ObjectRefId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedDate = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Documents", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_Candidates_ProfileImgId", table: "Candidates", column: "ProfileImgId"); migrationBuilder.AddForeignKey( name: "FK_Candidates_Documents_ProfileImgId", table: "Candidates", column: "ProfileImgId", principalTable: "Documents", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Candidates_Documents_ProfileImgId", table: "Candidates"); migrationBuilder.DropTable( name: "Documents"); migrationBuilder.DropIndex( name: "IX_Candidates_ProfileImgId", table: "Candidates"); migrationBuilder.DropColumn( name: "ProfileImgId", table: "Candidates"); } } }