Fix .gitignore excluding Data source folder
Build & Push Docker image / test (push) Successful in 40s
Build & Push Docker image / docker (push) Failing after 3m59s

The ignore rule `src/WishNinja/Data/` accidentally excluded the EF Core
DbContext, entities, and migrations from the repo, breaking the CI build
(WishNinja.Data namespace not found). Narrow the rule to ignore only the
runtime artifacts (db/keys/uploads) and commit the missing source.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Jim Basso
2026-06-11 14:11:34 -05:00
co-authored by Claude Opus 4.8
parent 48e13c4b57
commit b42799df42
12 changed files with 1949 additions and 5 deletions
+8 -5
View File
@@ -4,12 +4,15 @@ obj/
*.user
## Local runtime data (db, uploads, data-protection keys)
data/
**/Data/*.db
**/Data/*.db-shm
**/Data/*.db-wal
## NOTE: src/WishNinja/Data/ holds SOURCE (DbContext, entities, migrations) and must be
## committed — only ignore the runtime artifacts that land inside it during local dev.
/data/
*.db
*.db-shm
*.db-wal
src/WishNinja/smoke-data/
src/WishNinja/Data/
src/WishNinja/Data/uploads/
src/WishNinja/Data/keys/
## IDE
.vs/
@@ -0,0 +1,81 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using WishNinja.Data.Entities;
namespace WishNinja.Data;
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext<ApplicationUser>(options)
{
public DbSet<Wishlist> Wishlists => Set<Wishlist>();
public DbSet<WishlistShare> WishlistShares => Set<WishlistShare>();
public DbSet<WishlistItem> WishlistItems => Set<WishlistItem>();
public DbSet<Claim> Claims => Set<Claim>();
public DbSet<Invite> Invites => Set<Invite>();
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.Entity<Wishlist>(e =>
{
e.HasOne(w => w.Owner)
.WithMany()
.HasForeignKey(w => w.OwnerId)
.OnDelete(DeleteBehavior.Cascade);
e.HasMany(w => w.Items)
.WithOne(i => i.Wishlist!)
.HasForeignKey(i => i.WishlistId)
.OnDelete(DeleteBehavior.Cascade);
e.HasMany(w => w.Shares)
.WithOne(s => s.Wishlist!)
.HasForeignKey(s => s.WishlistId)
.OnDelete(DeleteBehavior.Cascade);
e.HasIndex(w => w.OwnerId);
});
builder.Entity<WishlistShare>(e =>
{
e.HasOne(s => s.User)
.WithMany()
.HasForeignKey(s => s.UserId)
.OnDelete(DeleteBehavior.Cascade);
e.HasIndex(s => new { s.WishlistId, s.UserId }).IsUnique();
});
builder.Entity<WishlistItem>(e =>
{
e.HasMany(i => i.Claims)
.WithOne(c => c.WishlistItem!)
.HasForeignKey(c => c.WishlistItemId)
.OnDelete(DeleteBehavior.Cascade);
e.Property(i => i.Price).HasColumnType("decimal(18,2)");
e.HasIndex(i => i.WishlistId);
});
builder.Entity<Claim>(e =>
{
e.HasOne(c => c.ClaimedByUser)
.WithMany()
.HasForeignKey(c => c.ClaimedByUserId)
.OnDelete(DeleteBehavior.Cascade);
e.HasIndex(c => c.WishlistItemId);
});
builder.Entity<Invite>(e =>
{
e.HasOne(i => i.InvitedByUser)
.WithMany()
.HasForeignKey(i => i.InvitedByUserId)
.OnDelete(DeleteBehavior.Restrict);
e.HasIndex(i => i.TokenHash);
e.HasIndex(i => i.Email);
});
}
}
+15
View File
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Identity;
namespace WishNinja.Data;
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
/// <summary>Friendly name shown throughout the app (e.g. on shared wishlists).</summary>
public string DisplayName { get; set; } = string.Empty;
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
/// <summary>When set, the account is disabled and cannot sign in.</summary>
public bool IsDisabled { get; set; }
}
+26
View File
@@ -0,0 +1,26 @@
using System.ComponentModel.DataAnnotations;
namespace WishNinja.Data.Entities;
/// <summary>
/// A reservation of (part of) a wishlist item by a non-owner. Crucially, claim data is never
/// surfaced to the list owner so the surprise is preserved.
/// </summary>
public class Claim
{
public int Id { get; set; }
public int WishlistItemId { get; set; }
public WishlistItem? WishlistItem { get; set; }
public string ClaimedByUserId { get; set; } = string.Empty;
public ApplicationUser? ClaimedByUser { get; set; }
/// <summary>How many units this claim covers (>= 1).</summary>
public int Quantity { get; set; } = 1;
[MaxLength(500)]
public string? Note { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
}
+21
View File
@@ -0,0 +1,21 @@
namespace WishNinja.Data.Entities;
/// <summary>Who is allowed to view a wishlist.</summary>
public enum WishlistVisibility
{
/// <summary>Visible to every signed-in member of the instance.</summary>
AllMembers = 0,
/// <summary>Visible only to users named in <see cref="WishlistShare"/> rows.</summary>
SpecificUsers = 1,
}
/// <summary>How an item's image is stored. Images are always stored locally — URLs entered in the
/// UI are downloaded and saved as uploaded files, so there is no external-reference kind.</summary>
public enum ImageKind
{
None = 0,
/// <summary>File stored locally under the uploads directory; see <see cref="WishlistItem.ImagePath"/>.</summary>
Uploaded = 1,
}
+32
View File
@@ -0,0 +1,32 @@
using System.ComponentModel.DataAnnotations;
namespace WishNinja.Data.Entities;
/// <summary>
/// An admin-issued invitation. The raw token is emailed to the recipient; only its hash is stored.
/// Single-use: <see cref="AcceptedAt"/> is set once redeemed.
/// </summary>
public class Invite
{
public int Id { get; set; }
[Required, MaxLength(256)]
public string Email { get; set; } = string.Empty;
/// <summary>SHA-256 hash (Base64) of the raw token. The raw token is never persisted.</summary>
[Required, MaxLength(64)]
public string TokenHash { get; set; } = string.Empty;
/// <summary>Identity role granted on acceptance (e.g. "User" or "Admin").</summary>
[Required, MaxLength(64)]
public string Role { get; set; } = "User";
public string InvitedByUserId { get; set; } = string.Empty;
public ApplicationUser? InvitedByUser { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset ExpiresAt { get; set; }
public DateTimeOffset? AcceptedAt { get; set; }
public bool IsAccepted => AcceptedAt is not null;
}
+29
View File
@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
namespace WishNinja.Data.Entities;
public class Wishlist
{
public int Id { get; set; }
/// <summary>Owner of the list. The owner never sees claim information for their own items.</summary>
public string OwnerId { get; set; } = string.Empty;
public ApplicationUser? Owner { get; set; }
[Required, MaxLength(200)]
public string Title { get; set; } = string.Empty;
[MaxLength(2000)]
public string? Description { get; set; }
public WishlistVisibility Visibility { get; set; } = WishlistVisibility.AllMembers;
public bool IsArchived { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public List<WishlistItem> Items { get; set; } = new();
/// <summary>Explicit shares; only meaningful when <see cref="Visibility"/> is SpecificUsers.</summary>
public List<WishlistShare> Shares { get; set; } = new();
}
@@ -0,0 +1,41 @@
using System.ComponentModel.DataAnnotations;
namespace WishNinja.Data.Entities;
public class WishlistItem
{
public int Id { get; set; }
public int WishlistId { get; set; }
public Wishlist? Wishlist { get; set; }
[Required, MaxLength(300)]
public string Name { get; set; } = string.Empty;
[MaxLength(2000)]
public string? Description { get; set; }
/// <summary>Link to the product/store page.</summary>
[MaxLength(2000)]
public string? ProductUrl { get; set; }
public ImageKind ImageKind { get; set; } = ImageKind.None;
/// <summary>Relative file name within the uploads directory when <see cref="ImageKind"/> is Uploaded.</summary>
[MaxLength(260)]
public string? ImagePath { get; set; }
public decimal? Price { get; set; }
/// <summary>1 = highest priority. Lower sorts first within a list.</summary>
public int Priority { get; set; } = 3;
/// <summary>How many of this item are wanted. Claims are capped at this quantity.</summary>
public int Quantity { get; set; } = 1;
public int SortOrder { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public List<Claim> Claims { get; set; } = new();
}
@@ -0,0 +1,13 @@
namespace WishNinja.Data.Entities;
/// <summary>Grants a specific user view access to a wishlist whose visibility is SpecificUsers.</summary>
public class WishlistShare
{
public int Id { get; set; }
public int WishlistId { get; set; }
public Wishlist? Wishlist { get; set; }
public string UserId { get; set; } = string.Empty;
public ApplicationUser? User { get; set; }
}
@@ -0,0 +1,620 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WishNinja.Data;
#nullable disable
namespace WishNinja.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260610205250_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey<string>", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("BLOB");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("AspNetUserPasskeys", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("WishNinja.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("IsDisabled")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("WishNinja.Data.Entities.Claim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimedByUserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Note")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.Property<int>("WishlistItemId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ClaimedByUserId");
b.HasIndex("WishlistItemId");
b.ToTable("Claims");
});
modelBuilder.Entity("WishNinja.Data.Entities.Invite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("AcceptedAt")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("ExpiresAt")
.HasColumnType("TEXT");
b.Property<string>("InvitedByUserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Role")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("TokenHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("InvitedByUserId");
b.HasIndex("TokenHash");
b.ToTable("Invites");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<bool>("IsArchived")
.HasColumnType("INTEGER");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<int>("Visibility")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.ToTable("Wishlists");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<int>("ImageKind")
.HasColumnType("INTEGER");
b.Property<string>("ImagePath")
.HasMaxLength(260)
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("TEXT");
b.Property<decimal?>("Price")
.HasColumnType("decimal(18,2)");
b.Property<int>("Priority")
.HasColumnType("INTEGER");
b.Property<string>("ProductUrl")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<int>("WishlistId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("WishlistId");
b.ToTable("WishlistItems");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistShare", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("WishlistId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("WishlistId", "UserId")
.IsUnique();
b.ToTable("WishlistShares");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 =>
{
b1.Property<byte[]>("IdentityUserPasskeyCredentialId");
b1.Property<byte[]>("AttestationObject")
.IsRequired();
b1.Property<byte[]>("ClientDataJson")
.IsRequired();
b1.Property<DateTimeOffset>("CreatedAt");
b1.Property<bool>("IsBackedUp");
b1.Property<bool>("IsBackupEligible");
b1.Property<bool>("IsUserVerified");
b1.Property<string>("Name");
b1.Property<byte[]>("PublicKey")
.IsRequired();
b1.Property<uint>("SignCount");
b1.PrimitiveCollection<string>("Transports");
b1.HasKey("IdentityUserPasskeyCredentialId");
b1.ToTable("AspNetUserPasskeys");
b1
.ToJson("Data")
.HasColumnType("TEXT");
b1.WithOwner()
.HasForeignKey("IdentityUserPasskeyCredentialId");
});
b.Navigation("Data")
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("WishNinja.Data.Entities.Claim", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "ClaimedByUser")
.WithMany()
.HasForeignKey("ClaimedByUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.Entities.WishlistItem", "WishlistItem")
.WithMany("Claims")
.HasForeignKey("WishlistItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClaimedByUser");
b.Navigation("WishlistItem");
});
modelBuilder.Entity("WishNinja.Data.Entities.Invite", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "InvitedByUser")
.WithMany()
.HasForeignKey("InvitedByUserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("InvitedByUser");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "Owner")
.WithMany()
.HasForeignKey("OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Owner");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.HasOne("WishNinja.Data.Entities.Wishlist", "Wishlist")
.WithMany("Items")
.HasForeignKey("WishlistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Wishlist");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistShare", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.Entities.Wishlist", "Wishlist")
.WithMany("Shares")
.HasForeignKey("WishlistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
b.Navigation("Wishlist");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.Navigation("Items");
b.Navigation("Shares");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.Navigation("Claims");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,446 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WishNinja.Data.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
DisplayName = table.Column<string>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
IsDisabled = table.Column<bool>(type: "INTEGER", nullable: false),
UserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumber = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RoleId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
UserId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
ProviderKey = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
ProviderDisplayName = table.Column<string>(type: "TEXT", nullable: true),
UserId = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserPasskeys",
columns: table => new
{
CredentialId = table.Column<byte[]>(type: "BLOB", maxLength: 1024, nullable: false),
UserId = table.Column<string>(type: "TEXT", nullable: false),
Data = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserPasskeys", x => x.CredentialId);
table.ForeignKey(
name: "FK_AspNetUserPasskeys_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<string>(type: "TEXT", nullable: false),
RoleId = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<string>(type: "TEXT", nullable: false),
LoginProvider = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Invites",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
TokenHash = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
Role = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
InvitedByUserId = table.Column<string>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
ExpiresAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
AcceptedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Invites", x => x.Id);
table.ForeignKey(
name: "FK_Invites_AspNetUsers_InvitedByUserId",
column: x => x.InvitedByUserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Wishlists",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
OwnerId = table.Column<string>(type: "TEXT", nullable: false),
Title = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
Visibility = table.Column<int>(type: "INTEGER", nullable: false),
IsArchived = table.Column<bool>(type: "INTEGER", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Wishlists", x => x.Id);
table.ForeignKey(
name: "FK_Wishlists_AspNetUsers_OwnerId",
column: x => x.OwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "WishlistItems",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
WishlistId = table.Column<int>(type: "INTEGER", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 300, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
ProductUrl = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
ImageKind = table.Column<int>(type: "INTEGER", nullable: false),
ImagePath = table.Column<string>(type: "TEXT", maxLength: 260, nullable: true),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
Priority = table.Column<int>(type: "INTEGER", nullable: false),
Quantity = table.Column<int>(type: "INTEGER", nullable: false),
SortOrder = table.Column<int>(type: "INTEGER", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WishlistItems", x => x.Id);
table.ForeignKey(
name: "FK_WishlistItems_Wishlists_WishlistId",
column: x => x.WishlistId,
principalTable: "Wishlists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "WishlistShares",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
WishlistId = table.Column<int>(type: "INTEGER", nullable: false),
UserId = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WishlistShares", x => x.Id);
table.ForeignKey(
name: "FK_WishlistShares_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_WishlistShares_Wishlists_WishlistId",
column: x => x.WishlistId,
principalTable: "Wishlists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Claims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
WishlistItemId = table.Column<int>(type: "INTEGER", nullable: false),
ClaimedByUserId = table.Column<string>(type: "TEXT", nullable: false),
Quantity = table.Column<int>(type: "INTEGER", nullable: false),
Note = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Claims", x => x.Id);
table.ForeignKey(
name: "FK_Claims_AspNetUsers_ClaimedByUserId",
column: x => x.ClaimedByUserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Claims_WishlistItems_WishlistItemId",
column: x => x.WishlistItemId,
principalTable: "WishlistItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserPasskeys_UserId",
table: "AspNetUserPasskeys",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Claims_ClaimedByUserId",
table: "Claims",
column: "ClaimedByUserId");
migrationBuilder.CreateIndex(
name: "IX_Claims_WishlistItemId",
table: "Claims",
column: "WishlistItemId");
migrationBuilder.CreateIndex(
name: "IX_Invites_Email",
table: "Invites",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_Invites_InvitedByUserId",
table: "Invites",
column: "InvitedByUserId");
migrationBuilder.CreateIndex(
name: "IX_Invites_TokenHash",
table: "Invites",
column: "TokenHash");
migrationBuilder.CreateIndex(
name: "IX_WishlistItems_WishlistId",
table: "WishlistItems",
column: "WishlistId");
migrationBuilder.CreateIndex(
name: "IX_Wishlists_OwnerId",
table: "Wishlists",
column: "OwnerId");
migrationBuilder.CreateIndex(
name: "IX_WishlistShares_UserId",
table: "WishlistShares",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_WishlistShares_WishlistId_UserId",
table: "WishlistShares",
columns: new[] { "WishlistId", "UserId" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserPasskeys");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "Claims");
migrationBuilder.DropTable(
name: "Invites");
migrationBuilder.DropTable(
name: "WishlistShares");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "WishlistItems");
migrationBuilder.DropTable(
name: "Wishlists");
migrationBuilder.DropTable(
name: "AspNetUsers");
}
}
}
@@ -0,0 +1,617 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WishNinja.Data;
#nullable disable
namespace WishNinja.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey<string>", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("BLOB");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("AspNetUserPasskeys", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("WishNinja.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("IsDisabled")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("WishNinja.Data.Entities.Claim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimedByUserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Note")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.Property<int>("WishlistItemId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ClaimedByUserId");
b.HasIndex("WishlistItemId");
b.ToTable("Claims");
});
modelBuilder.Entity("WishNinja.Data.Entities.Invite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("AcceptedAt")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("ExpiresAt")
.HasColumnType("TEXT");
b.Property<string>("InvitedByUserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Role")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("TokenHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("InvitedByUserId");
b.HasIndex("TokenHash");
b.ToTable("Invites");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<bool>("IsArchived")
.HasColumnType("INTEGER");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<int>("Visibility")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.ToTable("Wishlists");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<int>("ImageKind")
.HasColumnType("INTEGER");
b.Property<string>("ImagePath")
.HasMaxLength(260)
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("TEXT");
b.Property<decimal?>("Price")
.HasColumnType("decimal(18,2)");
b.Property<int>("Priority")
.HasColumnType("INTEGER");
b.Property<string>("ProductUrl")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<int>("WishlistId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("WishlistId");
b.ToTable("WishlistItems");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistShare", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("WishlistId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("WishlistId", "UserId")
.IsUnique();
b.ToTable("WishlistShares");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 =>
{
b1.Property<byte[]>("IdentityUserPasskeyCredentialId");
b1.Property<byte[]>("AttestationObject")
.IsRequired();
b1.Property<byte[]>("ClientDataJson")
.IsRequired();
b1.Property<DateTimeOffset>("CreatedAt");
b1.Property<bool>("IsBackedUp");
b1.Property<bool>("IsBackupEligible");
b1.Property<bool>("IsUserVerified");
b1.Property<string>("Name");
b1.Property<byte[]>("PublicKey")
.IsRequired();
b1.Property<uint>("SignCount");
b1.PrimitiveCollection<string>("Transports");
b1.HasKey("IdentityUserPasskeyCredentialId");
b1.ToTable("AspNetUserPasskeys");
b1
.ToJson("Data")
.HasColumnType("TEXT");
b1.WithOwner()
.HasForeignKey("IdentityUserPasskeyCredentialId");
});
b.Navigation("Data")
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("WishNinja.Data.Entities.Claim", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "ClaimedByUser")
.WithMany()
.HasForeignKey("ClaimedByUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.Entities.WishlistItem", "WishlistItem")
.WithMany("Claims")
.HasForeignKey("WishlistItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClaimedByUser");
b.Navigation("WishlistItem");
});
modelBuilder.Entity("WishNinja.Data.Entities.Invite", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "InvitedByUser")
.WithMany()
.HasForeignKey("InvitedByUserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("InvitedByUser");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "Owner")
.WithMany()
.HasForeignKey("OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Owner");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.HasOne("WishNinja.Data.Entities.Wishlist", "Wishlist")
.WithMany("Items")
.HasForeignKey("WishlistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Wishlist");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistShare", b =>
{
b.HasOne("WishNinja.Data.ApplicationUser", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WishNinja.Data.Entities.Wishlist", "Wishlist")
.WithMany("Shares")
.HasForeignKey("WishlistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
b.Navigation("Wishlist");
});
modelBuilder.Entity("WishNinja.Data.Entities.Wishlist", b =>
{
b.Navigation("Items");
b.Navigation("Shares");
});
modelBuilder.Entity("WishNinja.Data.Entities.WishlistItem", b =>
{
b.Navigation("Claims");
});
#pragma warning restore 612, 618
}
}
}