//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using presence.data.RemoteData.RemoteDataBase;
#nullable disable
namespace data.Migrations
{
[DbContext(typeof(RemoteDataBaseContext))]
[Migration("20241114213726_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(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("PresenceId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("PresenceId"));
b.Property("ClassNumber")
.HasColumnType("integer");
b.Property("Date")
.HasColumnType("date");
b.Property("GroupId")
.HasColumnType("integer");
b.Property("IsAttendence")
.HasColumnType("boolean");
b.Property("UserGuid")
.HasColumnType("uuid");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("PresenceId");
b.HasIndex("UserId");
b.ToTable("Presences");
});
modelBuilder.Entity("presence.data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
{
b.Property("UserId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserId"));
b.Property("FIO")
.IsRequired()
.HasColumnType("text");
b.Property("GroupId")
.HasColumnType("integer");
b.Property("UserGuid")
.HasColumnType("uuid");
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", "User")
.WithMany("Presences")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("presence.data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
{
b.HasOne("presence.data.RemoteData.RemoteDataBase.DAO.GroupDao", "Group")
.WithMany("User")
.HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Group");
});
modelBuilder.Entity("presence.data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
{
b.Navigation("User");
});
modelBuilder.Entity("presence.data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
{
b.Navigation("Presences");
});
#pragma warning restore 612, 618
}
}
}