添加项目文件。
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
// <auto-generated />
|
||||
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
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTimeOffset?>("Deletion")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("ModificationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("RemarkName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("friends", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ContactService.Domain.Entities.FriendRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTimeOffset?>("Deletion")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("ModificationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("OwnerId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("RemarkName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("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<Guid>("FriendId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b1.Property<string>("Avatar")
|
||||
.HasColumnType("longtext")
|
||||
.HasColumnName("OwnerAvatarUrl");
|
||||
|
||||
b1.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("OwnerId");
|
||||
|
||||
b1.Property<string>("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<Guid>("FriendId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b1.Property<string>("Avatar")
|
||||
.HasColumnType("longtext")
|
||||
.HasColumnName("TargetAvatarUrl");
|
||||
|
||||
b1.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("TargetId");
|
||||
|
||||
b1.Property<string>("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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ContactService.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitDb : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterDatabase()
|
||||
.Annotation("MySql:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "friend_requests",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
OwnerId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
TargetId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
Description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
State = table.Column<int>(type: "int", nullable: false),
|
||||
RemarkName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
CreationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
|
||||
Deletion = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
|
||||
ModificationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_friend_requests", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "friends",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
OwnerId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
OwnerNickName = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
OwnerAvatarUrl = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
TargetId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
TargetNickName = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
TargetAvatarUrl = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
RemarkName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:Charset", "utf8mb4"),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
CreationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
|
||||
Deletion = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
|
||||
ModificationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_friends", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_friend_requests_OwnerId_TargetId",
|
||||
table: "friend_requests",
|
||||
columns: new[] { "OwnerId", "TargetId" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "friend_requests");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "friends");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ContactService.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ContactService.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(ContactDbContext))]
|
||||
partial class ContactDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTimeOffset?>("Deletion")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("ModificationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("RemarkName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("friends", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ContactService.Domain.Entities.FriendRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTimeOffset?>("Deletion")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("ModificationTime")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("OwnerId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("RemarkName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("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<Guid>("FriendId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b1.Property<string>("Avatar")
|
||||
.HasColumnType("longtext")
|
||||
.HasColumnName("OwnerAvatarUrl");
|
||||
|
||||
b1.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("OwnerId");
|
||||
|
||||
b1.Property<string>("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<Guid>("FriendId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b1.Property<string>("Avatar")
|
||||
.HasColumnType("longtext")
|
||||
.HasColumnName("TargetAvatarUrl");
|
||||
|
||||
b1.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("TargetId");
|
||||
|
||||
b1.Property<string>("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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user