migration

This commit is contained in:
Tizian.Breuch
2025-07-23 11:02:56 +02:00
parent d2c99fb32a
commit 0966198c70
5 changed files with 2 additions and 1251 deletions

View File

@@ -117,7 +117,7 @@ using (var scope = app.Services.CreateScope())
try try
{ {
var context = services.GetRequiredService<ApplicationDbContext>(); var context = services.GetRequiredService<ApplicationDbContext>();
context.Database.Migrate(); // Wendet ausstehende Migrationen an context.Database.Migrate();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -126,13 +126,6 @@ using (var scope = app.Services.CreateScope())
} }
} }
// --- START: HTTP REQUEST PIPELINE KONFIGURIEREN ---
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
// Swagger immer aktivieren (auch in Produktion f<>r API-Dokumentation) // Swagger immer aktivieren (auch in Produktion f<>r API-Dokumentation)
// F<>r die Produktion w<>re es sicherer, dies an `app.Environment.IsDevelopment()` zu binden // F<>r die Produktion w<>re es sicherer, dies an `app.Environment.IsDevelopment()` zu binden
// if (app.Environment.IsDevelopment()) // if (app.Environment.IsDevelopment())

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Webshop.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class InitialCreate1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@@ -12,7 +12,7 @@ using Webshop.Infrastructure.Data;
namespace Webshop.Infrastructure.Migrations namespace Webshop.Infrastructure.Migrations
{ {
[DbContext(typeof(ApplicationDbContext))] [DbContext(typeof(ApplicationDbContext))]
[Migration("20250721175118_InitialCreate")] [Migration("20250723083814_InitialCreate")]
partial class InitialCreate partial class InitialCreate
{ {
/// <inheritdoc /> /// <inheritdoc />