104 lines
4.6 KiB
C#
104 lines
4.6 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Assignment3.Migrations
|
|
{
|
|
public partial class init : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Immunization",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreationTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
OfficialName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
TradeName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
|
LotNumber = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
|
ExpirationDate = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Immunization", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Organization",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreationTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
|
|
Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Address = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Organization", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Patient",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreationTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
FirstName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
LastName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
DateOfBirth = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Patient", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Provider",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreationTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
FirstName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
LastName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
LicenseNumber = table.Column<long>(type: "bigint", nullable: false),
|
|
Address = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Provider", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Error",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
StatusCode = table.Column<int>(type: "int", nullable: false),
|
|
Message = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false)
|
|
});
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Immunization");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Organization");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Patient");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Provider");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Error");
|
|
}
|
|
}
|
|
}
|