// using System; using EARSystem.Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace EARSystem.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20261006085803_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.12") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("EARSystem.Core.Experience", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Comfort") .HasColumnType("int"); b.Property("Contribute") .HasColumnType("bit"); b.Property("CreatedAt") .HasColumnType("bigint"); b.Property("Focus") .HasColumnType("int"); b.Property("Liveliness") .HasColumnType("int"); b.Property("MoodAfter") .HasColumnType("int"); b.Property("MoodBefore") .HasColumnType("int"); b.Property("Nature") .HasColumnType("int"); b.Property("PlaceId") .HasColumnType("uniqueidentifier"); b.Property("Quiet") .HasColumnType("int"); b.Property("Satisfaction") .HasColumnType("int"); b.Property("Social") .HasColumnType("int"); b.Property("Thoughts") .IsRequired() .HasMaxLength(5000) .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("Version") .IsConcurrencyToken() .HasColumnType("uniqueidentifier"); b.Property("VisitDay") .HasColumnType("int"); b.Property("VisitedAt") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("PlaceId", "Contribute"); b.HasIndex("UserId", "VisitedAt"); b.HasIndex("UserId", "PlaceId", "VisitDay") .IsUnique(); b.ToTable("Experiences"); }); modelBuilder.Entity("EARSystem.Core.Favorite", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("PlaceId") .HasColumnType("uniqueidentifier"); b.Property("CreatedAt") .HasColumnType("bigint"); b.HasKey("UserId", "PlaceId"); b.HasIndex("PlaceId"); b.ToTable("Favorites"); }); modelBuilder.Entity("EARSystem.Core.MoodEntry", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("CreatedAt") .HasColumnType("bigint"); b.Property("Energy") .HasColumnType("int"); b.Property("ExperienceId") .HasColumnType("uniqueidentifier"); b.Property("Mood") .HasColumnType("int"); b.Property("RecordedAt") .HasColumnType("bigint"); b.Property("Stress") .HasColumnType("int"); b.Property("TagsJson") .IsRequired() .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); b.Property("Thoughts") .IsRequired() .HasMaxLength(5000) .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("Version") .IsConcurrencyToken() .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("UserId", "RecordedAt"); b.ToTable("Moods"); }); modelBuilder.Entity("EARSystem.Core.Place", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Address") .IsRequired() .HasMaxLength(300) .HasColumnType("nvarchar(300)"); b.Property("AuthorizedExternalId") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("Category") .HasColumnType("int"); b.Property("CloseHour") .HasColumnType("int"); b.Property("Description") .IsRequired() .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); b.Property("Latitude") .HasColumnType("float"); b.Property("Longitude") .HasColumnType("float"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("OpenHour") .HasColumnType("int"); b.Property("Price") .HasPrecision(10, 2) .HasColumnType("decimal(10,2)"); b.Property("Rating") .HasColumnType("float"); b.Property("Source") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("Source", "Category"); b.ToTable("Places"); }); modelBuilder.Entity("EARSystem.Core.PlaceAtmosphere", b => { b.Property("PlaceId") .HasColumnType("uniqueidentifier"); b.Property("BaselineCount") .HasColumnType("int"); b.Property("Comfort") .HasColumnType("float"); b.Property("Evidence") .IsRequired() .HasMaxLength(500) .HasColumnType("nvarchar(500)"); b.Property("Focus") .HasColumnType("float"); b.Property("Liveliness") .HasColumnType("float"); b.Property("Nature") .HasColumnType("float"); b.Property("Quiet") .HasColumnType("float"); b.Property("Social") .HasColumnType("float"); b.HasKey("PlaceId"); b.ToTable("Atmospheres"); }); modelBuilder.Entity("EARSystem.Core.RecommendationRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AlgorithmVersion") .IsRequired() .HasMaxLength(50) .HasColumnType("nvarchar(50)"); b.Property("CreatedAt") .HasColumnType("bigint"); b.Property("DurationMs") .HasColumnType("float"); b.Property("Goal") .HasColumnType("int"); b.Property("Mode") .HasColumnType("int"); b.Property("ResultsJson") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("UserId", "CreatedAt"); b.ToTable("Recommendations"); }); modelBuilder.Entity("EARSystem.Core.RuleConfiguration", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("uniqueidentifier"); b.Property("Version") .IsRequired() .HasMaxLength(50) .HasColumnType("nvarchar(50)"); b.Property("WeightsJson") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("Rules"); }); modelBuilder.Entity("EARSystem.Core.UserPreference", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("BlockedCategoriesJson") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("BlockedPlacesJson") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Budget") .HasPrecision(10, 2) .HasColumnType("decimal(10,2)"); b.Property("FavoriteCategoriesJson") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("RadiusMeters") .HasColumnType("int"); b.HasKey("UserId"); b.ToTable("Preferences"); }); modelBuilder.Entity("EARSystem.Infrastructure.ApplicationUser", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasMaxLength(40) .HasColumnType("nvarchar(40)"); b.Property("Email") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("EmailConfirmed") .HasColumnType("bit"); b.Property("IsDemo") .HasColumnType("bit"); b.Property("LockoutEnabled") .HasColumnType("bit"); b.Property("LockoutEnd") .HasColumnType("datetimeoffset"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("PasswordHash") .HasColumnType("nvarchar(max)"); b.Property("PhoneNumber") .HasColumnType("nvarchar(max)"); b.Property("PhoneNumberConfirmed") .HasColumnType("bit"); b.Property("SecurityStamp") .HasColumnType("nvarchar(max)"); b.Property("TwoFactorEnabled") .HasColumnType("bit"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property("Name") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("nvarchar(max)"); b.Property("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property("RoleId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("nvarchar(max)"); b.Property("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("nvarchar(450)"); b.Property("ProviderKey") .HasColumnType("nvarchar(450)"); b.Property("ProviderDisplayName") .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("RoleId") .HasColumnType("nvarchar(450)"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("LoginProvider") .HasColumnType("nvarchar(450)"); b.Property("Name") .HasColumnType("nvarchar(450)"); b.Property("Value") .HasColumnType("nvarchar(max)"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("EARSystem.Core.Experience", b => { b.HasOne("EARSystem.Core.Place", "Place") .WithMany() .HasForeignKey("PlaceId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Place"); }); modelBuilder.Entity("EARSystem.Core.Favorite", b => { b.HasOne("EARSystem.Core.Place", "Place") .WithMany() .HasForeignKey("PlaceId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Place"); }); modelBuilder.Entity("EARSystem.Core.MoodEntry", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("EARSystem.Core.PlaceAtmosphere", b => { b.HasOne("EARSystem.Core.Place", null) .WithOne("Atmosphere") .HasForeignKey("EARSystem.Core.PlaceAtmosphere", "PlaceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("EARSystem.Core.RecommendationRecord", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("EARSystem.Core.UserPreference", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithOne() .HasForeignKey("EARSystem.Core.UserPreference", "UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("EARSystem.Infrastructure.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("EARSystem.Core.Place", b => { b.Navigation("Atmosphere"); }); #pragma warning restore 612, 618 } } }