| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class AddedComment : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Comments",
- columns: table => new
- {
- Id = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Content = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: false),
- DateOfSending = table.Column<DateTime>(type: "datetime2", nullable: false),
- UserId = table.Column<int>(type: "int", nullable: false),
- ApplicantId = table.Column<int>(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Comments", x => x.Id);
- table.ForeignKey(
- name: "FK_Comments_Applicants_ApplicantId",
- column: x => x.ApplicantId,
- principalTable: "Applicants",
- principalColumn: "ApplicantId",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_Comments_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Comments_ApplicantId",
- table: "Comments",
- column: "ApplicantId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Comments_UserId",
- table: "Comments",
- column: "UserId");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Comments");
- }
- }
- }
|