//
using System;
using ContactService.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace ContactService.Infrastructure.Migrations
{
[DbContext(typeof(ContactDbContext))]
[Migration("20260413114340_InitDb")]
partial class InitDb
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("ContactService.Domain.Entities.Friend", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreationTime")
.HasColumnType("datetime(6)");
b.Property("Deletion")
.HasColumnType("datetime(6)");
b.Property("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property("ModificationTime")
.HasColumnType("datetime(6)");
b.Property("RemarkName")
.HasColumnType("longtext");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("friends", (string)null);
});
modelBuilder.Entity("ContactService.Domain.Entities.FriendRequest", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreationTime")
.HasColumnType("datetime(6)");
b.Property("Deletion")
.HasColumnType("datetime(6)");
b.Property("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property("ModificationTime")
.HasColumnType("datetime(6)");
b.Property("OwnerId")
.HasColumnType("char(36)");
b.Property("RemarkName")
.HasColumnType("longtext");
b.Property("State")
.HasColumnType("int");
b.Property("TargetId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("OwnerId", "TargetId");
b.ToTable("friend_requests", (string)null);
});
modelBuilder.Entity("ContactService.Domain.Entities.Friend", b =>
{
b.OwnsOne("ContactService.Domain.ValueObjects.UserProfile", "Owner", b1 =>
{
b1.Property("FriendId")
.HasColumnType("char(36)");
b1.Property("Avatar")
.HasColumnType("longtext")
.HasColumnName("OwnerAvatarUrl");
b1.Property("Id")
.HasColumnType("char(36)")
.HasColumnName("OwnerId");
b1.Property("NickName")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("OwnerNickName");
b1.HasKey("FriendId");
b1.ToTable("friends");
b1.WithOwner()
.HasForeignKey("FriendId");
});
b.OwnsOne("ContactService.Domain.ValueObjects.UserProfile", "Target", b1 =>
{
b1.Property("FriendId")
.HasColumnType("char(36)");
b1.Property("Avatar")
.HasColumnType("longtext")
.HasColumnName("TargetAvatarUrl");
b1.Property("Id")
.HasColumnType("char(36)")
.HasColumnName("TargetId");
b1.Property("NickName")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("TargetNickName");
b1.HasKey("FriendId");
b1.ToTable("friends");
b1.WithOwner()
.HasForeignKey("FriendId");
});
b.Navigation("Owner")
.IsRequired();
b.Navigation("Target")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}