📄
MatDenDagen/Infrastructure/Storage/Database/Migrations/20260503045708_AddUploadsToSubmissions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MatDenDagen.Infrastructure.Storage.Database.Migrations { /// <inheritdoc /> public partial class AddUploadsToSubmissions : Migration { /// <inheritdoc /> protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Upload", columns: table => new { Id = table.Column<string>(type: "TEXT", nullable: false), Name = table.Column<string>(type: "TEXT", nullable: false), SubmissionId = table.Column<Guid>(type: "TEXT", nullable: true), }, constraints: table => { table.PrimaryKey("PK_Upload", x => x.Id); table.ForeignKey( name: "FK_Upload_Submissions_SubmissionId", column: x => x.SubmissionId, principalTable: "Submissions", principalColumn: "Id" ); } ); migrationBuilder.CreateIndex(name: "IX_Upload_SubmissionId", table: "Upload", column: "SubmissionId"); } /// <inheritdoc /> protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable(name: "Upload"); } } }