я ошибся! я могу один раз ошибиться?
This commit is contained in:
parent
27bed74b89
commit
dec9ceaf34
@ -3,7 +3,7 @@
|
|||||||
public class ProgramSearchModel
|
public class ProgramSearchModel
|
||||||
{
|
{
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public int? ClientId { get; set; }
|
public string? ClientSnils { get; set; }
|
||||||
public string? ProgramName { get; set; }
|
public string? ProgramName { get; set; }
|
||||||
public double? InterestRate { get; set; }
|
public double? InterestRate { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,11 @@ namespace BankDatabaseImplement
|
|||||||
}
|
}
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
}
|
}
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.Entity<Client>()
|
||||||
|
.HasKey(c => c.Snils);
|
||||||
|
}
|
||||||
public virtual DbSet<Client> Clients { set; get; }
|
public virtual DbSet<Client> Clients { set; get; }
|
||||||
public virtual DbSet<ClientProgram> ClientPrograms { set; get; }
|
public virtual DbSet<ClientProgram> ClientPrograms { set; get; }
|
||||||
public virtual DbSet<ClientDeposit> ClientDeposits { set; get; }
|
public virtual DbSet<ClientDeposit> ClientDeposits { set; get; }
|
||||||
|
491
Bank/BankDatabaseImplement/Migrations/20240502003921_InitialCreate.Designer.cs
generated
Normal file
491
Bank/BankDatabaseImplement/Migrations/20240502003921_InitialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,491 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BankDatabaseImplement;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BankDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BankDatabase))]
|
||||||
|
[Migration("20240502003921_InitialCreate")]
|
||||||
|
partial class InitialCreate
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.4")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Snils")
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientPatronymic")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientSurname")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Snils");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Clients");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientDeposit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClientSnils")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientSnils");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.ToTable("ClientDeposits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientProgram", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClientSnils")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientSnils");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("ClientPrograms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Currency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("Course")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<string>("CurrencyName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Currencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateOnly>("OpeningDate")
|
||||||
|
.HasColumnType("date");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Deposits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.DepositCurrency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CurrencyId");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.ToTable("DepositCurrencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Program", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("InterestRate")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<string>("ProgramName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ProgramCurrency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CurrencyId");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("ProgramCurrencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Refill", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateOnly>("RefillDate")
|
||||||
|
.HasColumnType("date");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Refills");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Term", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("Terms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int?>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerPatronymic")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerSurname")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Workers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientDeposit", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Client", "Client")
|
||||||
|
.WithMany("Deposits")
|
||||||
|
.HasForeignKey("ClientSnils")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Clients")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Client");
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientProgram", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Client", "Client")
|
||||||
|
.WithMany("Programs")
|
||||||
|
.HasForeignKey("ClientSnils")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Clients")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Client");
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.DepositCurrency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Currency", "Currency")
|
||||||
|
.WithMany("Deposits")
|
||||||
|
.HasForeignKey("CurrencyId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Currencies")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Currency");
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ProgramCurrency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Currency", "Currency")
|
||||||
|
.WithMany("Programs")
|
||||||
|
.HasForeignKey("CurrencyId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Currencies")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Currency");
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Refill", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Refills")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Term", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Terms")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", null)
|
||||||
|
.WithMany("Workers")
|
||||||
|
.HasForeignKey("WorkerId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Deposits");
|
||||||
|
|
||||||
|
b.Navigation("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Currency", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Deposits");
|
||||||
|
|
||||||
|
b.Navigation("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Clients");
|
||||||
|
|
||||||
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
|
b.Navigation("Refills");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Program", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Clients");
|
||||||
|
|
||||||
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
|
b.Navigation("Terms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Workers");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,365 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BankDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class InitialCreate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Currencies",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
CurrencyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Course = table.Column<double>(type: "float", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Currencies", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Programs",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
ProgramName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
InterestRate = table.Column<double>(type: "float", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Programs", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Workers",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
WorkerSurname = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
WorkerName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
WorkerPatronymic = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
WorkerId = table.Column<int>(type: "int", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Workers", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Workers_Workers_WorkerId",
|
||||||
|
column: x => x.WorkerId,
|
||||||
|
principalTable: "Workers",
|
||||||
|
principalColumn: "Id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ProgramCurrencies",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
ProgramId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
CurrencyId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ProgramCurrencies", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ProgramCurrencies_Currencies_CurrencyId",
|
||||||
|
column: x => x.CurrencyId,
|
||||||
|
principalTable: "Currencies",
|
||||||
|
principalColumn: "Id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ProgramCurrencies_Programs_ProgramId",
|
||||||
|
column: x => x.ProgramId,
|
||||||
|
principalTable: "Programs",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Terms",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Duration = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ProgramId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Terms", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Terms_Programs_ProgramId",
|
||||||
|
column: x => x.ProgramId,
|
||||||
|
principalTable: "Programs",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Clients",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Snils = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
ClientSurname = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
ClientName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
ClientPatronymic = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
WorkerId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Clients", x => x.Snils);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Clients_Workers_WorkerId",
|
||||||
|
column: x => x.WorkerId,
|
||||||
|
principalTable: "Workers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Deposits",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
WorkerId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Sum = table.Column<double>(type: "float", nullable: false),
|
||||||
|
OpeningDate = table.Column<DateOnly>(type: "date", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Deposits", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Deposits_Workers_WorkerId",
|
||||||
|
column: x => x.WorkerId,
|
||||||
|
principalTable: "Workers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ClientPrograms",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
ClientSnils = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
ProgramId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ClientPrograms", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ClientPrograms_Clients_ClientSnils",
|
||||||
|
column: x => x.ClientSnils,
|
||||||
|
principalTable: "Clients",
|
||||||
|
principalColumn: "Snils",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ClientPrograms_Programs_ProgramId",
|
||||||
|
column: x => x.ProgramId,
|
||||||
|
principalTable: "Programs",
|
||||||
|
principalColumn: "Id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ClientDeposits",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
ClientSnils = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
DepositId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ClientDeposits", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ClientDeposits_Clients_ClientSnils",
|
||||||
|
column: x => x.ClientSnils,
|
||||||
|
principalTable: "Clients",
|
||||||
|
principalColumn: "Snils",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ClientDeposits_Deposits_DepositId",
|
||||||
|
column: x => x.DepositId,
|
||||||
|
principalTable: "Deposits");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DepositCurrencies",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DepositId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
CurrencyId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DepositCurrencies", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DepositCurrencies_Currencies_CurrencyId",
|
||||||
|
column: x => x.CurrencyId,
|
||||||
|
principalTable: "Currencies",
|
||||||
|
principalColumn: "Id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DepositCurrencies_Deposits_DepositId",
|
||||||
|
column: x => x.DepositId,
|
||||||
|
principalTable: "Deposits",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Refills",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DepositId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
WorkerId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Sum = table.Column<double>(type: "float", nullable: false),
|
||||||
|
RefillDate = table.Column<DateOnly>(type: "date", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Refills", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Refills_Deposits_DepositId",
|
||||||
|
column: x => x.DepositId,
|
||||||
|
principalTable: "Deposits",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Refills_Workers_WorkerId",
|
||||||
|
column: x => x.WorkerId,
|
||||||
|
principalTable: "Workers",
|
||||||
|
principalColumn: "Id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ClientDeposits_ClientSnils",
|
||||||
|
table: "ClientDeposits",
|
||||||
|
column: "ClientSnils");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ClientDeposits_DepositId",
|
||||||
|
table: "ClientDeposits",
|
||||||
|
column: "DepositId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ClientPrograms_ClientSnils",
|
||||||
|
table: "ClientPrograms",
|
||||||
|
column: "ClientSnils");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ClientPrograms_ProgramId",
|
||||||
|
table: "ClientPrograms",
|
||||||
|
column: "ProgramId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Clients_WorkerId",
|
||||||
|
table: "Clients",
|
||||||
|
column: "WorkerId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DepositCurrencies_CurrencyId",
|
||||||
|
table: "DepositCurrencies",
|
||||||
|
column: "CurrencyId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DepositCurrencies_DepositId",
|
||||||
|
table: "DepositCurrencies",
|
||||||
|
column: "DepositId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Deposits_WorkerId",
|
||||||
|
table: "Deposits",
|
||||||
|
column: "WorkerId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProgramCurrencies_CurrencyId",
|
||||||
|
table: "ProgramCurrencies",
|
||||||
|
column: "CurrencyId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProgramCurrencies_ProgramId",
|
||||||
|
table: "ProgramCurrencies",
|
||||||
|
column: "ProgramId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Refills_DepositId",
|
||||||
|
table: "Refills",
|
||||||
|
column: "DepositId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Refills_WorkerId",
|
||||||
|
table: "Refills",
|
||||||
|
column: "WorkerId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Terms_ProgramId",
|
||||||
|
table: "Terms",
|
||||||
|
column: "ProgramId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Workers_WorkerId",
|
||||||
|
table: "Workers",
|
||||||
|
column: "WorkerId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ClientDeposits");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ClientPrograms");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DepositCurrencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ProgramCurrencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Refills");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Terms");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Clients");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Currencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Deposits");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Programs");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Workers");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,488 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BankDatabaseImplement;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BankDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BankDatabase))]
|
||||||
|
partial class BankDatabaseModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.4")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Snils")
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientPatronymic")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ClientSurname")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Snils");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Clients");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientDeposit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClientSnils")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientSnils");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.ToTable("ClientDeposits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientProgram", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClientSnils")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientSnils");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("ClientPrograms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Currency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("Course")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<string>("CurrencyName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Currencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateOnly>("OpeningDate")
|
||||||
|
.HasColumnType("date");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Deposits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.DepositCurrency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CurrencyId");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.ToTable("DepositCurrencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Program", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("InterestRate")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<string>("ProgramName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ProgramCurrency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CurrencyId");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("ProgramCurrencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Refill", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("DepositId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateOnly>("RefillDate")
|
||||||
|
.HasColumnType("date");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DepositId");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Refills");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Term", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProgramId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProgramId");
|
||||||
|
|
||||||
|
b.ToTable("Terms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int?>("WorkerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerPatronymic")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("WorkerSurname")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("WorkerId");
|
||||||
|
|
||||||
|
b.ToTable("Workers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientDeposit", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Client", "Client")
|
||||||
|
.WithMany("Deposits")
|
||||||
|
.HasForeignKey("ClientSnils")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Clients")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Client");
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ClientProgram", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Client", "Client")
|
||||||
|
.WithMany("Programs")
|
||||||
|
.HasForeignKey("ClientSnils")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Clients")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Client");
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.DepositCurrency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Currency", "Currency")
|
||||||
|
.WithMany("Deposits")
|
||||||
|
.HasForeignKey("CurrencyId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Currencies")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Currency");
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.ProgramCurrency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Currency", "Currency")
|
||||||
|
.WithMany("Programs")
|
||||||
|
.HasForeignKey("CurrencyId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Currencies")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Currency");
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Refill", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Deposit", "Deposit")
|
||||||
|
.WithMany("Refills")
|
||||||
|
.HasForeignKey("DepositId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", "Worker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Deposit");
|
||||||
|
|
||||||
|
b.Navigation("Worker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Term", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Program", "Program")
|
||||||
|
.WithMany("Terms")
|
||||||
|
.HasForeignKey("ProgramId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Program");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BankDatabaseImplement.Models.Worker", null)
|
||||||
|
.WithMany("Workers")
|
||||||
|
.HasForeignKey("WorkerId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Client", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Deposits");
|
||||||
|
|
||||||
|
b.Navigation("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Currency", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Deposits");
|
||||||
|
|
||||||
|
b.Navigation("Programs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Deposit", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Clients");
|
||||||
|
|
||||||
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
|
b.Navigation("Refills");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Program", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Clients");
|
||||||
|
|
||||||
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
|
b.Navigation("Terms");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BankDatabaseImplement.Models.Worker", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Workers");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using BankContracts.BindingModels;
|
using BankContracts.BindingModels;
|
||||||
using BankContracts.ViewModels;
|
using BankContracts.ViewModels;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace BankDatabaseImplement.Models
|
namespace BankDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
@ -23,11 +24,11 @@ namespace BankDatabaseImplement.Models
|
|||||||
[Required]
|
[Required]
|
||||||
public int WorkerId { get; set; }
|
public int WorkerId { get; set; }
|
||||||
public virtual Worker? Worker { get; set; }
|
public virtual Worker? Worker { get; set; }
|
||||||
[ForeignKey("ClientId")]
|
[ForeignKey("ClientSnils")]
|
||||||
public virtual List<ClientProgram> Programs { get; set; } = new();
|
public virtual List<ClientProgram> Programs { get; set; } = new();
|
||||||
private Dictionary<int, IProgramModel>?
|
private Dictionary<int, IProgramModel>?
|
||||||
_clientPrograms { get; set; } = null;
|
_clientPrograms { get; set; } = null;
|
||||||
[ForeignKey("ClientId")]
|
[ForeignKey("ClientSnils")]
|
||||||
public virtual List<ClientDeposit> Deposits { get; set; } = new();
|
public virtual List<ClientDeposit> Deposits { get; set; } = new();
|
||||||
private Dictionary<int, IDepositModel>?
|
private Dictionary<int, IDepositModel>?
|
||||||
_clientDeposits { get; set; } = null;
|
_clientDeposits { get; set; } = null;
|
||||||
|
@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using BankContracts.BindingModels;
|
using BankContracts.BindingModels;
|
||||||
using BankContracts.ViewModels;
|
using BankContracts.ViewModels;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace BankDatabaseImplement.Models
|
namespace BankDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
@ -10,7 +11,7 @@ namespace BankDatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public int ClientId { get; set; }
|
public string ClientSnils { get; set; } = string.Empty;
|
||||||
[Required]
|
[Required]
|
||||||
public int DepositId { get; set; }
|
public int DepositId { get; set; }
|
||||||
public virtual Client Client { get; set; } = new();
|
public virtual Client Client { get; set; } = new();
|
||||||
|
@ -10,7 +10,7 @@ namespace BankDatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public int ClientId { get; set; }
|
public string ClientSnils { get; set; } = string.Empty;
|
||||||
[Required]
|
[Required]
|
||||||
public int ProgramId { get; set; }
|
public int ProgramId { get; set; }
|
||||||
public virtual Client Client { get; set; } = new();
|
public virtual Client Client { get; set; } = new();
|
||||||
|
@ -23,8 +23,7 @@ namespace BankDatabaseImplement.Models
|
|||||||
[ForeignKey("DepositId")]
|
[ForeignKey("DepositId")]
|
||||||
public virtual List<Refill> Refills { get; set; } = new();
|
public virtual List<Refill> Refills { get; set; } = new();
|
||||||
private Dictionary<int, ICurrencyModel>?
|
private Dictionary<int, ICurrencyModel>?
|
||||||
_depositCurrencies
|
_depositCurrencies { get; set; } = null;
|
||||||
{ get; set; } = null;
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public Dictionary<int, ICurrencyModel> DepositCurrencies
|
public Dictionary<int, ICurrencyModel> DepositCurrencies
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user