123 lines
3.8 KiB
C#
123 lines
3.8 KiB
C#
// <auto-generated />
|
|
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("20201211102901_CreateCommentVote")]
|
|
partial class CreateCommentVote
|
|
{
|
|
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<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("LinkId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LinkId");
|
|
|
|
b.ToTable("comments");
|
|
});
|
|
|
|
modelBuilder.Entity("HN.Domain.Link", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Url")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Url")
|
|
.IsUnique();
|
|
|
|
b.ToTable("links");
|
|
});
|
|
|
|
modelBuilder.Entity("HN.Domain.Comment", b =>
|
|
{
|
|
b.HasOne("HN.Domain.Link", null)
|
|
.WithMany()
|
|
.HasForeignKey("LinkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.OwnsMany("HN.Domain.Vote", "Votes", b1 =>
|
|
{
|
|
b1.Property<Guid>("CommentId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b1.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b1.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b1.HasKey("CommentId");
|
|
|
|
b1.ToTable("comment_votes");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("CommentId");
|
|
});
|
|
|
|
b.Navigation("Votes");
|
|
});
|
|
|
|
modelBuilder.Entity("HN.Domain.Link", b =>
|
|
{
|
|
b.OwnsMany("HN.Domain.Vote", "Votes", b1 =>
|
|
{
|
|
b1.Property<Guid>("LinkId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b1.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b1.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b1.HasKey("LinkId");
|
|
|
|
b1.ToTable("link_votes");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("LinkId");
|
|
});
|
|
|
|
b.Navigation("Votes");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|