//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SchoolDatabaseImplement;
#nullable disable
namespace SchoolDatabaseImplements.Migrations
{
[DbContext(typeof(SchoolDatabase))]
partial class SchoolDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("SchoolDatabaseImplement.Models.Circle", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClientId")
.HasColumnType("int");
b.Property("DateStart")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Circles");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleExpense", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CircleId")
.HasColumnType("int");
b.Property("ExpenseId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CircleId");
b.HasIndex("ExpenseId");
b.ToTable("CircleExpenses");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleLesson", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CircleId")
.HasColumnType("int");
b.Property("Count")
.HasColumnType("int");
b.Property("LessonId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CircleId");
b.HasIndex("LessonId");
b.ToTable("CircleLessons");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Client", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClientEmail")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ClientName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ClientPassword")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ClientPhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Employee", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("EmployeeEmail")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("EmployeeName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("EmployeePassword")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("EmployeePhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Employees");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Expense", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExpenseName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("Expenses");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Lesson", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("EmployeeId")
.HasColumnType("int");
b.Property("LessonName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("LessonPrice")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("EmployeeId");
b.ToTable("Lessons");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Payment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("DateOfPayment")
.IsRequired()
.HasColumnType("datetime2");
b.Property("LessonId")
.HasColumnType("int");
b.Property("Remains")
.HasColumnType("float");
b.Property("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("LessonId");
b.ToTable("Payments");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Circle", b =>
{
b.HasOne("SchoolDatabaseImplement.Models.Client", "Client")
.WithMany("Circles")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleExpense", b =>
{
b.HasOne("SchoolDatabaseImplement.Models.Circle", "Circle")
.WithMany("CircleExpenses")
.HasForeignKey("CircleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SchoolDatabaseImplement.Models.Expense", "Expense")
.WithMany("CircleExpenses")
.HasForeignKey("ExpenseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Circle");
b.Navigation("Expense");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleLesson", b =>
{
b.HasOne("SchoolDatabaseImplement.Models.Circle", "Circle")
.WithMany("CircleLessons")
.HasForeignKey("CircleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SchoolDatabaseImplement.Models.Lesson", "Lesson")
.WithMany("CircleLessons")
.HasForeignKey("LessonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Circle");
b.Navigation("Lesson");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Lesson", b =>
{
b.HasOne("SchoolDatabaseImplement.Models.Employee", "Employee")
.WithMany("Lessons")
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Employee");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Payment", b =>
{
b.HasOne("SchoolDatabaseImplement.Models.Lesson", "Lesson")
.WithMany("Payments")
.HasForeignKey("LessonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Lesson");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Circle", b =>
{
b.Navigation("CircleExpenses");
b.Navigation("CircleLessons");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Client", b =>
{
b.Navigation("Circles");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Employee", b =>
{
b.Navigation("Lessons");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Expense", b =>
{
b.Navigation("CircleExpenses");
});
modelBuilder.Entity("SchoolDatabaseImplement.Models.Lesson", b =>
{
b.Navigation("CircleLessons");
b.Navigation("Payments");
});
#pragma warning restore 612, 618
}
}
}