add: migrations

This commit is contained in:
于鹏
2025-10-26 14:43:57 +08:00
parent 79171b51b2
commit 931ecbd4bc
3 changed files with 2408 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace KonSoft.Admin.Migrations
{
/// <inheritdoc />
public partial class V101 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "WorkerId",
table: "AppOrder",
newName: "HouseholdWorkerId");
migrationBuilder.CreateIndex(
name: "IX_AppOrder_CustomerId",
table: "AppOrder",
column: "CustomerId");
migrationBuilder.CreateIndex(
name: "IX_AppOrder_HouseholdWorkerId",
table: "AppOrder",
column: "HouseholdWorkerId");
migrationBuilder.AddForeignKey(
name: "FK_AppOrder_AbpUsers_CustomerId",
table: "AppOrder",
column: "CustomerId",
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AppOrder_AbpUsers_HouseholdWorkerId",
table: "AppOrder",
column: "HouseholdWorkerId",
principalTable: "AbpUsers",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AppOrder_AbpUsers_CustomerId",
table: "AppOrder");
migrationBuilder.DropForeignKey(
name: "FK_AppOrder_AbpUsers_HouseholdWorkerId",
table: "AppOrder");
migrationBuilder.DropIndex(
name: "IX_AppOrder_CustomerId",
table: "AppOrder");
migrationBuilder.DropIndex(
name: "IX_AppOrder_HouseholdWorkerId",
table: "AppOrder");
migrationBuilder.RenameColumn(
name: "HouseholdWorkerId",
table: "AppOrder",
newName: "WorkerId");
}
}
}

View File

@ -68,6 +68,9 @@ namespace KonSoft.Admin.Migrations
.HasColumnType("text") .HasColumnType("text")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
b.Property<Guid?>("HouseholdWorkerId")
.HasColumnType("uuid");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("boolean") .HasColumnType("boolean")
@ -101,9 +104,6 @@ namespace KonSoft.Admin.Migrations
b.Property<int>("Status") b.Property<int>("Status")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<Guid?>("WorkerId")
.HasColumnType("uuid");
b.ComplexProperty<Dictionary<string, object>>("Address", "KonSoft.Admin.Entities.Order.Address#AddressInfo", b1 => b.ComplexProperty<Dictionary<string, object>>("Address", "KonSoft.Admin.Entities.Order.Address#AddressInfo", b1 =>
{ {
b1.IsRequired(); b1.IsRequired();
@ -131,6 +131,10 @@ namespace KonSoft.Admin.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CustomerId");
b.HasIndex("HouseholdWorkerId");
b.ToTable("AppOrder", (string)null); b.ToTable("AppOrder", (string)null);
}); });
@ -2104,6 +2108,23 @@ namespace KonSoft.Admin.Migrations
b.HasDiscriminator().HasValue("HouseholdWorker"); b.HasDiscriminator().HasValue("HouseholdWorker");
}); });
modelBuilder.Entity("KonSoft.Admin.Entities.Order", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", "Customer")
.WithMany()
.HasForeignKey("CustomerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Abp.Identity.IdentityUser", "HouseholdWorker")
.WithMany()
.HasForeignKey("HouseholdWorkerId");
b.Navigation("Customer");
b.Navigation("HouseholdWorker");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{ {
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)