// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using MyHN.Infrastructure; namespace Infrastructure.Migrations { [DbContext(typeof(MyHNDbContext))] [Migration("20210105111221_AlterLinkVotesPK")] partial class AlterLinkVotesPK { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "5.0.1"); modelBuilder.Entity("MyHN.Domain.Link", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Url") .IsRequired() .HasMaxLength(500) .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("links"); }); modelBuilder.Entity("MyHN.Domain.Link", b => { b.OwnsMany("MyHN.Domain.Vote", "Votes", b1 => { b1.Property("LinkId") .HasColumnType("TEXT"); b1.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("TEXT"); b1.Property("CreatedAt") .HasColumnType("TEXT"); b1.Property("Direction") .HasColumnType("INTEGER"); b1.HasKey("LinkId", "Id"); b1.ToTable("link_votes"); b1.WithOwner() .HasForeignKey("LinkId"); }); b.Navigation("Votes"); }); #pragma warning restore 612, 618 } } }