irc-netcore-api/IRaCIS.Core.Infra.EFCore/Migrations/20250321021802_hirAddHospit...

61 lines
3.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class hirAddHospital2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "HIRHospital",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
HospitalName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
HospitalAliasName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
Country = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
City = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
Province = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
Address = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
Phone = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
IsCanConnectInternet = table.Column<bool>(type: "bit", nullable: false),
HospitalCode = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
HospitalLogoPath = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
TrialKeepCount = table.Column<int>(type: "int", nullable: false),
IsDefault = table.Column<bool>(type: "bit", nullable: false),
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HIRHospital", x => x.Id);
table.ForeignKey(
name: "FK_HIRHospital_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_HIRHospital_CreateUserId",
table: "HIRHospital",
column: "CreateUserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "HIRHospital");
}
}
}