using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FoodsharingSiegen.Server.Migrations { /// public partial class AddImageVerification : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "VerificationToken", table: "Prospects", type: "TEXT", nullable: true); migrationBuilder.CreateTable( name: "ProspectImages", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), ProspectId = table.Column(type: "TEXT", nullable: false), ImageData = table.Column(type: "BLOB", nullable: false), ContentType = table.Column(type: "TEXT", maxLength: 100, nullable: false), Created = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProspectImages", x => x.Id); table.ForeignKey( name: "FK_ProspectImages_Prospects_ProspectId", column: x => x.ProspectId, principalTable: "Prospects", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ProspectImages_ProspectId", table: "ProspectImages", column: "ProspectId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ProspectImages"); migrationBuilder.DropColumn( name: "VerificationToken", table: "Prospects"); } } }