//
using System;
using ApplicationHub.Data.EF.Authentication;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace ApplicationHub.Data.EF.Migrations
{
[DbContext(typeof(AuthenticationDataContext))]
[Migration("20250809103237_InitDB")]
partial class InitDB
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
modelBuilder.Entity("ApplicationHub.Data.EF.Authentication.Entities.GroupEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Groups");
});
modelBuilder.Entity("ApplicationHub.Data.EF.Authentication.Entities.RightEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Rights");
});
modelBuilder.Entity("ApplicationHub.Data.EF.Authentication.Entities.UserEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Active")
.HasColumnType("INTEGER");
b.Property("Email")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("PasswordHash")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UserName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("GroupEntityRightEntity", b =>
{
b.Property("GroupsId")
.HasColumnType("TEXT");
b.Property("RightsId")
.HasColumnType("TEXT");
b.HasKey("GroupsId", "RightsId");
b.HasIndex("RightsId");
b.ToTable("GroupEntityRightEntity");
});
modelBuilder.Entity("GroupEntityUserEntity", b =>
{
b.Property("GroupsId")
.HasColumnType("TEXT");
b.Property("UsersId")
.HasColumnType("TEXT");
b.HasKey("GroupsId", "UsersId");
b.HasIndex("UsersId");
b.ToTable("GroupEntityUserEntity");
});
modelBuilder.Entity("GroupEntityRightEntity", b =>
{
b.HasOne("ApplicationHub.Data.EF.Authentication.Entities.GroupEntity", null)
.WithMany()
.HasForeignKey("GroupsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ApplicationHub.Data.EF.Authentication.Entities.RightEntity", null)
.WithMany()
.HasForeignKey("RightsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GroupEntityUserEntity", b =>
{
b.HasOne("ApplicationHub.Data.EF.Authentication.Entities.GroupEntity", null)
.WithMany()
.HasForeignKey("GroupsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ApplicationHub.Data.EF.Authentication.Entities.UserEntity", null)
.WithMany()
.HasForeignKey("UsersId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}