fix: tenants 联系电话唯一索引
This commit is contained in:
@@ -458,6 +458,7 @@ public sealed class TakeoutAppDbContext(
|
|||||||
builder.Property(x => x.LogoUrl).HasMaxLength(256);
|
builder.Property(x => x.LogoUrl).HasMaxLength(256);
|
||||||
builder.Property(x => x.Remarks).HasMaxLength(512);
|
builder.Property(x => x.Remarks).HasMaxLength(512);
|
||||||
builder.HasIndex(x => x.Code).IsUnique();
|
builder.HasIndex(x => x.Code).IsUnique();
|
||||||
|
builder.HasIndex(x => x.ContactPhone).IsUnique();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ConfigureTenantVerificationProfile(EntityTypeBuilder<TenantVerificationProfile> builder)
|
private static void ConfigureTenantVerificationProfile(EntityTypeBuilder<TenantVerificationProfile> builder)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace TakeoutSaaS.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddTenantContactPhoneUniqueIndex : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_tenants_ContactPhone",
|
||||||
|
table: "tenants",
|
||||||
|
column: "ContactPhone",
|
||||||
|
unique: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_tenants_ContactPhone",
|
||||||
|
table: "tenants");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5821,6 +5821,9 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
|||||||
b.HasIndex("Code")
|
b.HasIndex("Code")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("ContactPhone")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("tenants", null, t =>
|
b.ToTable("tenants", null, t =>
|
||||||
{
|
{
|
||||||
t.HasComment("平台租户信息,描述租户的生命周期与基础资料。");
|
t.HasComment("平台租户信息,描述租户的生命周期与基础资料。");
|
||||||
@@ -6247,12 +6250,6 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
|||||||
.HasColumnType("boolean")
|
.HasColumnType("boolean")
|
||||||
.HasComment("是否仍可售卖。");
|
.HasComment("是否仍可售卖。");
|
||||||
|
|
||||||
b.Property<int>("SortOrder")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasDefaultValue(0)
|
|
||||||
.HasComment("展示排序,数值越小越靠前。");
|
|
||||||
|
|
||||||
b.Property<int?>("MaxAccountCount")
|
b.Property<int?>("MaxAccountCount")
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasComment("允许创建的最大账号数。");
|
.HasComment("允许创建的最大账号数。");
|
||||||
@@ -6287,6 +6284,12 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasComment("套餐分类(试用、标准、旗舰等)。");
|
.HasComment("套餐分类(试用、标准、旗舰等)。");
|
||||||
|
|
||||||
|
b.Property<int>("SortOrder")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasDefaultValue(0)
|
||||||
|
.HasComment("展示排序,数值越小越靠前。");
|
||||||
|
|
||||||
b.Property<DateTime?>("UpdatedAt")
|
b.Property<DateTime?>("UpdatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
|
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
|
||||||
|
|||||||
Reference in New Issue
Block a user