175 lines
5.8 KiB
C#
175 lines
5.8 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using IO.Swagger.Services;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace IO.Swagger.Migrations
|
|
{
|
|
[DbContext(typeof(BankDbContext))]
|
|
partial class BankDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.10")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.Currency", b =>
|
|
{
|
|
b.Property<int>("CurrencyId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("CurrencyId"));
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("Symbol")
|
|
.HasMaxLength(4)
|
|
.HasColumnType("nvarchar(4)");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("CurrencyId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Currencies");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.Transaction", b =>
|
|
{
|
|
b.Property<int>("TransactionId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("TransactionId"));
|
|
|
|
b.Property<float>("Amount")
|
|
.HasColumnType("real");
|
|
|
|
b.Property<int>("CurrencyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("FromUserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Memo")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<int>("ToUserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("TransactionTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("TransactionId");
|
|
|
|
b.HasIndex("CurrencyId");
|
|
|
|
b.HasIndex("FromUserId");
|
|
|
|
b.HasIndex("ToUserId");
|
|
|
|
b.ToTable("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Salt")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.Currency", b =>
|
|
{
|
|
b.HasOne("IO.Swagger.Models.db.User", "User")
|
|
.WithMany("Currencies")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.Transaction", b =>
|
|
{
|
|
b.HasOne("IO.Swagger.Models.db.Currency", "Currency")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("CurrencyId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("IO.Swagger.Models.db.User", "FromUser")
|
|
.WithMany("TransactionsFrom")
|
|
.HasForeignKey("FromUserId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("IO.Swagger.Models.db.User", "ToUser")
|
|
.WithMany("TransactionsTo")
|
|
.HasForeignKey("ToUserId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Currency");
|
|
|
|
b.Navigation("FromUser");
|
|
|
|
b.Navigation("ToUser");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.Currency", b =>
|
|
{
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("IO.Swagger.Models.db.User", b =>
|
|
{
|
|
b.Navigation("Currencies");
|
|
|
|
b.Navigation("TransactionsFrom");
|
|
|
|
b.Navigation("TransactionsTo");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|