added Game->Club Relation
This commit is contained in:
parent
bef4309e0e
commit
e2fe8b723a
|
|
@ -4,6 +4,16 @@
|
|||
- offene Sachstrafen von einem Tag zum nächsten fortschreiben
|
||||
-
|
||||
|
||||
## Planung Phase 2
|
||||
Phase 1 MVP ist nun abgeschlossen. Jetzt planen wir die Phase 2 "Detaillierte Spielverwaltung".
|
||||
|
||||
Innerhalb eines nicht abgeschlossenen Spieltages sollen beliebig viele Spiele gestartet und zugeordnet werden. Die Spiele-Ansicht soll aus einem Eingabe-Panel und
|
||||
einer "Tafel" also einer pro Spiel unterschiedlichen Ansicht für den Spielstatus bestehen. Alles soll ich im Speicher auf der Tag-Details seite befinden. Beim
|
||||
Hin- und Herspringen zwischen den Tag-Details, der Kegel-Eingabe und der Tafel soll die Brwoser-Seite nicht jedes mal neu geladen werden.
|
||||
Beim Start eines Spiels sollen individuelle Steup-Komponenten angezeigt werden, je nach gewähltem Spiel-Typ.
|
||||
Dieses Grundprinzip kannst du aus dem nicht mehr aktiven Projekt KoggleApp extrahieren.
|
||||
Denke hart über diesen Input nach und überlege, wie das im Projekt Koogle.Web integriert werden kann. Starte noch nicht mit der Umsetzung sondern präsentiere mir
|
||||
deinen Plan und stelle Rückfragen.
|
||||
|
||||
## Optimierung Spieltag-Details
|
||||
Blende die Erledigt-Kennzeichnung (Als bezahlt markieren) in der Tabelle mit den Staten (<!-- Expense Table -->) für Geldstrafen aus. Nur Sachstrafen sollen sich manuell erledigen lassen. Geldstrafen werden später zentral über die Abrechnung des gesamten Tages erledigt.
|
||||
|
|
|
|||
|
|
@ -30,5 +30,19 @@ namespace Koogle.Domain.Entities
|
|||
/// reference to the participating Persons.
|
||||
/// </summary>
|
||||
public ICollection<GamePerson> GamePersons { get; set; } = new List<GamePerson>();
|
||||
|
||||
|
||||
// Zuordnungen
|
||||
|
||||
/// <summary>
|
||||
/// ID of the referenced Club.
|
||||
/// </summary>
|
||||
public Guid ClubId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// reference to the associated Club.
|
||||
/// </summary>
|
||||
public Club Club { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
922
src/Koogle.Infrastructure/Data/Migrations/20251226091512_GameClubRelation.Designer.cs
generated
Normal file
922
src/Koogle.Infrastructure/Data/Migrations/20251226091512_GameClubRelation.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,922 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using KoogleApp.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Koogle.Infrastructure.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20251226091512_GameClubRelation")]
|
||||
partial class GameClubRelation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("app")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Club", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("ExpenseCalculation")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name");
|
||||
|
||||
b.ToTable("Clubs", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.ClubInvitation", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("ExpiresAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int?>("MaxUses")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Token")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<int>("UsedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("Token")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ClubInvitations", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Day", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClubId1")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("PostDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId1");
|
||||
|
||||
b.HasIndex("ClubId", "PostDate");
|
||||
|
||||
b.ToTable("Days", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.DayPerson", b =>
|
||||
{
|
||||
b.Property<Guid>("DayId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PersonId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("DayId", "PersonId");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("DayId");
|
||||
|
||||
b.HasIndex("PersonId");
|
||||
|
||||
b.HasIndex("DayId", "ClubId");
|
||||
|
||||
b.HasIndex("PersonId", "ClubId");
|
||||
|
||||
b.ToTable("DayPersons", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Expense", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClubId1")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<int>("ExpenseType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInverse")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsOneClick")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsVariable")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("ClubId1");
|
||||
|
||||
b.HasIndex("ClubId", "Name");
|
||||
|
||||
b.ToTable("Expenses", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.ExpenseTrigger", b =>
|
||||
{
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ExpenseId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("TriggerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("AssignedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("SYSUTCDATETIME()");
|
||||
|
||||
b.Property<Guid>("AssignedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("ClubId", "ExpenseId", "TriggerId");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("ExpenseId");
|
||||
|
||||
b.HasIndex("TriggerId");
|
||||
|
||||
b.HasIndex("ExpenseId", "ClubId");
|
||||
|
||||
b.ToTable("ExpenseTriggers", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Game", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("DayId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("GameData")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("DayId");
|
||||
|
||||
b.ToTable("Games", "app", t =>
|
||||
{
|
||||
t.HasCheckConstraint("CK_Games_GameData_IsJson", "ISJSON([GameData]) > 0");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.GamePerson", b =>
|
||||
{
|
||||
b.Property<Guid>("GameId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PersonId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("GameId", "PersonId");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.HasIndex("PersonId");
|
||||
|
||||
b.ToTable("GamePersons", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Person", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClubId1")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<int>("PersonStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("ClubId1");
|
||||
|
||||
b.ToTable("Persons", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.PersonExpense", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("AssignedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("DayId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ExpenseId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("ExpenseType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("GameId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<int>("PersonExpenseStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("PersonId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("DayId");
|
||||
|
||||
b.HasIndex("ExpenseId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.HasIndex("PersonId", "DayId");
|
||||
|
||||
b.ToTable("PersonExpenses", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Trigger", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("ExpenseTriggerType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExpenseTriggerType");
|
||||
|
||||
b.ToTable("Triggers", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfile", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid>("IdentityUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Locale")
|
||||
.HasMaxLength(20)
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(20)");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TimeZone")
|
||||
.HasMaxLength(64)
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityUserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("UserProfiles", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b =>
|
||||
{
|
||||
b.Property<Guid>("UserProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("ApprovedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ApprovedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("AssignedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("SYSUTCDATETIME()");
|
||||
|
||||
b.Property<Guid>("AssignedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClubId1")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDefault")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("RejectedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("RejectedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("RejectionReason")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("UserProfileId", "ClubId");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("ClubId1");
|
||||
|
||||
b.HasIndex("UserProfileId")
|
||||
.IsUnique()
|
||||
.HasFilter("[IsDefault] = 1");
|
||||
|
||||
b.ToTable("UserProfileClubs", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClubRoleAssignment", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("AssignedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("SYSUTCDATETIME()");
|
||||
|
||||
b.Property<Guid>("AssignedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ModifiedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ModifiedById")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid>("UserProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.HasIndex("UserProfileId", "ClubId", "RoleId")
|
||||
.IsUnique()
|
||||
.HasFilter("[IsDeleted] = 0");
|
||||
|
||||
b.ToTable("UserProfileClubRoleAssignments", "app");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.ClubInvitation", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Day", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Club", null)
|
||||
.WithMany("Days")
|
||||
.HasForeignKey("ClubId1");
|
||||
|
||||
b.Navigation("Club");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.DayPerson", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Day", "Day")
|
||||
.WithMany("DayPersons")
|
||||
.HasForeignKey("DayId", "ClubId")
|
||||
.HasPrincipalKey("Id", "ClubId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Person", "Person")
|
||||
.WithMany("DayPersons")
|
||||
.HasForeignKey("PersonId", "ClubId")
|
||||
.HasPrincipalKey("Id", "ClubId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Day");
|
||||
|
||||
b.Navigation("Person");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Expense", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Club", null)
|
||||
.WithMany("Expenses")
|
||||
.HasForeignKey("ClubId1");
|
||||
|
||||
b.Navigation("Club");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.ExpenseTrigger", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Trigger", "Trigger")
|
||||
.WithMany()
|
||||
.HasForeignKey("TriggerId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Expense", "Expense")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExpenseId", "ClubId")
|
||||
.HasPrincipalKey("Id", "ClubId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Expense");
|
||||
|
||||
b.Navigation("Trigger");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Game", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Day", "Day")
|
||||
.WithMany()
|
||||
.HasForeignKey("DayId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Day");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.GamePerson", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Game", "Game")
|
||||
.WithMany("GamePersons")
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Person", "Person")
|
||||
.WithMany()
|
||||
.HasForeignKey("PersonId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Game");
|
||||
|
||||
b.Navigation("Person");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Person", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Club", null)
|
||||
.WithMany("Persons")
|
||||
.HasForeignKey("ClubId1");
|
||||
|
||||
b.Navigation("Club");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.PersonExpense", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Day", "Day")
|
||||
.WithMany()
|
||||
.HasForeignKey("DayId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Expense", "Expense")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExpenseId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Game", "Game")
|
||||
.WithMany()
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Person", "Person")
|
||||
.WithMany("Expenses")
|
||||
.HasForeignKey("PersonId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Day");
|
||||
|
||||
b.Navigation("Expense");
|
||||
|
||||
b.Navigation("Game");
|
||||
|
||||
b.Navigation("Person");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Club", null)
|
||||
.WithMany("Users")
|
||||
.HasForeignKey("ClubId1");
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.UserProfile", "UserProfile")
|
||||
.WithMany("Clubs")
|
||||
.HasForeignKey("UserProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("UserProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClubRoleAssignment", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.UserProfileClub", "UserProfileClub")
|
||||
.WithMany("RoleAssignments")
|
||||
.HasForeignKey("UserProfileId", "ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("UserProfileClub");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Club", b =>
|
||||
{
|
||||
b.Navigation("Days");
|
||||
|
||||
b.Navigation("Expenses");
|
||||
|
||||
b.Navigation("Persons");
|
||||
|
||||
b.Navigation("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Day", b =>
|
||||
{
|
||||
b.Navigation("DayPersons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Game", b =>
|
||||
{
|
||||
b.Navigation("GamePersons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Person", b =>
|
||||
{
|
||||
b.Navigation("DayPersons");
|
||||
|
||||
b.Navigation("Expenses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfile", b =>
|
||||
{
|
||||
b.Navigation("Clubs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b =>
|
||||
{
|
||||
b.Navigation("RoleAssignments");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Koogle.Infrastructure.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class GameClubRelation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ClubId",
|
||||
schema: "app",
|
||||
table: "Games",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Games_ClubId",
|
||||
schema: "app",
|
||||
table: "Games",
|
||||
column: "ClubId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Games_Clubs_ClubId",
|
||||
schema: "app",
|
||||
table: "Games",
|
||||
column: "ClubId",
|
||||
principalSchema: "app",
|
||||
principalTable: "Clubs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Games_Clubs_ClubId",
|
||||
schema: "app",
|
||||
table: "Games");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Games_ClubId",
|
||||
schema: "app",
|
||||
table: "Games");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ClubId",
|
||||
schema: "app",
|
||||
table: "Games");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -277,6 +277,9 @@ namespace Koogle.Infrastructure.Data.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ClubId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
|
|
@ -301,6 +304,8 @@ namespace Koogle.Infrastructure.Data.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClubId");
|
||||
|
||||
b.HasIndex("DayId");
|
||||
|
||||
b.ToTable("Games", "app", t =>
|
||||
|
|
@ -736,12 +741,20 @@ namespace Koogle.Infrastructure.Data.Migrations
|
|||
|
||||
modelBuilder.Entity("Koogle.Domain.Entities.Game", b =>
|
||||
{
|
||||
b.HasOne("Koogle.Domain.Entities.Club", "Club")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClubId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Koogle.Domain.Entities.Day", "Day")
|
||||
.WithMany()
|
||||
.HasForeignKey("DayId")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Club");
|
||||
|
||||
b.Navigation("Day");
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue