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(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetimeoffset", nullable: false), OfficialName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), TradeName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), LotNumber = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false), ExpirationDate = table.Column(type: "datetimeoffset", nullable: false), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Immunization", x => x.Id); }); migrationBuilder.CreateTable( name: "Organization", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetimeoffset", nullable: false), Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Type = table.Column(type: "nvarchar(max)", nullable: false), Address = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Organization", x => x.Id); }); migrationBuilder.CreateTable( name: "Patient", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetimeoffset", nullable: false), FirstName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), LastName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), DateOfBirth = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Patient", x => x.Id); }); migrationBuilder.CreateTable( name: "Provider", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetimeoffset", nullable: false), FirstName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), LastName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), LicenseNumber = table.Column(type: "bigint", nullable: false), Address = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Provider", x => x.Id); }); migrationBuilder.CreateTable( name: "Error", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), StatusCode = table.Column(type: "int", nullable: false), Message = table.Column(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"); } } }