//
using System;
using HackerNet.Infrastructure.Repositories.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace HackerNet.Infrastructure.Migrations
{
[DbContext(typeof(HackerContext))]
[Migration("20211215082223_CreateLinkAndComment")]
partial class CreateLinkAndComment
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("HackerNet.Domain.Comment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Content")
.IsRequired()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("LinkId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("LinkId");
b.ToTable("Comments");
});
modelBuilder.Entity("HackerNet.Domain.Link", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Url")
.IsRequired()
.HasMaxLength(250)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Links");
});
modelBuilder.Entity("HackerNet.Domain.Comment", b =>
{
b.HasOne("HackerNet.Domain.Link", null)
.WithMany()
.HasForeignKey("LinkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}