//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using presence.Data.RemoteData.RemoteDatabase;
#nullable disable
namespace Data.Migrations
{
[DbContext(typeof(RemoteDatabaseContext))]
partial class RemoteDatabaseContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.GroupDao", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ID"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("ID");
b.ToTable("Groups");
});
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.PresenceDao", b =>
{
b.Property("UserDaoUserId")
.HasColumnType("integer");
b.Property("Date")
.HasColumnType("date");
b.Property("IsAttedance")
.HasColumnType("boolean");
b.Property("LessonNumber")
.HasColumnType("integer");
b.Property("GroupId")
.HasColumnType("integer");
b.HasKey("UserDaoUserId", "Date", "IsAttedance", "LessonNumber");
b.ToTable("PresencesDaos");
});
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.UserDao", b =>
{
b.Property("UserID")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserID"));
b.Property("GroupID")
.HasColumnType("integer");
b.Property("UserFIO")
.IsRequired()
.HasColumnType("text");
b.HasKey("UserID");
b.HasIndex("GroupID");
b.ToTable("Users");
});
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.PresenceDao", b =>
{
b.HasOne("presence.Data.RemoteData.RemoteDatabase.DAO.UserDao", "UserDao")
.WithMany()
.HasForeignKey("UserDaoUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("UserDao");
});
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.UserDao", b =>
{
b.HasOne("presence.Data.RemoteData.RemoteDatabase.DAO.GroupDao", "Group")
.WithMany("Users")
.HasForeignKey("GroupID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Group");
});
modelBuilder.Entity("presence.Data.RemoteData.RemoteDatabase.DAO.GroupDao", b =>
{
b.Navigation("Users");
});
#pragma warning restore 612, 618
}
}
}