// using System; using HN.Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Infrastructure.Migrations { [DbContext(typeof(HNDbContext))] [Migration("20201211144029_AddCreatedBy")] partial class AddCreatedBy { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "5.0.0"); modelBuilder.Entity("HN.Domain.Comment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("CreatedBy") .HasColumnType("TEXT"); b.Property("LinkId") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("CreatedBy"); b.HasIndex("LinkId"); b.ToTable("comments"); }); modelBuilder.Entity("HN.Domain.Link", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("CreatedBy") .HasColumnType("TEXT"); b.Property("Url") .IsRequired() .HasMaxLength(500) .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("CreatedBy"); b.HasIndex("Url") .IsUnique(); b.ToTable("links"); }); modelBuilder.Entity("HN.Infrastructure.Role", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("TEXT"); b.Property("Name") .HasMaxLength(256) .HasColumnType("TEXT"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("HN.Infrastructure.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b.Property("AccessFailedCount") .HasColumnType("INTEGER"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("TEXT"); b.Property("Email") .HasMaxLength(256) .HasColumnType("TEXT"); b.Property("EmailConfirmed") .HasColumnType("INTEGER"); b.Property("LockoutEnabled") .HasColumnType("INTEGER"); b.Property("LockoutEnd") .HasColumnType("TEXT"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("TEXT"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("TEXT"); b.Property("PasswordHash") .HasColumnType("TEXT"); b.Property("PhoneNumber") .HasColumnType("TEXT"); b.Property("PhoneNumberConfirmed") .HasColumnType("INTEGER"); b.Property("SecurityStamp") .HasColumnType("TEXT"); b.Property("TwoFactorEnabled") .HasColumnType("INTEGER"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("ClaimType") .HasColumnType("TEXT"); b.Property("ClaimValue") .HasColumnType("TEXT"); b.Property("RoleId") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("ClaimType") .HasColumnType("TEXT"); b.Property("ClaimValue") .HasColumnType("TEXT"); b.Property("UserId") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("TEXT"); b.Property("ProviderKey") .HasColumnType("TEXT"); b.Property("ProviderDisplayName") .HasColumnType("TEXT"); b.Property("UserId") .HasColumnType("TEXT"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("TEXT"); b.Property("RoleId") .HasColumnType("TEXT"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("TEXT"); b.Property("LoginProvider") .HasColumnType("TEXT"); b.Property("Name") .HasColumnType("TEXT"); b.Property("Value") .HasColumnType("TEXT"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("HN.Domain.Comment", b => { b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("CreatedBy") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("HN.Domain.Link", null) .WithMany() .HasForeignKey("LinkId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.OwnsMany("HN.Domain.Vote", "Votes", b1 => { b1.Property("CommentId") .HasColumnType("TEXT"); b1.Property("CreatedBy") .HasColumnType("TEXT"); b1.Property("CreatedAt") .HasColumnType("TEXT"); b1.Property("Type") .HasColumnType("INTEGER"); b1.HasKey("CommentId", "CreatedBy"); b1.HasIndex("CreatedBy"); b1.ToTable("comment_votes"); b1.WithOwner() .HasForeignKey("CommentId"); b1.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("CreatedBy") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); b.Navigation("Votes"); }); modelBuilder.Entity("HN.Domain.Link", b => { b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("CreatedBy") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.OwnsMany("HN.Domain.Vote", "Votes", b1 => { b1.Property("LinkId") .HasColumnType("TEXT"); b1.Property("CreatedBy") .HasColumnType("TEXT"); b1.Property("CreatedAt") .HasColumnType("TEXT"); b1.Property("Type") .HasColumnType("INTEGER"); b1.HasKey("LinkId", "CreatedBy"); b1.HasIndex("CreatedBy"); b1.ToTable("link_votes"); b1.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("CreatedBy") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b1.WithOwner() .HasForeignKey("LinkId"); }); b.Navigation("Votes"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("HN.Infrastructure.Role", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("HN.Infrastructure.Role", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("HN.Infrastructure.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }