irc-netcore-api/IRaCIS.Core.Infra.EFCore/Migrations/20241112075526_AddSecond.cs

49 lines
1.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddSecond : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SubjectVisitClinicalDialog",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SubjectVisitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Content = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SubjectVisitClinicalDialog", x => x.Id);
table.ForeignKey(
name: "FK_SubjectVisitClinicalDialog_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_SubjectVisitClinicalDialog_CreateUserId",
table: "SubjectVisitClinicalDialog",
column: "CreateUserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SubjectVisitClinicalDialog");
}
}
}