// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using OemanTrader.EntityFramework; #nullable disable namespace OemanTrader.EntityFramework.Migrations { [DbContext(typeof(OemanTraderDbContext))] [Migration("20220508202548_initial")] partial class initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "6.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); modelBuilder.Entity("OemanTrader.Domain.Models.Account", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("AccountHolderId") .HasColumnType("int"); b.Property("Balance") .HasColumnType("float"); b.HasKey("Id"); b.HasIndex("AccountHolderId"); b.ToTable("Accounts"); }); modelBuilder.Entity("OemanTrader.Domain.Models.AssetTransaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("AccountId") .HasColumnType("int"); b.Property("DateProcessed") .HasColumnType("datetime2"); b.Property("IsPurchase") .HasColumnType("bit"); b.Property("ShareAmount") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("AccountId"); b.ToTable("AssetTransactions"); }); modelBuilder.Entity("OemanTrader.Domain.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("DateJoined") .HasColumnType("datetime2"); b.Property("Email") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Password") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UserName") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("OemanTrader.Domain.Models.Account", b => { b.HasOne("OemanTrader.Domain.Models.User", "AccountHolder") .WithMany() .HasForeignKey("AccountHolderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("AccountHolder"); }); modelBuilder.Entity("OemanTrader.Domain.Models.AssetTransaction", b => { b.HasOne("OemanTrader.Domain.Models.Account", "Account") .WithMany("AssetTransactions") .HasForeignKey("AccountId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.OwnsOne("OemanTrader.Domain.Models.Stock", "Stock", b1 => { b1.Property("AssetTransactionId") .HasColumnType("int"); b1.Property("PricePerShare") .HasColumnType("float"); b1.Property("Symbol") .IsRequired() .HasColumnType("nvarchar(max)"); b1.HasKey("AssetTransactionId"); b1.ToTable("AssetTransactions"); b1.WithOwner() .HasForeignKey("AssetTransactionId"); }); b.Navigation("Account"); b.Navigation("Stock") .IsRequired(); }); modelBuilder.Entity("OemanTrader.Domain.Models.Account", b => { b.Navigation("AssetTransactions"); }); #pragma warning restore 612, 618 } } }