Slip- und Beschuldigungslogik überarbeitet
All checks were successful
Build / build (push) Successful in 2m19s
All checks were successful
Build / build (push) Successful in 2m19s
Slips werden jetzt 30 Sekunden vorgehalten und anschließend automatisch abgeschlossen; direkte Spieler-Beschuldigungen, Win-Status, SignalR-Events, MAUI-UI, EF-Mapping/Migrationen sowie Tests wurden an die neue Spiellogik angepasst.
This commit is contained in:
@@ -33,6 +33,12 @@ public class SlipItInDbContext : DbContext
|
||||
.WithMany()
|
||||
.HasForeignKey(g => g.HostId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
modelBuilder.Entity<Game>()
|
||||
.HasOne(g => g.WinnerPlayer)
|
||||
.WithMany()
|
||||
.HasForeignKey(g => g.WinnerPlayerId)
|
||||
.IsRequired(false)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
// Player
|
||||
modelBuilder.Entity<Player>()
|
||||
@@ -92,6 +98,7 @@ public class SlipItInDbContext : DbContext
|
||||
.HasOne(sc => sc.TargetCard)
|
||||
.WithMany()
|
||||
.HasForeignKey(sc => sc.TargetCardId)
|
||||
.IsRequired(false)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
|
||||
14
SlipItIn.Server/Data/SlipItInDbContextFactory.cs
Normal file
14
SlipItIn.Server/Data/SlipItInDbContextFactory.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace SlipItIn.Server.Data;
|
||||
|
||||
public class SlipItInDbContextFactory : IDesignTimeDbContextFactory<SlipItInDbContext>
|
||||
{
|
||||
public SlipItInDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<SlipItInDbContext>();
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Database=slipitindb;Username=postgres;Password=postgres");
|
||||
return new SlipItInDbContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user