// using System; using Avalonia_EFCore.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Avalonia_EFCore.Migrations.MySQL { [DbContext(typeof(MySqlAppDataContext))] [Migration("20260520082626_AutoMigration_20260520162543")] partial class AutoMigration_20260520162543 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Avalonia_EFCore.Models.ApiRefreshTokenEntity", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasColumnName("id"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created-at"); b.Property("Device") .HasMaxLength(200) .HasColumnType("varchar(200)") .HasColumnName("device"); b.Property("ExpiresAt") .HasColumnType("datetime(6)") .HasColumnName("expires-at"); b.Property("IpAddress") .HasMaxLength(64) .HasColumnType("varchar(64)") .HasColumnName("ip-address"); b.Property("ReplacedByTokenHash") .HasMaxLength(128) .HasColumnType("varchar(128)") .HasColumnName("replaced-by-token-hash"); b.Property("RevokedAt") .HasColumnType("datetime(6)") .HasColumnName("revoked-at"); b.Property("TokenHash") .IsRequired() .HasMaxLength(128) .HasColumnType("varchar(128)") .HasColumnName("token-hash"); b.Property("UserId") .HasColumnType("int") .HasColumnName("user-id"); b.HasKey("Id") .HasName("pk-api-refresh-token"); b.HasIndex("TokenHash") .IsUnique() .HasDatabaseName("idx-api-refresh-token-hash"); b.HasIndex("UserId") .HasDatabaseName("idx-api-refresh-token-user-id"); b.ToTable("api-refresh-token", t => { t.HasComment("API refresh token"); }); }); modelBuilder.Entity("Avalonia_EFCore.Models.UserEntity", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasColumnName("id") .HasComment("用户主键"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created-at") .HasComment("创建时间"); b.Property("Email") .HasMaxLength(200) .HasColumnType("varchar(200)") .HasColumnName("email") .HasComment("用户邮箱"); b.Property("Name") .HasMaxLength(100) .HasColumnType("varchar(100)") .HasColumnName("name") .HasComment("用户名称"); b.Property("PhoneNumber") .HasMaxLength(50) .HasColumnType("varchar(50)") .HasColumnName("phone-number") .HasComment("电话号码"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated-at") .HasComment("更新时间"); b.HasKey("Id") .HasName("pk-user"); b.ToTable("user", t => { t.HasComment("用户实体,演示数据库 CRUD 操作"); }); }); modelBuilder.Entity("Avalonia_EFCore.Models.WeatherForecastEntity", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasColumnName("id") .HasComment("天气预报主键"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created-at") .HasComment("创建时间"); b.Property("Date") .HasColumnType("date") .HasColumnName("date") .HasComment("预报日期"); b.Property("Summary") .HasMaxLength(200) .HasColumnType("varchar(200)") .HasColumnName("summary") .HasComment("天气摘要"); b.Property("TemperatureC") .HasColumnType("int") .HasColumnName("temperature-c") .HasComment("摄氏温度"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated-at") .HasComment("更新时间"); b.HasKey("Id") .HasName("pk-weather-forecast"); b.ToTable("weather-forecast", t => { t.HasComment("天气预报数据实体"); }); }); #pragma warning restore 612, 618 } } }