🐛 Fix account profile relationship

This commit is contained in:
2025-05-22 02:12:48 +08:00
parent aa0d2ab3c4
commit 8e8a120a90
5 changed files with 3517 additions and 19 deletions

View File

@ -529,6 +529,7 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
@ -603,6 +604,10 @@ namespace DysonNetwork.Sphere.Migrations
b.HasKey("Id")
.HasName("pk_account_profiles");
b.HasIndex("AccountId")
.IsUnique()
.HasDatabaseName("ix_account_profiles_account_id");
b.HasIndex("BackgroundId")
.HasDatabaseName("ix_account_profiles_background_id");
@ -2699,18 +2704,18 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithOne("Profile")
.HasForeignKey("DysonNetwork.Sphere.Account.Profile", "AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_account_profiles_accounts_account_id");
b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background")
.WithMany()
.HasForeignKey("BackgroundId")
.HasConstraintName("fk_account_profiles_files_background_id");
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithOne("Profile")
.HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_account_profiles_accounts_id");
b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture")
.WithMany()
.HasForeignKey("PictureId")