simple-lis/Migrations/20241213124817_Patients got messages.cs

51 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SimpleLIS.Migrations
{
/// <inheritdoc />
public partial class Patientsgotmessages : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PatientId",
table: "Messages",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_Messages_PatientId",
table: "Messages",
column: "PatientId");
migrationBuilder.AddForeignKey(
name: "FK_Messages_Patients_PatientId",
table: "Messages",
column: "PatientId",
principalTable: "Patients",
principalColumn: "PatientId",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Messages_Patients_PatientId",
table: "Messages");
migrationBuilder.DropIndex(
name: "IX_Messages_PatientId",
table: "Messages");
migrationBuilder.DropColumn(
name: "PatientId",
table: "Messages");
}
}
}