|
| 1 | +using System; |
| 2 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +namespace RegistrationWebAPI.Migrations |
| 7 | +{ |
| 8 | + /// <inheritdoc /> |
| 9 | + public partial class AddDownloadAudits : Migration |
| 10 | + { |
| 11 | + /// <inheritdoc /> |
| 12 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 13 | + { |
| 14 | + migrationBuilder.CreateTable( |
| 15 | + name: "DownloadAudits", |
| 16 | + columns: table => new |
| 17 | + { |
| 18 | + Id = table.Column<Guid>(type: "TEXT", nullable: false), |
| 19 | + DownloadedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false), |
| 20 | + UserEmail = table.Column<string>(type: "TEXT", nullable: false), |
| 21 | + UserId = table.Column<Guid>(type: "TEXT", nullable: true), |
| 22 | + DownloadType = table.Column<string>(type: "TEXT", nullable: false), |
| 23 | + Version = table.Column<string>(type: "TEXT", nullable: false), |
| 24 | + Platform = table.Column<string>(type: "TEXT", nullable: true), |
| 25 | + DownloadUrl = table.Column<string>(type: "TEXT", nullable: true) |
| 26 | + }, |
| 27 | + constraints: table => |
| 28 | + { |
| 29 | + table.PrimaryKey("PK_DownloadAudits", x => x.Id); |
| 30 | + }); |
| 31 | + |
| 32 | + migrationBuilder.CreateIndex( |
| 33 | + name: "IX_DownloadAudits_DownloadedAtUtc", |
| 34 | + table: "DownloadAudits", |
| 35 | + column: "DownloadedAtUtc"); |
| 36 | + |
| 37 | + migrationBuilder.CreateIndex( |
| 38 | + name: "IX_DownloadAudits_UserEmail", |
| 39 | + table: "DownloadAudits", |
| 40 | + column: "UserEmail"); |
| 41 | + } |
| 42 | + |
| 43 | + /// <inheritdoc /> |
| 44 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 45 | + { |
| 46 | + migrationBuilder.DropTable( |
| 47 | + name: "DownloadAudits"); |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments