//
using System;
using DatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DatabaseImplement.Migrations
{
[DbContext(typeof(Database))]
[Migration("20240604184007_registration_init")]
partial class registration_init
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("DatabaseImplement.Models.Role", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Roles");
});
modelBuilder.Entity("DatabaseImplement.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Birthday")
.HasColumnType("timestamp with time zone");
b.Property("Email")
.IsRequired()
.HasColumnType("text");
b.Property("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("text");
b.Property("RoleId")
.HasColumnType("uuid");
b.Property("SecondName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("Users");
});
modelBuilder.Entity("DatabaseImplement.Models.User", b =>
{
b.HasOne("DatabaseImplement.Models.Role", "Role")
.WithMany()
.HasForeignKey("RoleId");
b.Navigation("Role");
});
#pragma warning restore 612, 618
}
}
}