191 lines
6.3 KiB
C#
191 lines
6.3 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using ForumDatabaseImplement;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace ForumDatabaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(ForumDataBase))]
|
|
partial class ForumDataBaseModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.17")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Answer", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Comment")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("QuestionId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("ResponseDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("QuestionId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Answers");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Category", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("CategoryName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Question", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreateDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Topic")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Questions");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("ActivityDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Nickname")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("RegistrationDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Answer", b =>
|
|
{
|
|
b.HasOne("ForumDatabaseImplement.Models.Question", "Question")
|
|
.WithMany("Answers")
|
|
.HasForeignKey("QuestionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ForumDatabaseImplement.Models.User", "User")
|
|
.WithMany("Answers")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Question");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Question", b =>
|
|
{
|
|
b.HasOne("ForumDatabaseImplement.Models.Category", "Category")
|
|
.WithMany("Questions")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ForumDatabaseImplement.Models.User", "User")
|
|
.WithMany("Questions")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Category", b =>
|
|
{
|
|
b.Navigation("Questions");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.Question", b =>
|
|
{
|
|
b.Navigation("Answers");
|
|
});
|
|
|
|
modelBuilder.Entity("ForumDatabaseImplement.Models.User", b =>
|
|
{
|
|
b.Navigation("Answers");
|
|
|
|
b.Navigation("Questions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|