2023-04-06 22:52:23 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using SchoolDatabaseImplement;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace SchoolDatabaseImplements.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(SchoolDatabase))]
|
2023-04-09 02:44:56 +04:00
|
|
|
|
[Migration("20230408223041_DbFix")]
|
|
|
|
|
partial class DbFix
|
2023-04-06 22:52:23 +04:00
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void BuildTargetModel(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<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("CircleId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.Property<int>("ClientId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateStart")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.HasIndex("CircleId")
|
|
|
|
|
.IsUnique();
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.HasIndex("ClientId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Circles");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleExpense", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("CircleId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ExpenseId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("CircleId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ExpenseId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("CircleExpenses");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleLesson", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("CircleId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("LessonId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("LessonId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("CircleLessons");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Client", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientEmail")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientPassword")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientPhone")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Clients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Employee", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("EmployeeEmail")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("EmployeeName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("EmployeePassword")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("EmployeePhone")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Employees");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Expense", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.Property<string>("ExpenseName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Sum")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Expenses");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Lesson", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("EmployeeId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("LessonName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("LessonPrice")
|
|
|
|
|
.HasColumnType("int");
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Lessons");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Payment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("CircleLessonId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.Property<DateTime?>("DateOfPayment")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int?>("LessonId")
|
2023-04-06 22:52:23 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("PaySum")
|
|
|
|
|
.HasColumnType("int");
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Property<int>("Remains")
|
|
|
|
|
.HasColumnType("int");
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.HasIndex("CircleLessonId");
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.HasIndex("LessonId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Payments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Circle", b =>
|
|
|
|
|
{
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.HasOne("SchoolDatabaseImplement.Models.CircleLesson", "CircleLessons")
|
|
|
|
|
.WithOne("Circle")
|
|
|
|
|
.HasForeignKey("SchoolDatabaseImplement.Models.Circle", "CircleId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
b.HasOne("SchoolDatabaseImplement.Models.Client", "Client")
|
|
|
|
|
.WithMany("Circles")
|
|
|
|
|
.HasForeignKey("ClientId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.Navigation("CircleLessons");
|
|
|
|
|
|
2023-04-06 22:52:23 +04:00
|
|
|
|
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.Lesson", "Lesson")
|
|
|
|
|
.WithMany("CircleLessons")
|
|
|
|
|
.HasForeignKey("LessonId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
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 =>
|
|
|
|
|
{
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.HasOne("SchoolDatabaseImplement.Models.CircleLesson", "CircleLesson")
|
2023-04-06 22:52:23 +04:00
|
|
|
|
.WithMany("Payments")
|
2023-04-09 02:44:56 +04:00
|
|
|
|
.HasForeignKey("CircleLessonId")
|
2023-04-06 22:52:23 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
b.HasOne("SchoolDatabaseImplement.Models.Lesson", null)
|
|
|
|
|
.WithMany("Payments")
|
|
|
|
|
.HasForeignKey("LessonId");
|
|
|
|
|
|
|
|
|
|
b.Navigation("CircleLesson");
|
2023-04-06 22:52:23 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.Circle", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("CircleExpenses");
|
2023-04-09 02:44:56 +04:00
|
|
|
|
});
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
2023-04-09 02:44:56 +04:00
|
|
|
|
modelBuilder.Entity("SchoolDatabaseImplement.Models.CircleLesson", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Circle")
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Payments");
|
2023-04-06 22:52:23 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|