//
using System;
using ApiTools.EntityFramework.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace ApiTools.Database.Migrations.Migrations
{
[DbContext(typeof(DefaultDbContext))]
[Migration("20251009023927_UpdateSmsSetting1009")]
partial class UpdateSmsSetting1009
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ApiTools.Core.Channel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Code")
.HasColumnType("nvarchar(max)");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsDisabled")
.HasColumnType("bit");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("Channel");
});
modelBuilder.Entity("ApiTools.Core.Resource", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("ActionName")
.HasColumnType("nvarchar(max)");
b.Property("ActionSummary")
.HasColumnType("nvarchar(max)");
b.Property("AllowAnonymous")
.HasColumnType("bit");
b.Property("ApplicationName")
.HasColumnType("nvarchar(max)");
b.Property("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ControllerName")
.HasColumnType("nvarchar(max)");
b.Property("ControllerSummary")
.HasColumnType("nvarchar(max)");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("CustomResponse")
.HasColumnType("bit");
b.Property("DynamicAssemblyName")
.HasColumnType("nvarchar(max)");
b.Property("FileUpload")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsExpired")
.HasColumnType("bit");
b.Property("IsFromForm")
.HasColumnType("bit");
b.Property("Method")
.HasColumnType("int");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("RequestTypeFullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("RequestTypeName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ResponseTypeFullName")
.HasColumnType("nvarchar(max)");
b.Property("ResponseTypeName")
.HasColumnType("nvarchar(max)");
b.Property("Route")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("RouteArea")
.HasColumnType("nvarchar(max)");
b.Property("ServiceName")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("Resource");
});
modelBuilder.Entity("ApiTools.Core.ScheduleJobDetail", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("AssemblyName")
.HasColumnType("nvarchar(max)");
b.Property("Concurrent")
.HasColumnType("bit");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("GroupName")
.HasColumnType("nvarchar(max)");
b.Property("IncludeAnnotations")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("JobId")
.HasColumnType("nvarchar(max)");
b.Property("JobType")
.HasColumnType("nvarchar(max)");
b.Property("Properties")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("ScheduleJobDetail");
});
modelBuilder.Entity("ApiTools.Core.ScheduleJobTrigger", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Args")
.HasColumnType("nvarchar(max)");
b.Property("AssemblyName")
.HasColumnType("nvarchar(max)");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("ElapsedTime")
.HasColumnType("bigint");
b.Property("EndTime")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("JobId")
.HasColumnType("nvarchar(max)");
b.Property("LastRunTime")
.HasColumnType("datetime2");
b.Property("MaxNumberOfErrors")
.HasColumnType("bigint");
b.Property("MaxNumberOfRuns")
.HasColumnType("bigint");
b.Property("NextRunTime")
.HasColumnType("datetime2");
b.Property("NumRetries")
.HasColumnType("bigint");
b.Property("NumberOfErrors")
.HasColumnType("bigint");
b.Property("NumberOfRuns")
.HasColumnType("bigint");
b.Property("ResetOnlyOnce")
.HasColumnType("bit");
b.Property("Result")
.HasColumnType("nvarchar(max)");
b.Property("RetryTimeout")
.HasColumnType("int");
b.Property("RunOnStart")
.HasColumnType("bit");
b.Property("Sort")
.HasColumnType("int");
b.Property("StartNow")
.HasColumnType("bit");
b.Property("StartTime")
.HasColumnType("datetime2");
b.Property("Status")
.HasColumnType("bigint");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("TriggerId")
.HasColumnType("nvarchar(max)");
b.Property("TriggerType")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("ScheduleJobTrigger");
});
modelBuilder.Entity("ApiTools.Core.SmsLog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Access")
.HasColumnType("int");
b.Property("ChannelCreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("ChannelId")
.HasColumnType("uniqueidentifier");
b.Property("Code")
.HasColumnType("nvarchar(max)");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("Expiry")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsUsed")
.HasColumnType("bit");
b.Property("Message")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.IsRequired()
.HasMaxLength(11)
.HasColumnType("nvarchar(11)");
b.Property("RequestId")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("Status")
.HasColumnType("int");
b.Property("TemplateCode")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("TemplateParam")
.HasColumnType("nvarchar(max)");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("ChannelId");
b.ToTable("SmsLog");
});
modelBuilder.Entity("ApiTools.Core.SmsSetting", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("ChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("DailyMaxCount")
.HasColumnType("int");
b.Property("HourlyMaxCount")
.HasColumnType("int");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsDisabled")
.HasColumnType("bit");
b.Property("MinutelyMaxCount")
.HasColumnType("int");
b.Property("Sort")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("WithoutParams")
.HasColumnType("bit");
b.HasKey("Id");
b.HasIndex("ChannelId");
b.ToTable("SmsSetting");
});
modelBuilder.Entity("ApiTools.Core.SmsSettingAccess", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Access")
.HasColumnType("int");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsDisabled")
.HasColumnType("bit");
b.Property("SettingId")
.HasColumnType("uniqueidentifier");
b.Property("SignName")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("SettingId");
b.ToTable("SmsSettingAccess");
});
modelBuilder.Entity("ApiTools.Core.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Avatar")
.HasColumnType("nvarchar(max)");
b.Property("ChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedChannelId")
.HasColumnType("uniqueidentifier");
b.Property("CreatedTime")
.HasColumnType("datetimeoffset");
b.Property("CreatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("IsCheckPhoneNumber")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("Level")
.HasColumnType("int");
b.Property("Name")
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property("Password")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasMaxLength(11)
.HasColumnType("nvarchar(11)");
b.Property("Remark")
.HasColumnType("nvarchar(max)");
b.Property("Sort")
.HasColumnType("int");
b.Property("Status")
.HasColumnType("int");
b.Property("TraceId")
.HasColumnType("nvarchar(max)");
b.Property("Type")
.HasColumnType("int");
b.Property("UpdatedTime")
.HasColumnType("datetimeoffset");
b.Property("UpdatedUserId")
.HasColumnType("uniqueidentifier");
b.Property("UserName")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("ChannelId");
b.ToTable("User");
b.HasData(
new
{
Id = new Guid("11111111-1111-1111-1111-111111111111"),
CreatedTime = new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)),
IsCheckPhoneNumber = false,
IsDeleted = false,
Level = 999,
Name = "管理员",
Password = "iEYggKrMhQ3ASUGLobra1w==:fn/DsMJUbD9FGpvBvR3moMpMPptdxzZlourPVhU479I=",
Sort = 0,
Status = 10,
Type = 100,
UserName = "system"
});
});
modelBuilder.Entity("ApiTools.Core.SmsLog", b =>
{
b.HasOne("ApiTools.Core.Channel", "Channel")
.WithMany()
.HasForeignKey("ChannelId");
b.Navigation("Channel");
});
modelBuilder.Entity("ApiTools.Core.SmsSetting", b =>
{
b.HasOne("ApiTools.Core.Channel", "Channel")
.WithMany()
.HasForeignKey("ChannelId");
b.Navigation("Channel");
});
modelBuilder.Entity("ApiTools.Core.SmsSettingAccess", b =>
{
b.HasOne("ApiTools.Core.SmsSetting", "Setting")
.WithMany("Accesses")
.HasForeignKey("SettingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Setting");
});
modelBuilder.Entity("ApiTools.Core.User", b =>
{
b.HasOne("ApiTools.Core.Channel", "Channel")
.WithMany()
.HasForeignKey("ChannelId");
b.Navigation("Channel");
});
modelBuilder.Entity("ApiTools.Core.SmsSetting", b =>
{
b.Navigation("Accesses");
});
#pragma warning restore 612, 618
}
}
}