Started work on giveaways, not completed

This commit is contained in:
Kwoth
2024-04-24 16:31:51 +00:00
parent 08d8da25cd
commit 59b9742c19
25 changed files with 11667 additions and 11 deletions

View File

@@ -493,6 +493,25 @@ public abstract class NadekoContext : DbContext
}).IsUnique());
#endregion
#region Giveaway
modelBuilder.Entity<GiveawayModel>()
.HasMany(x => x.Participants)
.WithOne()
.HasForeignKey(x => x.GiveawayId)
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<GiveawayUser>(gu => gu
.HasIndex(x => new
{
x.GiveawayId,
x.UserId
})
.IsUnique());
#endregion
}
#if DEBUG