|
| 1 | +using System; |
| 2 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +namespace ServiceLayer.Mesh.Migrations |
| 7 | +{ |
| 8 | + /// <inheritdoc /> |
| 9 | + public partial class AddNbssAppointmentEventTable : Migration |
| 10 | + { |
| 11 | + /// <inheritdoc /> |
| 12 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 13 | + { |
| 14 | + migrationBuilder.CreateTable( |
| 15 | + name: "NbssAppointmentEvents", |
| 16 | + columns: table => new |
| 17 | + { |
| 18 | + Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
| 19 | + MeshFileId = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false), |
| 20 | + BSO = table.Column<string>(type: "char(3)", maxLength: 3, nullable: false), |
| 21 | + ExtractId = table.Column<string>(type: "char(8)", maxLength: 8, nullable: false), |
| 22 | + Sequence = table.Column<string>(type: "char(6)", maxLength: 6, nullable: false), |
| 23 | + Action = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false), |
| 24 | + ClinicCode = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false), |
| 25 | + HoldingClinic = table.Column<string>(type: "char(1)", maxLength: 1, nullable: true), |
| 26 | + Status = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false), |
| 27 | + AttendedNotScreened = table.Column<string>(type: "char(1)", maxLength: 1, nullable: true), |
| 28 | + AppointmenId = table.Column<string>(type: "varchar(27)", maxLength: 27, nullable: false), |
| 29 | + NhsNumber = table.Column<string>(type: "char(10)", maxLength: 10, nullable: false), |
| 30 | + EpisodeType = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false), |
| 31 | + EpisodeStart = table.Column<DateOnly>(type: "date", nullable: false), |
| 32 | + BatchId = table.Column<string>(type: "varchar(9)", maxLength: 9, nullable: false), |
| 33 | + AppointmentType = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false), |
| 34 | + ScreeningAppointmentNumber = table.Column<byte>(type: "tinyint", nullable: true), |
| 35 | + BookedBy = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false), |
| 36 | + CancelledBy = table.Column<string>(type: "char(1)", maxLength: 1, nullable: true), |
| 37 | + AppointmentDateTime = table.Column<DateTime>(type: "datetime2(0)", nullable: false), |
| 38 | + Location = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false), |
| 39 | + ClinicName = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false), |
| 40 | + ClinicNameOnLetters = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false), |
| 41 | + ClinicAddressLine1 = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false), |
| 42 | + ClinicAddressLine2 = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false), |
| 43 | + ClinicAddressLine3 = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false), |
| 44 | + ClinicAddressLine4 = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false), |
| 45 | + ClinicAddressLine5 = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false), |
| 46 | + ClinicPostcode = table.Column<string>(type: "varchar(8)", maxLength: 8, nullable: false), |
| 47 | + ActionTimestamp = table.Column<DateTime>(type: "datetime2(0)", nullable: false) |
| 48 | + }, |
| 49 | + constraints: table => |
| 50 | + { |
| 51 | + table.PrimaryKey("PK_NbssAppointmentEvents", x => x.Id); |
| 52 | + table.ForeignKey( |
| 53 | + name: "FK_NbssAppointmentEvents_MeshFiles_MeshFileId", |
| 54 | + column: x => x.MeshFileId, |
| 55 | + principalTable: "MeshFiles", |
| 56 | + principalColumn: "FileId", |
| 57 | + onDelete: ReferentialAction.Cascade); |
| 58 | + }); |
| 59 | + |
| 60 | + migrationBuilder.CreateIndex( |
| 61 | + name: "IX_NbssAppointmentEvents_MeshFileId", |
| 62 | + table: "NbssAppointmentEvents", |
| 63 | + column: "MeshFileId"); |
| 64 | + } |
| 65 | + |
| 66 | + /// <inheritdoc /> |
| 67 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 68 | + { |
| 69 | + migrationBuilder.DropTable( |
| 70 | + name: "NbssAppointmentEvents"); |
| 71 | + } |
| 72 | + } |
| 73 | +} |
0 commit comments