using Microsoft.EntityFrameworkCore; using Pcm.Db.Entities; namespace Pcm.Db; public class PcmDbContext : DbContext { public PcmDbContext() { } public PcmDbContext(DbContextOptions options) : base(options) { } public virtual DbSet Akwizytorzy { get; set; } public virtual DbSet Artykuly { get; set; } public virtual DbSet Asortymenty { get; set; } public virtual DbSet Banki { get; set; } public virtual DbSet Blokady { get; set; } public virtual DbSet CentrStanZgodies { get; set; } public virtual DbSet Czas { get; set; } public virtual DbSet DefinicjaKodus { get; set; } public virtual DbSet Dokumenty { get; set; } public virtual DbSet DokDodKths { get; set; } public virtual DbSet DokKasas { get; set; } public virtual DbSet DokKontaBankowe { get; set; } public virtual DbSet DokKontr { get; set; } public virtual DbSet DokKurs { get; set; } public virtual DbSet DokPunkty { get; set; } public virtual DbSet DokWaluta { get; set; } public virtual DbSet DostProds { get; set; } public virtual DbSet Dostawcy { get; set; } public virtual DbSet DzienRozls { get; set; } public virtual DbSet DzienRozlParams { get; set; } public virtual DbSet FormZgods { get; set; } public virtual DbSet FormaPlatnPos7s { get; set; } public virtual DbSet FormaPlatnoscis { get; set; } public virtual DbSet GrWartoscs { get; set; } public virtual DbSet GrupaAkcyzowas { get; set; } public virtual DbSet GrupaTows { get; set; } public virtual DbSet GrupaUzs { get; set; } public virtual DbSet HarmCenies { get; set; } public virtual DbSet HarmCykls { get; set; } public virtual DbSet HarmHarms { get; set; } public virtual DbSet HarmWpis { get; set; } public virtual DbSet Istws { get; set; } public virtual DbSet Jms { get; set; } public virtual DbSet KartaLojs { get; set; } public virtual DbSet KasKods { get; set; } public virtual DbSet KasPars { get; set; } public virtual DbSet KasTows { get; set; } public virtual DbSet Kasas { get; set; } public virtual DbSet KasaFormaPlatns { get; set; } public virtual DbSet KatParams { get; set; } public virtual DbSet Kategoria { get; set; } public virtual DbSet KodDods { get; set; } public virtual DbSet KodWazonies { get; set; } public virtual DbSet Komentarzs { get; set; } public virtual DbSet Konfig { get; set; } public virtual DbSet KontoBankowes { get; set; } public virtual DbSet KontoBankoweKontrs { get; set; } public virtual DbSet KontoLojs { get; set; } public virtual DbSet KontrOpis { get; set; } public virtual DbSet Kontrahents { get; set; } public virtual DbSet Krajs { get; set; } public virtual DbSet KrajStawkas { get; set; } public virtual DbSet KthParWartoscs { get; set; } public virtual DbSet KthParams { get; set; } public virtual DbSet KthTypOs { get; set; } public virtual DbSet KthWartoscs { get; set; } public virtual DbSet KursWaluties { get; set; } public virtual DbSet LiniaLotniczas { get; set; } public virtual DbSet LogOperations { get; set; } public virtual DbSet LogTypeDefs { get; set; } public virtual DbSet LogValChangeNums { get; set; } public virtual DbSet LogValChangeTxts { get; set; } public virtual DbSet Lotniskos { get; set; } public virtual DbSet Magazyns { get; set; } public virtual DbSet MarZakres { get; set; } public virtual DbSet Marzowniks { get; set; } public virtual DbSet Notatkis { get; set; } public virtual DbSet NrRejs { get; set; } public virtual DbSet NrRejKarta { get; set; } public virtual DbSet NumDoks { get; set; } public virtual DbSet NumMags { get; set; } public virtual DbSet OdbProds { get; set; } public virtual DbSet Odbiorcas { get; set; } public virtual DbSet OfKods { get; set; } public virtual DbSet OfSlowniks { get; set; } public virtual DbSet Oferta { get; set; } public virtual DbSet OpisZdarzLojs { get; set; } public virtual DbSet Oplata { get; set; } public virtual DbSet Osobas { get; set; } public virtual DbSet Panels { get; set; } public virtual DbSet PanelParams { get; set; } public virtual DbSet ParBons { get; set; } public virtual DbSet ParPunkties { get; set; } public virtual DbSet ParWaluta { get; set; } public virtual DbSet ParWartoscs { get; set; } public virtual DbSet Paragony { get; set; } public virtual DbSet Parametry { get; set; } public virtual DbSet Partie { get; set; } public virtual DbSet PcfUsers { get; set; } public virtual DbSet Phs { get; set; } public virtual DbSet Phdanes { get; set; } public virtual DbSet PhodbDanes { get; set; } public virtual DbSet Phodbiorcas { get; set; } public virtual DbSet Phrozliczenies { get; set; } public virtual DbSet PolMags { get; set; } public virtual DbSet PolParams { get; set; } public virtual DbSet Politykas { get; set; } public virtual DbSet PowKontLojs { get; set; } public virtual DbSet Powiadomienies { get; set; } public virtual DbSet PowiadomienieParams { get; set; } public virtual DbSet Powiazanies { get; set; } public virtual DbSet PowiazanieSkleps { get; set; } public virtual DbSet PowiazanieUzs { get; set; } public virtual DbSet PowiazanieUzNaSkleps { get; set; } public virtual DbSet PozAkcyzas { get; set; } public virtual DbSet PozDoks { get; set; } public virtual DbSet PozPars { get; set; } public virtual DbSet PozParSzczegs { get; set; } public virtual DbSet PozWzs { get; set; } public virtual DbSet Profils { get; set; } public virtual DbSet ProfilKasas { get; set; } public virtual DbSet ProfilKonfigs { get; set; } public virtual DbSet PrtMags { get; set; } public virtual DbSet Przydzials { get; set; } public virtual DbSet RapWartPoczs { get; set; } public virtual DbSet RapWartPoczDanes { get; set; } public virtual DbSet Regulas { get; set; } public virtual DbSet RegulaAsorts { get; set; } public virtual DbSet RegulaDoks { get; set; } public virtual DbSet RegulaDokSzczegs { get; set; } public virtual DbSet RegulaKods { get; set; } public virtual DbSet RegulaPars { get; set; } public virtual DbSet RegulaParSzczegs { get; set; } public virtual DbSet RegulaParams { get; set; } public virtual DbSet RegulaPozDoks { get; set; } public virtual DbSet RegulaPozDokSzczegs { get; set; } public virtual DbSet RegulaPozPars { get; set; } public virtual DbSet RegulaPozParSzczegs { get; set; } public virtual DbSet RegulaProgs { get; set; } public virtual DbSet RegulaSkleps { get; set; } public virtual DbSet RegulaTowars { get; set; } public virtual DbSet Rolas { get; set; } public virtual DbSet RozPrtMags { get; set; } public virtual DbSet RozbicieDoks { get; set; } public virtual DbSet Rozliczas { get; set; } public virtual DbSet RozliczeniePartiis { get; set; } public virtual DbSet Sesjas { get; set; } public virtual DbSet SesjaAktywnas { get; set; } public virtual DbSet SkladnikDefinicjiKodus { get; set; } public virtual DbSet SkladnikWzorcas { get; set; } public virtual DbSet Skleps { get; set; } public virtual DbSet SklepArtykuls { get; set; } public virtual DbSet SklepBanks { get; set; } public virtual DbSet SklepDefinicjaKodus { get; set; } public virtual DbSet SklepDoks { get; set; } public virtual DbSet SklepDokDodKths { get; set; } public virtual DbSet SklepDokKurs { get; set; } public virtual DbSet SklepDokPunkties { get; set; } public virtual DbSet SklepDokWaluta { get; set; } public virtual DbSet SklepDosts { get; set; } public virtual DbSet SklepDzienRozls { get; set; } public virtual DbSet SklepDzienRozlParams { get; set; } public virtual DbSet SklepFlagis { get; set; } public virtual DbSet SklepFormZgods { get; set; } public virtual DbSet SklepFormaPlatnPos7s { get; set; } public virtual DbSet SklepGrupaAkcyzowas { get; set; } public virtual DbSet SklepGrupaUzs { get; set; } public virtual DbSet SklepIstws { get; set; } public virtual DbSet SklepKartaLojs { get; set; } public virtual DbSet SklepKasas { get; set; } public virtual DbSet SklepKasaFormaPlatns { get; set; } public virtual DbSet SklepKontoBankowes { get; set; } public virtual DbSet SklepKontoBankoweKontrs { get; set; } public virtual DbSet SklepKontoLojs { get; set; } public virtual DbSet SklepKontrs { get; set; } public virtual DbSet SklepKontrOpis { get; set; } public virtual DbSet SklepKontrSkleps { get; set; } public virtual DbSet SklepKthPrzydzials { get; set; } public virtual DbSet SklepKthTypOs { get; set; } public virtual DbSet SklepMagazyns { get; set; } public virtual DbSet SklepNarzDosts { get; set; } public virtual DbSet SklepNotatkis { get; set; } public virtual DbSet SklepNrRejs { get; set; } public virtual DbSet SklepNrRejKarta { get; set; } public virtual DbSet SklepOplata { get; set; } public virtual DbSet SklepPanels { get; set; } public virtual DbSet SklepPanelParams { get; set; } public virtual DbSet SklepParBons { get; set; } public virtual DbSet SklepParPunkties { get; set; } public virtual DbSet SklepParWaluta { get; set; } public virtual DbSet SklepParagons { get; set; } public virtual DbSet SklepPartia { get; set; } public virtual DbSet SklepPowKontLojs { get; set; } public virtual DbSet SklepPowiazanieUzs { get; set; } public virtual DbSet SklepPozAkcyzas { get; set; } public virtual DbSet SklepPozDoks { get; set; } public virtual DbSet SklepPozPars { get; set; } public virtual DbSet SklepPozParSzczegs { get; set; } public virtual DbSet SklepProfils { get; set; } public virtual DbSet SklepProfilKonfigs { get; set; } public virtual DbSet SklepPrtMags { get; set; } public virtual DbSet SklepPrzydzials { get; set; } public virtual DbSet SklepRapWartPoczs { get; set; } public virtual DbSet SklepRapWartPoczDanes { get; set; } public virtual DbSet SklepRegulas { get; set; } public virtual DbSet SklepRegulaAsorts { get; set; } public virtual DbSet SklepRegulaDoks { get; set; } public virtual DbSet SklepRegulaDokSzczegs { get; set; } public virtual DbSet SklepRegulaPars { get; set; } public virtual DbSet SklepRegulaParSzczegs { get; set; } public virtual DbSet SklepRegulaParams { get; set; } public virtual DbSet SklepRegulaPozDoks { get; set; } public virtual DbSet SklepRegulaPozDokSzczegs { get; set; } public virtual DbSet SklepRegulaPozPars { get; set; } public virtual DbSet SklepRegulaPozParSzczegs { get; set; } public virtual DbSet SklepRegulaTowars { get; set; } public virtual DbSet SklepRolas { get; set; } public virtual DbSet SklepRozPrtMags { get; set; } public virtual DbSet SklepRozbicieDoks { get; set; } public virtual DbSet SklepRozlPartiis { get; set; } public virtual DbSet SklepRozliczas { get; set; } public virtual DbSet SklepSkladnikDefinicjiKodus { get; set; } public virtual DbSet SklepSkladnikWzorcas { get; set; } public virtual DbSet SklepSkleps { get; set; } public virtual DbSet SklepStanPrtMags { get; set; } public virtual DbSet SklepSzczegPrtMags { get; set; } public virtual DbSet SklepTekstDoks { get; set; } public virtual DbSet SklepTekstPozs { get; set; } public virtual DbSet SklepTekstZgodies { get; set; } public virtual DbSet SklepTowAkcyzas { get; set; } public virtual DbSet SklepTowDodateks { get; set; } public virtual DbSet SklepTowKods { get; set; } public virtual DbSet SklepTowPowiazanies { get; set; } public virtual DbSet SklepTowStraties { get; set; } public virtual DbSet SklepTowars { get; set; } public virtual DbSet SklepTowarSkladnikas { get; set; } public virtual DbSet SklepTypOs { get; set; } public virtual DbSet SklepUprawnienies { get; set; } public virtual DbSet SklepUzytkowniks { get; set; } public virtual DbSet SklepWaluta { get; set; } public virtual DbSet SklepZaleznoscs { get; set; } public virtual DbSet SklepZasobs { get; set; } public virtual DbSet SklepZdarzOs { get; set; } public virtual DbSet SklepZdarzOsOpis { get; set; } public virtual DbSet SklepZgoda { get; set; } public virtual DbSet Sprzedazs { get; set; } public virtual DbSet StanPrtMags { get; set; } public virtual DbSet StanZgodies { get; set; } public virtual DbSet Struktura73s { get; set; } public virtual DbSet Subsys { get; set; } public virtual DbSet SzczegPrtMags { get; set; } public virtual DbSet TabelaAkcyzowas { get; set; } public virtual DbSet TekstDoks { get; set; } public virtual DbSet TekstPozs { get; set; } public virtual DbSet TekstZgodies { get; set; } public virtual DbSet TowAkcyzas { get; set; } public virtual DbSet TowDodateks { get; set; } public virtual DbSet TowKrajs { get; set; } public virtual DbSet TowPowiazanies { get; set; } public virtual DbSet TowStraties { get; set; } public virtual DbSet TowStratyDlaSklepus { get; set; } public virtual DbSet TowWartoscs { get; set; } public virtual DbSet Towars { get; set; } public virtual DbSet TowarSkladnikas { get; set; } public virtual DbSet TypOs { get; set; } public virtual DbSet Uprawnienies { get; set; } public virtual DbSet UprawnienieNaSkleps { get; set; } public virtual DbSet UzNaSkleps { get; set; } public virtual DbSet Uzytkowniks { get; set; } public virtual DbSet Vats { get; set; } public virtual DbSet Waluta { get; set; } public virtual DbSet Wersja72s { get; set; } public virtual DbSet Wzorzecs { get; set; } public virtual DbSet Zaleznoscs { get; set; } public virtual DbSet Zasobs { get; set; } public virtual DbSet ZdarzLojs { get; set; } public virtual DbSet ZdarzOs { get; set; } public virtual DbSet ZdarzOsOpis { get; set; } public virtual DbSet Zgoda { get; set; } public virtual DbSet ZlecKomunikats { get; set; } public virtual DbSet ZlecParams { get; set; } public virtual DbSet Zlecenies { get; set; } public virtual DbSet Zmianas { get; set; } public virtual DbSet ZmianaTabelis { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "Polish_CI_AS"); modelBuilder.Entity(entity => { entity.HasKey(e => e.AkwId) .HasName("PK_AKWIZYTOR"); entity.ToTable("Akwizytor"); entity.Property(e => e.AkwId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Nazwisko) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Prowizja).HasColumnType("decimal(10, 4)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ArtId) .HasName("PK_ARTYKUL"); entity.ToTable("Artykul"); entity.HasIndex(e => e.CentrArtId, "idx_CentrArtId"); entity.Property(e => e.ArtId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ArtNazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.CentrArtId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.GlownyTowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.GlownyTow) .WithMany(p => p.Artykuls) .HasForeignKey(d => d.GlownyTowId) .HasConstraintName("FK_ARTGLOWNYTOWID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.AsId) .HasName("PK_ASORT"); entity.ToTable("Asort"); entity.HasIndex(e => e.CentrAsId, "idx_CentrAsId"); entity.Property(e => e.AsId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrAsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Param1).HasColumnType("decimal(15, 4)"); }); modelBuilder.Entity(entity => { entity.ToTable("Bank"); entity.Property(e => e.BankId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Adres) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.CentrBankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.NrRozliBank) .HasMaxLength(8) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SesjaId, e.TowId, e.MagId }) .HasName("PK_BLOKADA"); entity.HasIndex(e => new { e.TowId, e.MagId }, "idx_BlokTowMag"); entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sesja) .WithMany(p => p.Blokada) .HasForeignKey(d => d.SesjaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_BLOKADA_REF_BLOKS_SESJAAKT"); entity.HasOne(d => d.Istw) .WithMany(p => p.Blokada) .HasForeignKey(d => new { d.TowId, d.MagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_BLOKADA_REF_BLOKT_ISTW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.ZgId }) .HasName("PK_CENTRSTANZGODY"); entity.ToTable("CentrStanZgody"); entity.HasIndex(e => e.ZgId, "idx_CESTZG_ZG"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataDec).HasColumnType("datetime"); entity.Property(e => e.Kiedy) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.HasOne(d => d.Kontr) .WithMany(p => p.CentrStanZgodies) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_CESTZG_KTH"); entity.HasOne(d => d.Zg) .WithMany(p => p.CentrStanZgodies) .HasForeignKey(d => d.ZgId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_CESTZG_ZG"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CzasId) .HasName("PK_CZAS"); entity.Property(e => e.CzasId) .HasColumnType("numeric(9, 0)") .HasColumnName("CzasID"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.Dzien).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DzienMiesiaca).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DzienTygodnia).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Miesiac).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MiesiacRoku).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Rok).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tydzien).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TydzienRoku).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Weekend).HasColumnType("numeric(9, 0)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Dkid) .HasName("PK_DEFKODU"); entity.ToTable("DefinicjaKodu"); entity.Property(e => e.Dkid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("DKId"); entity.Property(e => e.CentrDkid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrDKId"); entity.Property(e => e.DataDo).HasColumnType("datetime"); entity.Property(e => e.DataOd).HasColumnType("datetime"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.ToTable("Dok"); entity.HasIndex(e => new { e.TypDok, e.Data, e.KolejnyWdniu }, "DokTypDok"); entity.HasIndex(e => e.CentrDokId, "idx_DokCentrDokId"); entity.HasIndex(e => new { e.Data, e.KolejnyWdniu }, "idx_DokDataKolejnyWDniu"); entity.HasIndex(e => e.MagId, "idx_DokMagId"); entity.HasIndex(e => e.NrDok, "idx_DokNrDok"); entity.HasIndex(e => e.UzId, "idx_DokUzId"); entity.HasIndex(e => e.WalId, "idx_DokWal"); entity.HasIndex(e => e.Zmiana, "idx_DokZmiana"); entity.HasIndex(e => e.ZmianaPkt, "idx_DokZmianaPkt"); entity.Property(e => e.DokId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrDokId).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.DataDod).HasColumnType("datetime"); entity.Property(e => e.DataPom).HasColumnType("datetime"); entity.Property(e => e.DoZaplaty).HasColumnType("decimal(15, 4)"); entity.Property(e => e.EksportFk).HasColumnName("EksportFK"); entity.Property(e => e.KolejnyWdniu).HasColumnName("KolejnyWDniu"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota10).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota11).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota12).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota4).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota5).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota6).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota7).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota8).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota9).HasColumnType("decimal(15, 4)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDetUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoMagUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NrDok) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDetUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekMagUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Razem).HasColumnType("decimal(15, 4)"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zaplacono).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ZaplaconoPodatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ZaplaconoWkasie) .HasColumnType("decimal(15, 4)") .HasColumnName("ZaplaconoWKasie"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaPkt).HasColumnType("datetime"); entity.HasOne(d => d.Mag) .WithMany(p => p.Doks) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOK_REF_DOKMA_MAGAZYN"); entity.HasOne(d => d.Uz) .WithMany(p => p.Doks) .HasForeignKey(d => d.UzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOK_REF_DOKUZ_UZYTKOWN"); entity.HasOne(d => d.Wal) .WithMany(p => p.Doks) .HasForeignKey(d => d.WalId) .HasConstraintName("FK_DOK_REF_DOKWA_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Znaczenie }) .HasName("PK_DOKDODKTH"); entity.ToTable("DokDodKth"); entity.HasIndex(e => e.KontrId, "idx_DDKth"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Dok) .WithMany(p => p.DokDodKths) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKDODKT_REF_DDK_DOK"); entity.HasOne(d => d.Kontr) .WithMany(p => p.DokDodKths) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKDODKT_REF_DKD_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DokId) .HasName("PK_DOKKASA"); entity.ToTable("DokKasa"); entity.HasIndex(e => e.KasaId, "idx_DokKasaId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Dok) .WithOne(p => p.DokKasa) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKASA_REF_DOKKA_DOK"); entity.HasOne(d => d.Kasa) .WithMany(p => p.DokKasas) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKASA_REF_KASA_KASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kbid }); entity.ToTable("DokKontoBankowe"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kbid) .HasColumnType("numeric(9, 0)") .HasColumnName("KBId"); entity.HasOne(d => d.Dok) .WithMany(p => p.DokKontoBankowes) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKONTOBANK_DOK"); entity.HasOne(d => d.Kb) .WithMany(p => p.DokKontoBankowes) .HasForeignKey(d => d.Kbid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKONTOBANK_KONTOBANK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DokId) .HasName("PK_DOKKONTR"); entity.ToTable("DokKontr"); entity.HasIndex(e => e.KontrId, "idx_DokKontrId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Dok) .WithOne(p => p.DokKontr) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKONTR_REF_DOKKO_DOK"); entity.HasOne(d => d.Kontr) .WithMany(p => p.DokKontrs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKONTR_REF_KONTR_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Znaczenie }) .HasName("PK_DOKKURS"); entity.HasIndex(e => e.WalId, "idx_DokKursWal"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NrTabeli) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Dok) .WithMany(p => p.DokKurs) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKURS_DOK"); entity.HasOne(d => d.Wal) .WithMany(p => p.DokKurs) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKKURS_WAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Typ }) .HasName("PK_DOKPUNKTY"); entity.ToTable("DokPunkty"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy).HasColumnType("datetime"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.DokPunkties) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKPUNKT_REF_DOKPK_DOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.WalId }) .HasName("PK_DOKWALUTA"); entity.HasIndex(e => e.WalId, "idx_WalDok"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DokKwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.DokWaluta) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKWALUT_REF_DOKWA_DOK"); entity.HasOne(d => d.Wal) .WithMany(p => p.DokWaluta) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOKWALUT_REF_WALDO_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DostId, e.ProdId }) .HasName("PK_DOSTPROD"); entity.ToTable("DostProd"); entity.Property(e => e.DostId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ProdId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RabatProd).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Dost) .WithMany(p => p.DostProdDosts) .HasForeignKey(d => d.DostId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_DostPrKth"); entity.HasOne(d => d.Prod) .WithMany(p => p.DostProdProds) .HasForeignKey(d => d.ProdId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PrDostKth"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.TowId }) .HasName("PK_DOSTAWCA"); entity.ToTable("Dostawca"); entity.HasIndex(e => e.TowId, "idx_DostTowId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatOdWart).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.Dostawcas) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOSTAWCA_REF_KTHDO_KONTRAHE"); entity.HasOne(d => d.Tow) .WithMany(p => p.Dostawcas) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_DOSTAWCA_REF_TOWDO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Dzien) .HasName("PK_DZIENROZL"); entity.ToTable("DzienRozl"); entity.HasIndex(e => e.Zmiana, "idx_DzienZmiana"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Dzien, e.Znaczenie }) .HasName("PK_DZIENROZLPARAM"); entity.ToTable("DzienRozlParam"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.Wartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.DzienNavigation) .WithMany(p => p.DzienRozlParams) .HasForeignKey(d => d.Dzien) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_DzienRozlPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TypOsId, e.ZgId }) .HasName("PK_FORMZGOD"); entity.ToTable("FormZgod"); entity.HasIndex(e => e.ZgId, "idx_FMZG_ZGODA"); entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.TypOs) .WithMany(p => p.FormZgods) .HasForeignKey(d => d.TypOsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_FMZG_TYPOS"); entity.HasOne(d => d.Zg) .WithMany(p => p.FormZgods) .HasForeignKey(d => d.ZgId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_FMZG_ZGODA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.FormaId); entity.ToTable("FormaPlatnPos7"); entity.Property(e => e.FormaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrFormaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kolejnosc).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SerwisPlatniczy) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.FormaPlat) .HasName("PK_FORMAPLATNOSCI"); entity.ToTable("FormaPlatnosci"); entity.Property(e => e.FormaPlat).ValueGeneratedNever(); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.GrId, e.ParId, e.Wartosc }) .HasName("PK_GRWARTOSC"); entity.ToTable("GrWartosc"); entity.Property(e => e.GrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Gr) .WithMany(p => p.GrWartoscs) .HasForeignKey(d => d.GrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_GRWARTOS_REF_GRWAR_GRUPATOW"); entity.HasOne(d => d.Par) .WithMany(p => p.GrWartoscs) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_GRWARTOS_REF_PARGR_PARAMETR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.GrAkcId) .HasName("PK_GRUPAAKCYZOWA"); entity.ToTable("GrupaAkcyzowa"); entity.Property(e => e.GrAkcId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.AkcJm) .IsRequired() .HasMaxLength(20) .IsUnicode(false) .HasColumnName("AkcJM"); entity.Property(e => e.CentrGrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DodJm) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("DodJM"); entity.Property(e => e.IleDodJmwakcJm) .HasColumnType("decimal(15, 4)") .HasColumnName("IleDodJMWAkcJM"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.OpcjeWzoru) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opis) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.PrefiksyCn) .HasMaxLength(255) .IsUnicode(false) .HasColumnName("PrefiksyCN"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.GrId) .HasName("PK_GRUPATOW"); entity.ToTable("GrupaTow"); entity.Property(e => e.GrId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opis) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.UzId) .HasName("PK_GRUPAUZ"); entity.ToTable("GrupaUz"); entity.HasIndex(e => e.RolaId, "idx_Rola"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RolaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Rola) .WithMany(p => p.GrupaUzRolas) .HasForeignKey(d => d.RolaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_GRUPAUZ_REF_GRROL_UZYTKOWN"); entity.HasOne(d => d.Uz) .WithOne(p => p.GrupaUzUz) .HasForeignKey(d => d.UzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_GRUPAUZ_REF_GRUZ_UZYTKOWN"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.HarmId, e.TowId }) .HasName("PK_HARMCENY"); entity.ToTable("HarmCeny"); entity.HasIndex(e => e.TowId, "idx_HarmTow"); entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Inne) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Harm) .WithMany(p => p.HarmCenies) .HasForeignKey(d => d.HarmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_HARMCENY_REF_HARMC_HARMWPIS"); entity.HasOne(d => d.Tow) .WithMany(p => p.HarmCenies) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_HARMCENY_REF_HARMT_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.HarmId, e.OdDnia, e.OdGodz, e.OdMin }) .HasName("PK_HARMCYKL"); entity.ToTable("HarmCykl"); entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Harm) .WithMany(p => p.HarmCykls) .HasForeignKey(d => d.HarmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_HARMCYKL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.HarmId, e.Znaczenie }) .HasName("PK_HARMHARM"); entity.ToTable("HarmHarm"); entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PoprzHarmId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Harm) .WithMany(p => p.HarmHarmHarms) .HasForeignKey(d => d.HarmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_HARMHARM"); entity.HasOne(d => d.PoprzHarm) .WithMany(p => p.HarmHarmPoprzHarms) .HasForeignKey(d => d.PoprzHarmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_HARMPOPRZHARM"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.HarmId) .HasName("PK_HARMWPIS"); entity.HasIndex(e => new { e.KrajId, e.HarmId }, "idx_HarmKraj"); entity.HasIndex(e => e.PolId, "idx_HarmPol"); entity.Property(e => e.HarmId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrHarmId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opcje) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.PolId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WaznyDo).HasColumnType("datetime"); entity.Property(e => e.WaznyOd).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kraj) .WithMany(p => p.HarmWpis) .HasForeignKey(d => d.KrajId) .HasConstraintName("FK_Ref_HarmKraj"); entity.HasOne(d => d.Pol) .WithMany(p => p.HarmWpis) .HasForeignKey(d => d.PolId) .HasConstraintName("FK_HARMWPIS_REF_HARMP_POLITYKA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.MagId }) .HasName("PK_ISTW"); entity.ToTable("Istw"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.BlokadaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RezerwacjaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMax).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMin).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Mag) .WithMany(p => p.Istws) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ISTW_REF_ISTWM_MAGAZYN"); entity.HasOne(d => d.Tow) .WithMany(p => p.Istws) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ISTW_REF_TOWIS_TOWAR"); }); modelBuilder.Entity(entity => { entity.ToTable("JM"); entity.HasIndex(e => e.CentrJmid, "idx_CentrJMId"); entity.Property(e => e.Jmid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("JMId"); entity.Property(e => e.CentrJmid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrJMId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(10) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KartaId) .HasName("PK_KARTALOJ"); entity.ToTable("KartaLoj"); entity.HasIndex(e => e.KodKarty, "idx_KLoj_KodKarty"); entity.HasIndex(e => e.KontoId, "idx_KLoj_Konto"); entity.Property(e => e.KartaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrKartaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KodKarty) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Opis1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opis2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Posiadacz) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Uniewazniono).HasColumnType("datetime"); entity.Property(e => e.WaznaDo).HasColumnType("datetime"); entity.Property(e => e.WaznaOd).HasColumnType("datetime"); entity.HasOne(d => d.Konto) .WithMany(p => p.KartaLojs) .HasForeignKey(d => d.KontoId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_KartaKonto"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.TowId, e.Kolejnosc }) .HasName("PK_KASKOD"); entity.ToTable("KasKod"); entity.HasIndex(e => new { e.TowId, e.Kolejnosc }, "idx_KasKodTow"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IleWkodzie) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWKodzie"); entity.Property(e => e.KasPrefPlu).HasColumnName("KasPrefPLU"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KodOpak) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Plu).HasColumnName("PLU"); entity.Property(e => e.Pluopak).HasColumnName("PLUOpak"); entity.Property(e => e.Rezerwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot) .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Kasa) .WithMany(p => p.KasKods) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASKOD_REF_KASKO_KASA"); entity.HasOne(d => d.Tow) .WithMany(p => p.KasKods) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASKOD_REF_KASKO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.ParNazwa }) .HasName("PK_KASPAR"); entity.ToTable("KasPar"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParNazwa) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Kasa) .WithMany(p => p.KasPars) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASPAR_REF_KASPA_KASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.KodWyslany }) .HasName("PK_KASTOW"); entity.ToTable("KasTow"); entity.HasIndex(e => new { e.KasaId, e.Plu, e.DodIndeks }, "idx_KasTowKasaPluDodIndeks"); entity.HasIndex(e => e.TowId, "idx_KasTowTowId"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KodWyslany) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kasa) .WithMany(p => p.KasTows) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASTOW_REF_KASKO_KASA"); entity.HasOne(d => d.Tow) .WithMany(p => p.KasTows) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASTOW_REF_KASTO_TOWAR"); }); modelBuilder.Entity(entity => { entity.ToTable("Kasa"); entity.Property(e => e.KasaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Stanowisko) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Typ) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Mag) .WithMany(p => p.Kasas) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASA_REF_KASAM_MAGAZYN"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.FormaId, e.KasaId }); entity.ToTable("KasaFormaPlatn"); entity.Property(e => e.FormaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Forma) .WithMany(p => p.KasaFormaPlatns) .HasForeignKey(d => d.FormaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASAFORMAPLATN_FPP7"); entity.HasOne(d => d.Kasa) .WithMany(p => p.KasaFormaPlatns) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KASAFORMAPLATN_KASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KatId, e.ParId }) .HasName("PK_KATPARAM"); entity.ToTable("KatParam"); entity.HasIndex(e => e.KatId, "idx_KatParKat"); entity.HasIndex(e => e.ParId, "idx_KatParPar"); entity.Property(e => e.KatId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kat) .WithMany(p => p.KatParams) .HasForeignKey(d => d.KatId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KATPARAM_REF_KATPA_KATEGORI"); entity.HasOne(d => d.Par) .WithMany(p => p.KatParams) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KATPARAM_REF_PARKA_PARAMETR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KatId) .HasName("PK_KATEGORIA"); entity.HasIndex(e => e.CentrKatId, "idx_CentrKatId"); entity.Property(e => e.KatId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrKatId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Kolejnosc }) .HasName("PK_KODDOD"); entity.ToTable("KodDod"); entity.HasIndex(e => e.Kod, "idx_KodDodKod"); entity.HasIndex(e => e.Skrot, "idx_KodDodSkrot"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IleWkodzie) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWKodzie"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.PrefPlu).HasColumnName("PrefPLU"); entity.Property(e => e.Skrot) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.SubsysKoduDod) .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Tow) .WithMany(p => p.KodDods) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KODDOD_REF_KODDO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Kwid) .HasName("PK_KODWAZONY"); entity.ToTable("KodWazony"); entity.HasIndex(e => e.CentrKwid, "idx_CentrKWId"); entity.Property(e => e.Kwid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("KWId"); entity.Property(e => e.CentrKwid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrKWId"); entity.Property(e => e.Jmid) .HasColumnType("numeric(9, 0)") .HasColumnName("JMId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.PrecyzjaWkodzie).HasColumnName("PrecyzjaWKodzie"); entity.Property(e => e.WartoscWkodzie).HasColumnName("WartoscWKodzie"); entity.HasOne(d => d.Jm) .WithMany(p => p.KodWazonies) .HasForeignKey(d => d.Jmid) .HasConstraintName("Ref_KodWazony"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ZmId) .HasName("PK_KOMENTARZ"); entity.ToTable("Komentarz"); entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Opis) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Zm) .WithOne(p => p.Komentarz) .HasForeignKey(d => d.ZmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KOMENTAR_REF_ZMKOM_ZMIANA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParGrupa, e.ParNazwa }) .HasName("PK_KONFIG"); entity.ToTable("Konfig"); entity.Property(e => e.ParGrupa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParNazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Kbid); entity.ToTable("KontoBankowe"); entity.Property(e => e.Kbid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("KBId"); entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrKBId"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.PowKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("PowKBId"); entity.Property(e => e.Sufix) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Bank) .WithMany(p => p.KontoBankowes) .HasForeignKey(d => d.BankId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KONTOBANK_BANK"); entity.HasOne(d => d.Mag) .WithMany(p => p.KontoBankowes) .HasForeignKey(d => d.MagId) .HasConstraintName("FK_KONTOBANK_MAGAZYN"); entity.HasOne(d => d.Wal) .WithMany(p => p.KontoBankowes) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KONTOBANK_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Kbkid); entity.ToTable("KontoBankoweKontr"); entity.Property(e => e.Kbkid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("KBKId"); entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrKbkid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrKBKId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.PowKbkid) .HasColumnType("numeric(9, 0)") .HasColumnName("PowKBKId"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Bank) .WithMany(p => p.KontoBankoweKontrs) .HasForeignKey(d => d.BankId) .HasConstraintName("FK_KONTOBANKKONTR_BANK"); entity.HasOne(d => d.Kontr) .WithMany(p => p.KontoBankoweKontrs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KONTOBANKKONTR_KONTR"); entity.HasOne(d => d.Wal) .WithMany(p => p.KontoBankoweKontrs) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KONTOBANKKONTR_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KontoId) .HasName("PK_KONTOLOJ"); entity.ToTable("KontoLoj"); entity.HasIndex(e => e.KontrId, "idx_KLoj_KontrId"); entity.HasIndex(e => e.ZmianaStanu, "idx_KLoj_ZmStanu"); entity.HasIndex(e => e.Zmiana, "idx_KLoj_Zmiana"); entity.Property(e => e.KontoId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Stan).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanPocz).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaStanu).HasColumnType("datetime"); entity.HasOne(d => d.Kontr) .WithMany(p => p.KontoLojs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_KontoKth"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Znaczenie }) .HasName("PK_KONTROPIS"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Kontr) .WithMany(p => p.KontrOpis) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KONTROPI_REF_KTHOP_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KontrId) .HasName("PK_KONTRAHENT"); entity.ToTable("Kontrahent"); entity.HasIndex(e => e.IndeksCentr, "idx_KontrIndCentr"); entity.HasIndex(e => e.Nip, "idx_KontrNIP"); entity.HasIndex(e => e.Zmiana, "idx_KontrZmiana"); entity.Property(e => e.KontrId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.AkwId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Bank) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.CentrKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Email) .IsRequired() .HasMaxLength(60) .IsUnicode(false) .HasColumnName("EMail"); entity.Property(e => e.Fax) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.IndeksCentr) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KodKarty) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KodKontr) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Konto) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.KontrKrajId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MaxKredyt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Miasto) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NaPrzelewie1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NaPrzelewie2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Nip) .IsRequired() .HasMaxLength(40) .IsUnicode(false) .HasColumnName("NIP"); entity.Property(e => e.NrAnalityki) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.NrDomu) .HasMaxLength(9) .IsUnicode(false); entity.Property(e => e.NrLokalu) .HasMaxLength(9) .IsUnicode(false); entity.Property(e => e.Poczta) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.RabatDost).HasColumnType("decimal(10, 4)"); entity.Property(e => e.RabatOdb).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Rezerwa1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Rezerwa2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Telefon) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.TermWaznKarty).HasColumnType("datetime"); entity.Property(e => e.Ulica) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Akw) .WithMany(p => p.Kontrahents) .HasForeignKey(d => d.AkwId) .HasConstraintName("FK_KONTRAHE_REF_KTHAK_AKWIZYTO"); entity.HasOne(d => d.KontrKraj) .WithMany(p => p.Kontrahents) .HasForeignKey(d => d.KontrKrajId) .HasConstraintName("FK_Ref_KontrahentKraj"); }); modelBuilder.Entity(entity => { entity.ToTable("Kraj"); entity.Property(e => e.KrajId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Aktywny).HasDefaultValueSql("((1))"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZdjecieFlagi) .HasMaxLength(100) .IsUnicode(false); entity.HasOne(d => d.Wal) .WithMany(p => p.Krajs) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Ref_KrajWal"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KrajId, e.Stawka }) .HasName("PK_KRAJSTAWKA"); entity.ToTable("KrajStawka"); entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kraj) .WithMany(p => p.KrajStawkas) .HasForeignKey(d => d.KrajId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Ref_KrajVat"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Kpwid) .HasName("PK_KTHPARWARTOSC"); entity.ToTable("KthParWartosc"); entity.HasIndex(e => e.KthParId, "idx_KPWPar"); entity.Property(e => e.Kpwid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("KPWId"); entity.Property(e => e.KthParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.KthPar) .WithMany(p => p.KthParWartoscs) .HasForeignKey(d => d.KthParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KTHPARWA_REF_KPWAR_KTHPARAM"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KthParId) .HasName("PK_KTHPARAM"); entity.ToTable("KthParam"); entity.Property(e => e.KthParId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.KpwdomyslnaId) .HasColumnType("numeric(9, 0)") .HasColumnName("KPWDomyslnaId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Kpwdomyslna) .WithMany(p => p.KthParams) .HasForeignKey(d => d.KpwdomyslnaId) .HasConstraintName("FK_KTHPARAM_REF_KPDOM_KTHPARWA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.TypOsId }) .HasName("PK_KTHTYPOS"); entity.HasIndex(e => e.TypOsId, "idx_KTHTYPOS_TYPOS"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.KthTypOs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KTHTYPOS_KTH"); entity.HasOne(d => d.TypOs) .WithMany(p => p.KthTypOs) .HasForeignKey(d => d.TypOsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KTHTYPOS_TYPOS"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Kpwid }) .HasName("PK_KTHWARTOSC"); entity.ToTable("KthWartosc"); entity.HasIndex(e => e.Kpwid, "idx_KWart"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kpwid) .HasColumnType("numeric(9, 0)") .HasColumnName("KPWId"); entity.HasOne(d => d.Kontr) .WithMany(p => p.KthWartoscs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KTHWARTO_REF_KTHWA_KONTRAHE"); entity.HasOne(d => d.Kpw) .WithMany(p => p.KthWartoscs) .HasForeignKey(d => d.Kpwid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KTHWARTO_REF_KWPAR_KTHPARWA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.WalId, e.Data }) .HasName("PK_KURSWALUTY"); entity.ToTable("KursWaluty"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KursZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KursZakZr).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KursZr).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NrTabeli) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.NrTabeliZak) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Spread).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SpreadZak).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Wal) .WithMany(p => p.KursWaluties) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_KURSWAL_REFERENCE_WAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.LiniaId) .HasName("PK_LINIALOTN"); entity.ToTable("LiniaLotnicza"); entity.HasIndex(e => e.Kod, "idx_LinLotKod"); entity.HasIndex(e => e.Zmiana, "idx_LinLotZmiana"); entity.Property(e => e.LiniaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(16) .IsUnicode(false); entity.Property(e => e.Nazwa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.OperationId) .HasName("PK_LOGOPERATION"); entity.ToTable("LogOperation"); entity.Property(e => e.OperationId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.AdditionalDesc) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.AppTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.LastUpdate).HasColumnType("datetime"); entity.Property(e => e.ModItemId) .HasMaxLength(30) .IsUnicode(false); entity.Property(e => e.ModTableTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ModuleTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OperationTime).HasColumnType("datetime"); entity.Property(e => e.OperationTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OperatorId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PosId).HasColumnType("numeric(9, 0)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TypeId) .HasName("PK_LOGTYPEDEF"); entity.ToTable("LogTypeDef"); entity.Property(e => e.TypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.LastUpdate).HasColumnType("datetime"); entity.Property(e => e.TypeCategory) .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.TypeValue) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ValChangeId) .HasName("PK_LOGVALCHANGENUM"); entity.ToTable("LogValChangeNum"); entity.Property(e => e.ValChangeId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.LastUpdate).HasColumnType("datetime"); entity.Property(e => e.OperationId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ValChangeTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ValueAfter).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ValueBefore).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Operation) .WithMany(p => p.LogValChangeNums) .HasForeignKey(d => d.OperationId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_LOGVALCH_REFERENCE_LOGOPERB"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ValChangeId) .HasName("PK_LOGVALCHANGETXT"); entity.ToTable("LogValChangeTxt"); entity.Property(e => e.ValChangeId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.LastUpdate).HasColumnType("datetime"); entity.Property(e => e.OperationId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ValChangeTypeId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ValueAfter) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.ValueBefore) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Operation) .WithMany(p => p.LogValChangeTxts) .HasForeignKey(d => d.OperationId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_LOGVALCH_REFERENCE_LOGOPERA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.LotnId) .HasName("PK_LOTNISKO"); entity.ToTable("Lotnisko"); entity.HasIndex(e => e.Kod, "idx_LotnKod"); entity.HasIndex(e => e.Zmiana, "idx_LotnZmiana"); entity.Property(e => e.LotnId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(16) .IsUnicode(false); entity.Property(e => e.Kraj) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Nazwa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.MagId) .HasName("PK_MAGAZYN"); entity.ToTable("Magazyn"); entity.Property(e => e.MagId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.MarId, e.OdCeny }) .HasName("PK_MARZAKRES"); entity.Property(e => e.MarId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OdCeny).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Koncowki) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Mar) .WithMany(p => p.MarZakres) .HasForeignKey(d => d.MarId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_MARZAKRE_REF_MARZA_MARZOWNI"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.MarId) .HasName("PK_MARZOWNIK"); entity.ToTable("Marzownik"); entity.HasIndex(e => e.AsId, "idxMarAs"); entity.HasIndex(e => e.MagId, "idxMarMag"); entity.HasIndex(e => e.TowId, "idxMarTow"); entity.Property(e => e.MarId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MinMarzaOd100).HasColumnType("decimal(10, 4)"); entity.Property(e => e.MinMarzaW100).HasColumnType("decimal(10, 4)"); entity.Property(e => e.ModOd100).HasColumnType("decimal(10, 4)"); entity.Property(e => e.ModW100).HasColumnType("decimal(10, 4)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.As) .WithMany(p => p.Marzowniks) .HasForeignKey(d => d.AsId) .HasConstraintName("FK_MARZOWNI_REF_MARAS_ASORT"); entity.HasOne(d => d.Mag) .WithMany(p => p.Marzowniks) .HasForeignKey(d => d.MagId) .HasConstraintName("FK_MARZOWNI_REF_MARMA_MAGAZYN"); entity.HasOne(d => d.Tow) .WithMany(p => p.Marzowniks) .HasForeignKey(d => d.TowId) .HasConstraintName("FK_MARZOWNI_REF_MARTO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Kolejnosc }) .HasName("PK_NOTATKI"); entity.ToTable("Notatki"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Tow) .WithMany(p => p.Notatkis) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_NOTATKI_REF_TOWNO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.NrFormat }) .HasName("PK_NRREJ"); entity.ToTable("NrRej"); entity.HasIndex(e => new { e.NrFormat, e.KontrId }, "idx_NumerRej"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrFormat) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.NrWpisany) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.HasOne(d => d.Kontr) .WithMany(p => p.NrRejs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_NrRejKth"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.NrFormat, e.KartaId }) .HasName("PK_NRREJKARTA"); entity.HasIndex(e => new { e.KartaId, e.KontrId, e.NrFormat }, "idx_NrRejKartaId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrFormat) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.KartaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Karta) .WithMany(p => p.NrRejKarta) .HasForeignKey(d => d.KartaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_KartaNrRej"); entity.HasOne(d => d.NrRej) .WithMany(p => p.NrRejKarta) .HasForeignKey(d => new { d.KontrId, d.NrFormat }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_NrRejKarta"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TypNumeru) .HasName("PK_NUMDOK"); entity.ToTable("NumDok"); entity.Property(e => e.TypNumeru).ValueGeneratedNever(); entity.Property(e => e.Format) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TypNumeru, e.MagId }) .HasName("PK_NUMMAG"); entity.ToTable("NumMag"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Format) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Mag) .WithMany(p => p.NumMags) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_NUMMAG_REF_NUMMA_MAGAZYN"); entity.HasOne(d => d.TypNumeruNavigation) .WithMany(p => p.NumMags) .HasForeignKey(d => d.TypNumeru) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_NUMMAG_REF_NUMMA_NUMDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.OdbId, e.ProdId }) .HasName("PK_ODBPROD"); entity.ToTable("OdbProd"); entity.Property(e => e.OdbId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ProdId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RabatProd).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Odb) .WithMany(p => p.OdbProdOdbs) .HasForeignKey(d => d.OdbId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ODBPROD_REF_ODBPR_KONTRAHE"); entity.HasOne(d => d.Prod) .WithMany(p => p.OdbProdProds) .HasForeignKey(d => d.ProdId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ODBPROD_REF_PRODO_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.TowId }) .HasName("PK_ODBIORCA"); entity.ToTable("Odbiorca"); entity.HasIndex(e => e.TowId, "idx_OdbTowId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Indeks) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Nazwa) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.RabatTow).HasColumnType("decimal(10, 4)"); entity.Property(e => e.StalaCena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zamowil).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.Odbiorcas) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ODBIORCA_REF_KTHOD_KONTRAHE"); entity.HasOne(d => d.Tow) .WithMany(p => p.Odbiorcas) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ODBIORCA_REF_TOWOD_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.OfId, e.Kolejnosc }) .HasName("PK_OFKOD"); entity.ToTable("OfKod"); entity.HasIndex(e => new { e.KontrId, e.Kod }, "idx_OfKthKod"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OfId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.HasOne(d => d.Ofertum) .WithMany(p => p.OfKods) .HasForeignKey(d => new { d.KontrId, d.OfId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_OFKOD_REF_OFKOD_OFERTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Typ, e.Opis }) .HasName("PK_OFSLOWNIK"); entity.ToTable("OfSlownik"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Opis) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.OfSlowniks) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_OFSLOWNI_REF_OFSLO_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.OfId }) .HasName("PK_OFERTA"); entity.HasIndex(e => e.TowId, "idx_OfTow"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OfId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Asortyment) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Cku) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("CKU"); entity.Property(e => e.Indeks1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Indeks2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Jm) .HasMaxLength(10) .IsUnicode(false) .HasColumnName("JM"); entity.Property(e => e.Kategoria) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Nazwa) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Opis1) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis2) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis3) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis4) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Przelicznik).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Skrot) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.Oferta) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_OFERTA_REF_OFKON_KONTRAHE"); entity.HasOne(d => d.Tow) .WithMany(p => p.Oferta) .HasForeignKey(d => d.TowId) .HasConstraintName("FK_OFERTA_REF_OFTOW_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ZdarzLojId, e.Znaczenie, e.Kolejnosc }) .HasName("PK_OPISZDARZLOJ"); entity.ToTable("OpisZdarzLoj"); entity.Property(e => e.ZdarzLojId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParamN1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ParamN2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ParamS1) .HasMaxLength(64) .IsUnicode(false); entity.HasOne(d => d.ZdarzLoj) .WithMany(p => p.OpisZdarzLojs) .HasForeignKey(d => d.ZdarzLojId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_OpisZdarzLojZdarzLoj"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.OplataId); entity.HasIndex(e => new { e.DataOd, e.DataDo }, "IxOplata_DataOd"); entity.HasIndex(e => e.Zmiana, "IxOplata_Zmiana"); entity.Property(e => e.OplataId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrOplataId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataDo).HasColumnType("datetime"); entity.Property(e => e.DataOd).HasColumnType("datetime"); entity.Property(e => e.Kbid) .HasColumnType("numeric(9, 0)") .HasColumnName("KBId"); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.StawkaProc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kb) .WithMany(p => p.Oplata) .HasForeignKey(d => d.Kbid) .HasConstraintName("FK_Oplata_KontoBank"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Nazwisko }) .HasName("PK_OSOBA"); entity.ToTable("Osoba"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwisko) .HasMaxLength(60) .IsUnicode(false); entity.HasOne(d => d.Kontr) .WithMany(p => p.Osobas) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_OSOBA_REF_OSOBA_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.ToTable("Panel"); entity.Property(e => e.PanelId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrPanelId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.TypAplikacji).HasDefaultValueSql("((3))"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.UzNsid) .HasColumnType("numeric(9, 0)") .HasColumnName("UzNSId"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Uz) .WithMany(p => p.Panels) .HasForeignKey(d => d.UzId) .HasConstraintName("FK_PANEL_REFERENCE_UZYTKOWNIK"); entity.HasOne(d => d.UzNs) .WithMany(p => p.Panels) .HasForeignKey(d => d.UzNsid) .HasConstraintName("FK_PANEL_REFERENCE_UZNASKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.PanelId, e.ParNazwa }) .HasName("PK_PANELPARAM"); entity.ToTable("PanelParam"); entity.Property(e => e.PanelId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParNazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Panel) .WithMany(p => p.PanelParams) .HasForeignKey(d => d.PanelId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PANELPARAM_REFERENCE_PANEL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Kolejnosc }) .HasName("PK_PARBON"); entity.ToTable("ParBon"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Typ) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.HasOne(d => d.Par) .WithMany(p => p.ParBons) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARBON_REF_PARBO_PARAGON"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Typ }) .HasName("PK_PARPUNKTY"); entity.ToTable("ParPunkty"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy).HasColumnType("datetime"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Par) .WithMany(p => p.ParPunkties) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARPUNKT_REF_PARPK_PARAGON"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.WalId }) .HasName("PK_PARWALUTA"); entity.HasIndex(e => e.WalId, "idx_WalPar"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ParKwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Par) .WithMany(p => p.ParWaluta) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARWALUT_REF_PARWA_PARAGON"); entity.HasOne(d => d.Wal) .WithMany(p => p.ParWaluta) .HasForeignKey(d => d.WalId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARWALUT_REF_WALPA_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Wartosc }) .HasName("PK_PARWARTOSC"); entity.ToTable("ParWartosc"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Par) .WithMany(p => p.ParWartoscs) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARWARTO_REF_PARWA_PARAMETR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ParId) .HasName("PK_PARAGON"); entity.ToTable("Paragon"); entity.HasIndex(e => e.DataCzas, "idx_ParDataCzas"); entity.HasIndex(e => e.Kasjer, "idx_ParKasjer"); entity.HasIndex(e => e.WalId, "idx_ParWal"); entity.HasIndex(e => e.Zmiana, "idx_ParZmiana"); entity.HasIndex(e => e.ZmianaPkt, "idx_ParZmianaPkt"); entity.Property(e => e.ParId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Bony).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Brutto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CechyPar) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Czek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.DataCzas).HasColumnType("datetime"); entity.Property(e => e.DodFplat) .HasColumnType("decimal(15, 4)") .HasColumnName("DodFPlat"); entity.Property(e => e.EksportFk).HasColumnName("EksportFK"); entity.Property(e => e.Gotowka).HasColumnType("decimal(15, 4)"); entity.Property(e => e.GrupyGtu) .HasMaxLength(255) .IsUnicode(false) .HasColumnName("GrupyGTU"); entity.Property(e => e.InneFplat) .HasColumnType("decimal(15, 4)") .HasColumnName("InneFPlat"); entity.Property(e => e.Karta).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kasjer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.KodKarty) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nip) .HasMaxLength(40) .IsUnicode(false) .HasColumnName("NIP"); entity.Property(e => e.OpakWyd).HasColumnType("decimal(15, 4)"); entity.Property(e => e.OpakZwr).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Przelew).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Rabat).HasColumnType("decimal(15, 4)"); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Waluty).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaPkt).HasColumnType("datetime"); entity.HasOne(d => d.Kasa) .WithMany(p => p.Paragons) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARAGON_REF_PARKA_KASA"); entity.HasOne(d => d.Wal) .WithMany(p => p.Paragons) .HasForeignKey(d => d.WalId) .HasConstraintName("FK_PARAGON_REF_PARWA_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ParId) .HasName("PK_PARAMETR"); entity.ToTable("Parametr"); entity.HasIndex(e => e.CentrParId, "idx_CentrParId"); entity.Property(e => e.ParId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc }) .HasName("PK_PARTIA"); entity.HasIndex(e => new { e.TypPartii, e.TowId, e.Pozostalo }, "idx_PrtTypTowIle"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cecha1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Cecha2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.DataWazn).HasColumnType("datetime"); entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Tow) .WithMany(p => p.Partia) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARTIA_REF_PRTTO_TOWAR"); entity.HasOne(d => d.PozDok) .WithOne(p => p.Partium) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PARTIA_REF_PRTPO_POZDOK"); }); modelBuilder.Entity(entity => { entity.ToTable("PcfUser"); entity.HasIndex(e => e.Ident, "IxIdent"); entity.Property(e => e.Email) .HasMaxLength(64) .IsUnicode(false) .HasColumnName("EMail"); entity.Property(e => e.FirstName) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.Ident) .IsRequired() .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.LastName) .HasMaxLength(64) .IsUnicode(false); entity.Property(e => e.PasswordHash) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.PcfCustomerId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PcfLoyaltyCustomerId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PcfPstationId) .HasColumnType("numeric(9, 0)") .HasColumnName("PcfPStationId"); entity.Property(e => e.ValidFrom).HasColumnType("datetime"); entity.Property(e => e.ValidTo).HasColumnType("datetime"); entity.HasOne(d => d.PcfCustomer) .WithMany(p => p.PcfUserPcfCustomers) .HasForeignKey(d => d.PcfCustomerId) .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRC"); entity.HasOne(d => d.PcfLoyaltyCustomer) .WithMany(p => p.PcfUserPcfLoyaltyCustomers) .HasForeignKey(d => d.PcfLoyaltyCustomerId) .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRL"); entity.HasOne(d => d.PcfPstation) .WithMany(p => p.PcfUserPcfPstations) .HasForeignKey(d => d.PcfPstationId) .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRS"); }); modelBuilder.Entity(entity => { entity.ToTable("PH"); entity.HasIndex(e => e.KontrId, "idx_PHKth"); entity.Property(e => e.Phid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("PHId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kontr) .WithMany(p => p.Phs) .HasForeignKey(d => d.KontrId) .HasConstraintName("FK_PH_REF_PHKON_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Phid, e.Znaczenie }) .HasName("PK_PHDANE"); entity.ToTable("PHDane"); entity.Property(e => e.Phid) .HasColumnType("numeric(9, 0)") .HasColumnName("PHId"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Ph) .WithMany(p => p.Phdanes) .HasForeignKey(d => d.Phid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHDANE_REF_PHDAN_PH"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Phid, e.KontrId, e.Znaczenie }) .HasName("PK_PHODBDANE"); entity.ToTable("PHOdbDane"); entity.Property(e => e.Phid) .HasColumnType("numeric(9, 0)") .HasColumnName("PHId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Phodbiorca) .WithMany(p => p.PhodbDanes) .HasForeignKey(d => new { d.Phid, d.KontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHODBDAN_REF_PHODB_PHODBIOR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Phid, e.KontrId }) .HasName("PK_PHODBIORCA"); entity.ToTable("PHOdbiorca"); entity.HasIndex(e => e.KontrId, "idx_PHOdbKth"); entity.Property(e => e.Phid) .HasColumnType("numeric(9, 0)") .HasColumnName("PHId"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.Phodbiorcas) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHODBIOR_REF_PHODB_KONTRAHE"); entity.HasOne(d => d.Ph) .WithMany(p => p.Phodbiorcas) .HasForeignKey(d => d.Phid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHODBIOR_REF_PHODB_PH"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Phid }) .HasName("PK_PHROZLICZENIE"); entity.ToTable("PHRozliczenie"); entity.HasIndex(e => e.Phid, "idx_PHRozPH"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Phid) .HasColumnType("numeric(9, 0)") .HasColumnName("PHId"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Rozliczono).HasColumnType("datetime"); entity.HasOne(d => d.Dok) .WithMany(p => p.Phrozliczenies) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHROZLIC_REF_PHDOK_DOK"); entity.HasOne(d => d.Ph) .WithMany(p => p.Phrozliczenies) .HasForeignKey(d => d.Phid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PHROZLIC_REF_PHROZ_PH"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.PolId, e.MagId }) .HasName("PK_POLMAG"); entity.ToTable("PolMag"); entity.HasIndex(e => e.MagId, "idx_MagPol"); entity.Property(e => e.PolId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Mag) .WithMany(p => p.PolMags) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POLMAG_REF_MAGPO_MAGAZYN"); entity.HasOne(d => d.Pol) .WithMany(p => p.PolMags) .HasForeignKey(d => d.PolId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POLMAG_REF_POLMA_POLITYKA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.PolId, e.ParGrupa, e.ParNazwa }) .HasName("PK_POLPARAM"); entity.ToTable("PolParam"); entity.Property(e => e.PolId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParGrupa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParNazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Pol) .WithMany(p => p.PolParams) .HasForeignKey(d => d.PolId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POLPARAM_REF_POLPA_POLITYKA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.PolId) .HasName("PK_POLITYKA"); entity.ToTable("Polityka"); entity.HasIndex(e => e.CentrPolId, "idx_CentrPolId"); entity.Property(e => e.PolId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrPolId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.NoweKontoId, e.RodzajPow }) .HasName("PK_POWKONTLOJ"); entity.ToTable("PowKontLoj"); entity.HasIndex(e => e.StareKontoId, "idx_PowStareKLoj"); entity.Property(e => e.NoweKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.StareKontoId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.NoweKonto) .WithMany(p => p.PowKontLojNoweKontos) .HasForeignKey(d => d.NoweKontoId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_NoweKonto"); entity.HasOne(d => d.StareKonto) .WithMany(p => p.PowKontLojStareKontos) .HasForeignKey(d => d.StareKontoId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_StareKonto"); }); modelBuilder.Entity(entity => { entity.ToTable("Powiadomienie"); entity.HasIndex(e => new { e.ShopNo, e.PosNo }, "IxPowiadomienie_ShopNoPosNo"); entity.HasIndex(e => e.Status, "IxPowiadomienie_Status"); entity.Property(e => e.PowiadomienieId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Adresat) .HasMaxLength(64) .IsUnicode(false); entity.Property(e => e.Nadawca) .HasMaxLength(64) .IsUnicode(false); entity.Property(e => e.Naglowek) .HasMaxLength(128) .IsUnicode(false); entity.Property(e => e.PosNo) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.ShopNo) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.Tresc) .HasMaxLength(2048) .IsUnicode(false); entity.Property(e => e.Utworzono).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.PowiadomienieId, e.Znaczenie, e.Kolejnosc }) .HasName("PK_POWIADOMIENIEPARAM"); entity.ToTable("PowiadomienieParam"); entity.Property(e => e.PowiadomienieId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2) .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Powiadomienie) .WithMany(p => p.PowiadomienieParams) .HasForeignKey(d => d.PowiadomienieId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PowiadomienieParamPowiadomienie"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TowId) .HasName("PK_POWIAZANIE"); entity.ToTable("Powiazanie"); entity.HasIndex(e => e.OpakId, "idx_OpakId"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IleWopak) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWOpak"); entity.Property(e => e.OpakId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Opak) .WithMany(p => p.PowiazanieOpaks) .HasForeignKey(d => d.OpakId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POWIAZAN_REF_OPAK_TOWAR"); entity.HasOne(d => d.Tow) .WithOne(p => p.PowiazanieTow) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POWIAZAN_REF_TOWAR_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Id, e.Typ }) .HasName("PK_POWIAZANIE_SKLEP"); entity.ToTable("PowiazanieSklep"); entity.HasIndex(e => e.Typ, "PowiazanieSklepTyp"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.PowiazanieSkleps) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POWIAZANIESKLEP_REFERENCE_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.UzId, e.RodzajPow, e.Id }) .HasName("PK_POWIAZANIEUZ"); entity.ToTable("PowiazanieUz"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Uz) .WithMany(p => p.PowiazanieUzs) .HasForeignKey(d => d.UzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POWIAZAN_REF_POWUZ_UZYTKOWN"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.UzNsid, e.RodzajPow, e.Id }) .HasName("PK_POWIAZANIEUZNASKLEP"); entity.ToTable("PowiazanieUzNaSklep"); entity.Property(e => e.UzNsid) .HasColumnType("numeric(9, 0)") .HasColumnName("UzNSId"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.UzNs) .WithMany(p => p.PowiazanieUzNaSkleps) .HasForeignKey(d => d.UzNsid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PowUzNaSklepUzNaSklep"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.GrAkcId }) .HasName("PK_POZAKCYZA"); entity.ToTable("PozAkcyza"); entity.HasIndex(e => e.GrAkcId, "idx_PozAkcGr"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.GrAkc) .WithMany(p => p.PozAkcyzas) .HasForeignKey(d => d.GrAkcId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_AkcPoz"); entity.HasOne(d => d.PozDok) .WithMany(p => p.PozAkcyzas) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PozAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc }) .HasName("PK_POZDOK"); entity.ToTable("PozDok"); entity.HasIndex(e => new { e.DokId, e.NrPozycji }, "idx_PozDokDokIdNrPozycji"); entity.HasIndex(e => e.TowId, "idx_PozDokTowId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDomyslna).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaPoRab).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaPrzedRab).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IleWzgrzewce) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWZgrzewce"); entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.PozDoks) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZDOK_REF_POZDO_DOK"); entity.HasOne(d => d.Tow) .WithMany(p => p.PozDoks) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZDOK_REF_POZTO_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Kolejnosc }) .HasName("PK_POZPAR"); entity.ToTable("PozPar"); entity.HasIndex(e => e.TowId, "idx_PozParTowId"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.GrupaGtu) .HasMaxLength(4) .IsUnicode(false) .HasColumnName("GrupaGTU"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kod) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.RabatKwot).HasColumnType("decimal(15, 4)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WartoscBrutto).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Par) .WithMany(p => p.PozPars) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZPAR_REF_POZPA_PARAGON"); entity.HasOne(d => d.Tow) .WithMany(p => p.PozPars) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZPAR_REF_TOWPA_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Kolejnosc }) .HasName("PK_POZPARSZCZEG"); entity.ToTable("PozParSzczeg"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DodInfo) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.PozPar) .WithOne(p => p.PozParSzczeg) .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZPARSZ_REF_PPSZC_POZPAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.WzId, e.Kolejnosc }) .HasName("PK_POZWZ"); entity.ToTable("PozWz"); entity.Property(e => e.WzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Tow) .WithMany(p => p.PozWzs) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZWZ_REF_TOWWZ_TOWAR"); entity.HasOne(d => d.Wz) .WithMany(p => p.PozWzs) .HasForeignKey(d => d.WzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_POZWZ_REF_POZWZ_WZORZEC"); }); modelBuilder.Entity(entity => { entity.ToTable("Profil"); entity.Property(e => e.ProfilId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Utworzony).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ProfilId) .HasName("PK_PROFKAS"); entity.ToTable("ProfilKasa"); entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kasa) .WithMany(p => p.ProfilKasas) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PROFKAS_REFERENCE_KASA"); entity.HasOne(d => d.Profil) .WithOne(p => p.ProfilKasa) .HasForeignKey(d => d.ProfilId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PROFKAS_REFERENCE_PROF"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ProfilId, e.ParGrupa, e.ParNazwa, e.Kolejny }) .HasName("PK_PROFIL_KONFIG"); entity.ToTable("ProfilKonfig"); entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParGrupa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.ParNazwa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Utworzony).HasColumnType("datetime"); entity.Property(e => e.Wartosc) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Profil) .WithMany(p => p.ProfilKonfigs) .HasForeignKey(d => d.ProfilId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PROFILKONFIG_REFERENCE_PROFIL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Pmid }) .HasName("PK_PRTMAG"); entity.ToTable("PrtMag"); entity.HasIndex(e => new { e.TowId, e.MagId, e.Data, e.KolejnyWdniu, e.Pmid }, "idx_PrtMagFifo"); entity.HasIndex(e => new { e.NrPartii, e.TowId, e.Pmid }, "idx_PrtMagNrPrt"); entity.HasIndex(e => e.Zmiana, "idx_PrtMagZmn"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.DataWazn).HasColumnType("datetime"); entity.Property(e => e.Dostarczono).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KolejnyWdniu).HasColumnName("KolejnyWDniu"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrDostawy) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.NrPartii) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Rezerwacja).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); entity.HasOne(d => d.Mag) .WithMany(p => p.PrtMags) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PrtMagMagazyn"); entity.HasOne(d => d.Tow) .WithMany(p => p.PrtMags) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PrtMagTowar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.AsId }) .HasName("PK_PRZYDZIAL"); entity.ToTable("Przydzial"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.As) .WithMany(p => p.Przydzials) .HasForeignKey(d => d.AsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PRZYDZIA_REF_ASPRZ_ASORT"); entity.HasOne(d => d.Kasa) .WithMany(p => p.Przydzials) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PRZYDZIA_REF_KASPR_KASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Rwpid) .HasName("PK_RAPWARTPOCZ"); entity.ToTable("RapWartPocz"); entity.HasIndex(e => new { e.TypRap, e.Data }, "idx_RWP_TypRapData"); entity.Property(e => e.Rwpid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("RWPId"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.ParamTxt) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Wykonano).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Rwpid, e.MagId, e.Typ, e.Numer }) .HasName("PK_RAPWARTPOCZDANE"); entity.ToTable("RapWartPoczDane"); entity.Property(e => e.Rwpid) .HasColumnType("numeric(9, 0)") .HasColumnName("RWPId"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Typ).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Mag) .WithMany(p => p.RapWartPoczDanes) .HasForeignKey(d => d.MagId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN"); entity.HasOne(d => d.Rwp) .WithMany(p => p.RapWartPoczDanes) .HasForeignKey(d => d.Rwpid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ"); }); modelBuilder.Entity(entity => { entity.ToTable("Regula"); entity.Property(e => e.RegulaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataCzasDo).HasColumnType("datetime"); entity.Property(e => e.DataCzasOd).HasColumnType("datetime"); entity.Property(e => e.Nazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Number1).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number2).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number3).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number4).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Str1) .HasMaxLength(128) .IsUnicode(false); entity.Property(e => e.Str2) .HasMaxLength(128) .IsUnicode(false); entity.Property(e => e.Usunieto).HasColumnType("datetime"); entity.Property(e => e.Utworzono).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.AsId, e.Znaczenie }) .HasName("PK_REGULAASORT"); entity.ToTable("RegulaAsort"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.As) .WithMany(p => p.RegulaAsorts) .HasForeignKey(d => d.AsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULAAS_REFERENCE_ASORT"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaAsorts) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULAAS_REFERENCE_REGULA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.RegulaId, e.Kolejnosc }) .HasName("PK_REGULADOK"); entity.ToTable("RegulaDok"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.RegulaDoks) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegDokDok"); entity.HasOne(d => d.Konto) .WithMany(p => p.RegulaDoks) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_RegDokKonto"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaDoks) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegDokReg"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.RegulaId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_REGULADOKSZCZEG"); entity.ToTable("RegulaDokSzczeg"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Param3) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.RegulaDok) .WithMany(p => p.RegulaDokSzczegs) .HasForeignKey(d => new { d.DokId, d.RegulaId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RgDokSzczegRgDok"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.Kod, e.Znaczenie }); entity.ToTable("RegulaKod"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaKods) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULAKOD_REGULA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.RegulaId, e.Kolejnosc }) .HasName("PK_REGULAPAR"); entity.ToTable("RegulaPar"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Konto) .WithMany(p => p.RegulaPars) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_RegParKonto"); entity.HasOne(d => d.Par) .WithMany(p => p.RegulaPars) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegParPar"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaPars) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegParReg"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.RegulaId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_REGULAPARSZCZEG"); entity.ToTable("RegulaParSzczeg"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Param3) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.RegulaPar) .WithMany(p => p.RegulaParSzczegs) .HasForeignKey(d => new { d.ParId, d.RegulaId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RgParSzczegRgPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.Znaczenie }) .HasName("PK_REGULAPARAM"); entity.ToTable("RegulaParam"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2) .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaParams) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.RegulaId, e.Typ }) .HasName("PK_REGULAPOZDOK"); entity.ToTable("RegulaPozDok"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaPozDoks) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozReg"); entity.HasOne(d => d.PozDok) .WithMany(p => p.RegulaPozDoks) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.RegulaId, e.Typ, e.KolejnoscRegulaDok }) .HasName("PK_REGPOZDOKSZ"); entity.ToTable("RegulaPozDokSzczeg"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaPozDokSzczegs) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozSzReg"); entity.HasOne(d => d.PozDok) .WithMany(p => p.RegulaPozDokSzczegs) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozSzPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Kolejnosc, e.RegulaId, e.Typ }) .HasName("PK_REGULAPOZPAR"); entity.ToTable("RegulaPozPar"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaPozPars) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozParReg"); entity.HasOne(d => d.PozPar) .WithMany(p => p.RegulaPozPars) .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozParPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ParId, e.Kolejnosc, e.RegulaId, e.Typ, e.KolejnoscRegulaPar }) .HasName("PK_REGPOZPARSZ"); entity.ToTable("RegulaPozParSzczeg"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaPozParSzczegs) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozPSzReg"); entity.HasOne(d => d.PozPar) .WithMany(p => p.RegulaPozParSzczegs) .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RegPozPSzPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.Kolejnosc }) .HasName("PK_REGULAPROG"); entity.ToTable("RegulaProg"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ProgDo).HasColumnType("numeric(16, 4)"); entity.Property(e => e.ProgOd).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Wartosc1).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("numeric(16, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaProgs) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULAPROG_REFERENCE_REGULA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.SklepId }) .HasName("PK_REGULASKLEP"); entity.ToTable("RegulaSklep"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaSkleps) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RegulaSklep_Regula"); entity.HasOne(d => d.Sklep) .WithMany(p => p.RegulaSkleps) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_RegulaSklep_Sklep"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RegulaId, e.TowId, e.Znaczenie }) .HasName("PK_REGULATOWAR"); entity.ToTable("RegulaTowar"); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); entity.HasOne(d => d.Regula) .WithMany(p => p.RegulaTowars) .HasForeignKey(d => d.RegulaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULATO_REFERENCE_REGULA"); entity.HasOne(d => d.Tow) .WithMany(p => p.RegulaTowars) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_REGULATO_REFERENCE_TOWAR"); }); modelBuilder.Entity(entity => { entity.ToTable("Rola"); entity.Property(e => e.RolaId).ValueGeneratedNever(); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Pmid, e.Znaczenie, e.DokId, e.Kolejnosc }) .HasName("PK_ROZPRTMAG"); entity.ToTable("RozPrtMag"); entity.HasIndex(e => e.Dzien, "idx_RozPrtMagDzien"); entity.HasIndex(e => new { e.DokId, e.Kolejnosc, e.Znaczenie, e.Pmid }, "idx_RozPrtMagPoz"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.IloscPrt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.PozDok) .WithMany(p => p.RozPrtMags) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RozPrtMagPoz"); entity.HasOne(d => d.PrtMag) .WithMany(p => p.RozPrtMags) .HasForeignKey(d => new { d.TowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_RozPrtMagPrt"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Stawka }) .HasName("PK_ROZBICIEDOK"); entity.ToTable("RozbicieDok"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.RozbicieDoks) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ROZBICIE_REF_SUMAD_DOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc }) .HasName("PK_ROZLICZA"); entity.ToTable("Rozlicza"); entity.HasIndex(e => e.RozliczanyDokId, "idx_RozliczanyDokId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RozliczanyDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RozliczeniePodatku).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Dok) .WithMany(p => p.RozliczaDoks) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ROZLICZA_REF_DOKZB_DOK"); entity.HasOne(d => d.RozliczanyDok) .WithMany(p => p.RozliczaRozliczanyDoks) .HasForeignKey(d => d.RozliczanyDokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ROZLICZA_REF_DOKRO_DOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.RozDokId, e.RozKolejnosc, e.PrtDokId, e.PrtKolejnosc }) .HasName("PK_ROZLICZENIEPARTII"); entity.ToTable("RozliczeniePartii"); entity.HasIndex(e => new { e.PrtDokId, e.PrtKolejnosc }, "idx_RozPrt"); entity.Property(e => e.RozDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PrtDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Prt) .WithMany(p => p.RozliczeniePartiis) .HasForeignKey(d => new { d.PrtDokId, d.PrtKolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ROZLICZE_REF_PRTRO_PARTIA"); entity.HasOne(d => d.Roz) .WithMany(p => p.RozliczeniePartiis) .HasForeignKey(d => new { d.RozDokId, d.RozKolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ROZLICZE_REF_ROZPO_POZDOK"); }); modelBuilder.Entity(entity => { entity.ToTable("Sesja"); entity.HasIndex(e => e.UzId, "idx_SesjaUzId"); entity.Property(e => e.SesjaId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Stanowisko) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wersja) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Uz) .WithMany(p => p.Sesjas) .HasForeignKey(d => d.UzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SESJA_REF_UZYSE_UZYTKOWN"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.SesjaId) .HasName("PK_SESJAAKTYWNA"); entity.ToTable("SesjaAktywna"); entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Aktywnosc).HasColumnType("datetime"); entity.Property(e => e.IdProcesu) .HasMaxLength(20) .IsUnicode(false); entity.HasOne(d => d.Sesja) .WithOne(p => p.SesjaAktywna) .HasForeignKey(d => d.SesjaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SESJAAKT_REF_SESAK_SESJA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Dkid, e.Kolejnosc }) .HasName("PK_SKLDEFKODU"); entity.ToTable("SkladnikDefinicjiKodu"); entity.Property(e => e.Dkid) .HasColumnType("numeric(9, 0)") .HasColumnName("DKId"); entity.Property(e => e.Tekst) .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Dk) .WithMany(p => p.SkladnikDefinicjiKodus) .HasForeignKey(d => d.Dkid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLDEFKODU"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.SkWzId) .HasName("PK_SKLADNIKWZORCA"); entity.ToTable("SkladnikWzorca"); entity.HasIndex(e => e.CentrSkWzId, "idx_CentrSkWzId"); entity.HasIndex(e => new { e.TowIdWzorca, e.Kolejnosc }, "idx_SkladnikWzorca_TowIdWzorca"); entity.Property(e => e.SkWzId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CentrSkWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.TowIdWzorca).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.TowIdWzorcaNavigation) .WithMany(p => p.SkladnikWzorcas) .HasForeignKey(d => d.TowIdWzorca) .HasConstraintName("FK_SKLADNIKWZORCA_REFERENCE_TOWAR"); }); modelBuilder.Entity(entity => { entity.ToTable("Sklep"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataBo) .HasColumnType("datetime") .HasColumnName("DataBO"); entity.Property(e => e.KolejnyWdniuBo).HasColumnName("KolejnyWDniuBO"); entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrSeryjny) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.OkrZamkniety).HasColumnType("datetime"); entity.Property(e => e.OstEksport).HasColumnType("datetime"); entity.Property(e => e.OstImport).HasColumnType("datetime"); entity.Property(e => e.PotwEksport).HasColumnType("datetime"); entity.Property(e => e.WymImport).HasColumnType("datetime"); entity.HasOne(d => d.Kraj) .WithMany(p => p.Skleps) .HasForeignKey(d => d.KrajId) .HasConstraintName("FK_Ref_KrajSklep"); entity.HasOne(d => d.Mag) .WithMany(p => p.Skleps) .HasForeignKey(d => d.MagId) .HasConstraintName("FK_SKLEP_REF_SKLEP_MAGAZYN"); entity.HasOne(d => d.SklepNavigation) .WithOne(p => p.Sklep) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEP_REF_SKLEP_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepArtId }) .HasName("PK_SKLEPARTYKUL"); entity.ToTable("SklepArtykul"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepArtId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ArtNazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.GlownySklepTowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepArtykuls) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPART_REF_SKART_SKLEP"); entity.HasOne(d => d.SklepTowar) .WithMany(p => p.SklepArtykuls) .HasForeignKey(d => new { d.SklepId, d.GlownySklepTowId }) .HasConstraintName("FK_SKLARTGLOWNYSKLEPTOWID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepBankId }); entity.ToTable("SklepBank"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Adres) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.NrRozliBank) .HasMaxLength(8) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDkid }) .HasName("PK_SKDEFKODU"); entity.ToTable("SklepDefinicjaKodu"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDkid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepDKId"); entity.Property(e => e.DataDo).HasColumnType("datetime"); entity.Property(e => e.DataOd).HasColumnType("datetime"); entity.Property(e => e.Dkid) .HasColumnType("numeric(9, 0)") .HasColumnName("DKId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDefinicjaKodus) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKDEFKODUSKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId }) .HasName("PK_SKLEPDOK"); entity.ToTable("SklepDok"); entity.HasIndex(e => e.DokId, "idx_SkDokId"); entity.HasIndex(e => new { e.SklepId, e.SklepKasaId }, "idx_SkDokKasa"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDokKth"); entity.HasIndex(e => new { e.SklepId, e.SklepMagId }, "idx_SkDokMag"); entity.HasIndex(e => new { e.SklepId, e.SklepPlatnikId }, "idx_SkDokPlatKth"); entity.HasIndex(e => new { e.TypDok, e.Data, e.KolejnyWdniu }, "idx_SkDokTypDokDataKolejnyWDniu"); entity.HasIndex(e => new { e.SklepId, e.SklepUzId }, "idx_SkDokUz"); entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkDokWal"); entity.HasIndex(e => e.Zmiana, "idx_SkDokZmiana"); entity.HasIndex(e => new { e.SklepId, e.Data, e.KolejnyWdniu }, "idx_SklepDataKolejnyWDniu"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrEksportFk).HasColumnName("CentrEksportFK"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.DataDod).HasColumnType("datetime"); entity.Property(e => e.DataPom).HasColumnType("datetime"); entity.Property(e => e.DoZaplaty).HasColumnType("decimal(15, 4)"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.EksportFk).HasColumnName("EksportFK"); entity.Property(e => e.KolejnyWdniu).HasColumnName("KolejnyWDniu"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota10).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota11).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota12).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota4).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota5).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota6).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota7).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota8).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kwota9).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDetUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoMagUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NrDok) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDetUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekMagUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekUslugi).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Razem).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepKBId"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepPlatnikId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zaplacono).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ZaplaconoPodatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ZaplaconoWkasie) .HasColumnType("decimal(15, 4)") .HasColumnName("ZaplaconoWKasie"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Dok) .WithMany(p => p.SklepDoks) .HasForeignKey(d => d.DokId) .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_DOK"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDoks) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKLEP_SKLEP"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepDoks) .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPKAS"); entity.HasOne(d => d.Sklep1) .WithMany(p => p.SklepDokSklep1s) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .HasConstraintName("FK_SKLEPDOK_REF_OBROT_SKLEPKON"); entity.HasOne(d => d.Sklep2) .WithMany(p => p.SklepDoks) .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPMAG"); entity.HasOne(d => d.Sklep3) .WithMany(p => p.SklepDokSklep3s) .HasForeignKey(d => new { d.SklepId, d.SklepPlatnikId }) .HasConstraintName("FK_SKLEPDOK_REF_OBROT_SKLEPPLAT"); entity.HasOne(d => d.Sklep4) .WithMany(p => p.SklepDoks) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPUZY"); entity.HasOne(d => d.Sklep5) .WithMany(p => p.SklepDoks) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .HasConstraintName("FK_SKLEPDOK_REF_SKDWP_SKLEPWAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }) .HasName("PK_SKLEPDOKDODKTH"); entity.ToTable("SklepDokDodKth"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDDKth"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDokDodKths) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDDK_SKLEPDOK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepDokDodKths) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDKD_SKLEPKON"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }) .HasName("PK_SKLEPDOKKURS"); entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SklDokKursWal"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NrTabeli) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDokKurs) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLDOKKURS_SKLEPDOK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepDokKurs) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLDOKKURS_WAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Typ, e.Gdzie }) .HasName("PK_SKLEPDOKPUNKTY"); entity.ToTable("SklepDokPunkty"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy).HasColumnType("datetime"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDokPunkties) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepWalId }) .HasName("PK_SKLEPDOKWALUTA"); entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkWalDok"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DokKwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDokWaluta) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKDWZ_SKLEPDOK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepDokWaluta) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOK_REF_SKWD_SKLEPWAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.SklepKontrId }) .HasName("PK_SKLEPDOST"); entity.ToTable("SklepDost"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDostKth"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatOdWart).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDosts) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOS_REF_DOSTS_SKLEPKON"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepDosts) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPDOS_REF_SKLEP_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Dzien }) .HasName("PK_SKLEPDZIENROZL"); entity.ToTable("SklepDzienRozl"); entity.HasIndex(e => e.Zmiana, "idx_SkDzienZmiana"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepDzienRozls) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkDzienRozl"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Dzien, e.Znaczenie }) .HasName("PK_SKLEPDZIENROZLPARAM"); entity.ToTable("SklepDzienRozlParam"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.Wartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepDzienRozl) .WithMany(p => p.SklepDzienRozlParams) .HasForeignKey(d => new { d.SklepId, d.Dzien }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkDzienRozlPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.TowId }) .HasName("PK_SKLEPFLAGI"); entity.ToTable("SklepFlagi"); entity.HasIndex(e => new { e.SklepId, e.ZmianaIstotna }, "idx_SFZmianaIstotna"); entity.HasIndex(e => new { e.SklepId, e.ZmianaTylkoCen }, "idx_SFZmianaTylkoCen"); entity.HasIndex(e => new { e.TowId, e.SklepId }, "idx_SklFlgTowSklep"); entity.HasIndex(e => e.Zmiana, "idx_SklepFlagZmiana"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NarzCenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NarzCenaDod).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NarzCenaHurt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NarzCenaNoc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NarzCenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); entity.Property(e => e.ZmianaTylkoCen).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepFlagis) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPFLA_REF_SKLEP_SKLEP"); entity.HasOne(d => d.Tow) .WithMany(p => p.SklepFlagis) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPFLA_REF_SKLEP_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTypOsId, e.SklepZgId }) .HasName("PK_SKLEPFORMZGOD"); entity.ToTable("SklepFormZgod"); entity.HasIndex(e => new { e.SklepId, e.SklepZgId }, "idx_SKFMZG_SKZGODA"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepFormZgods) .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKFMZG_SKTYPOS"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepFormZgods) .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKFMZG_SKZGODA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepFormaId }); entity.ToTable("SklepFormaPlatnPos7"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepFormaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.FormaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kolejnosc).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SerwisPlatniczy) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepFormaPlatnPos7s) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKFPP7_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepGrAkcId }) .HasName("PK_SKLEPGRUPAAKCYZOWA"); entity.ToTable("SklepGrupaAkcyzowa"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrGrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepGrupaAkcyzowas) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkGrAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepUzId }) .HasName("PK_SK_GR_UZ"); entity.ToTable("SklepGrupaUz"); entity.HasIndex(e => new { e.SklepId, e.SklepRolaId }, "idx_SkRola"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRolaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepGrupaUzSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepRolaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPGRU_REF_SKGRR_SKLEPUZY"); entity.HasOne(d => d.SklepNavigation) .WithOne(p => p.SklepGrupaUzSklepNavigation) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPGRU_REF_SKGRU_SKLEPUZY"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.SklepMagId }) .HasName("PK_SKLEPISTW"); entity.ToTable("SklepIstw"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RezerwacjaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMax).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanMin).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepIstws) .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPIST_REF_SKMAG_SKLEPMAG"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepIstws) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPIST_REF_SKTOW_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKartaId }) .HasName("PK_SKLEPKARTALOJ"); entity.ToTable("SklepKartaLoj"); entity.HasIndex(e => e.KodKarty, "idx_SKLoj_KodKarty"); entity.HasIndex(e => new { e.SklepId, e.SklepKontoId }, "idx_SKLoj_SKonto"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKartaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KodKarty) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opis1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Opis2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Posiadacz) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Uniewazniono).HasColumnType("datetime"); entity.Property(e => e.WaznaDo).HasColumnType("datetime"); entity.Property(e => e.WaznaOd).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKartaLojs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SKrtLoj_Sklep"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKartaLojs) .HasForeignKey(d => new { d.SklepId, d.SklepKontoId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SKartaKonto"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKasaId }) .HasName("PK_SKLEPKASA"); entity.ToTable("SklepKasa"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Stanowisko) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Typ) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKasas) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKAS_REF_SKKAS_SKLEP"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKasas) .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKAS_REF_SKMAG_SKLEPMAG"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepFormaId, e.SklepKasaId }); entity.ToTable("SklepKasaFormaPlatn"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepFormaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKasaFormaPlatns) .HasForeignKey(d => new { d.SklepId, d.SklepFormaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKKASAFORMAPLATN_SKFPP7"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKasaFormaPlatns) .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKKASAFORMAPLATN_SKKASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKbid }); entity.ToTable("SklepKontoBankowe"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepKBId"); entity.Property(e => e.Kbid) .HasColumnType("numeric(9, 0)") .HasColumnName("KBId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.PowSklepKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("PowSklepKBId"); entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Sufix) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontoBankowes) .HasForeignKey(d => new { d.SklepId, d.SklepBankId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKONTOBANK_SKLEPBANK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKontoBankowes) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKONTOBANK_SKLEPWALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKbkid }); entity.ToTable("SklepKontoBankoweKontr"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKbkid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepKBKId"); entity.Property(e => e.Kbkid) .HasColumnType("numeric(9, 0)") .HasColumnName("KBKId"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.PowSklepKbkid) .HasColumnType("numeric(9, 0)") .HasColumnName("PowSklepKBKId"); entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontoBankoweKontrs) .HasForeignKey(d => new { d.SklepId, d.SklepBankId }) .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPBANK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKontoBankoweKontrs) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPKONTR"); entity.HasOne(d => d.Sklep1) .WithMany(p => p.SklepKontoBankoweKontrs) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPWALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontoId }) .HasName("PK_SKLEPKONTOLOJ"); entity.ToTable("SklepKontoLoj"); entity.HasIndex(e => e.CentrKontoId, "idx_SCentrKontoId"); entity.HasIndex(e => e.KontoId, "idx_SKLoj_KLoj"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SKLoj_SKontrId"); entity.HasIndex(e => e.ZmianaStanu, "idx_SKLoj_ZmStanu"); entity.HasIndex(e => e.Zmiana, "idx_SKLoj_Zmiana"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Stan).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanPocz).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaStanu).HasColumnType("datetime"); entity.HasOne(d => d.Konto) .WithMany(p => p.SklepKontoLojs) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_SKLoj_KLoj"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontoLojs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SKntLoj_Sklep"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKontoLojs) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SKLoj_SKth"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId }) .HasName("PK_SKLEPKONTR"); entity.ToTable("SklepKontr"); entity.HasIndex(e => e.KontrId, "idx_SklepKthKth"); entity.HasIndex(e => new { e.SklepId, e.KontrId }, "idx_SklepKthSkKth"); entity.HasIndex(e => e.Zmiana, "idx_SklepKthZmiana"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Akwizytor) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Bank) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.CentrKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Email) .IsRequired() .HasMaxLength(60) .IsUnicode(false) .HasColumnName("EMail"); entity.Property(e => e.Fax) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.IndeksCentr) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KodKarty) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KodKontr) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KodKraju) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Konto) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.MaxKredyt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Miasto) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NaPrzelewie1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NaPrzelewie2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Nip) .IsRequired() .HasMaxLength(40) .IsUnicode(false) .HasColumnName("NIP"); entity.Property(e => e.NrAnalityki) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.NrDomu) .HasMaxLength(9) .IsUnicode(false); entity.Property(e => e.NrLokalu) .HasMaxLength(9) .IsUnicode(false); entity.Property(e => e.Poczta) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Prowizja).HasColumnType("decimal(10, 4)"); entity.Property(e => e.RabatDost).HasColumnType("decimal(10, 4)"); entity.Property(e => e.RabatOdb).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Rezerwa1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Rezerwa2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Telefon) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.TermWaznKarty).HasColumnType("datetime"); entity.Property(e => e.Ulica) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kontr) .WithMany(p => p.SklepKontrs) .HasForeignKey(d => d.KontrId) .HasConstraintName("FK_SKLEPKON_REF_KTHSK_KONTRAHE"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontrs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKON_REF_SKLEP_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Znaczenie }) .HasName("PK_SKLEPKONTROPIS"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontrOpis) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKON_REF_SKKTH_SKLEPKON"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId }) .HasName("PK_SKLKONTRSKL"); entity.ToTable("SklepKontrSklep"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataBo) .HasColumnType("datetime") .HasColumnName("DataBO"); entity.Property(e => e.KodKraju) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KolejnyWdniuBo).HasColumnName("KolejnyWDniuBO"); entity.Property(e => e.NrSeryjny) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.OkrZamkniety).HasColumnType("datetime"); entity.Property(e => e.OstEksport).HasColumnType("datetime"); entity.Property(e => e.OstImport).HasColumnType("datetime"); entity.Property(e => e.PotwEksport).HasColumnType("datetime"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WymImport).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKontrSkleps) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SklKontrSklKontr"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Kpwid }) .HasName("PK_SKLEPKTHPRZYDZIAL"); entity.ToTable("SklepKthPrzydzial"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kpwid) .HasColumnType("numeric(9, 0)") .HasColumnName("KPWId"); entity.HasOne(d => d.Kpw) .WithMany(p => p.SklepKthPrzydzials) .HasForeignKey(d => d.Kpwid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKTH_REF_SKKTH_KTHPARWA"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKthPrzydzials) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPKTH_REF_SKKTH_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.SklepTypOsId }) .HasName("PK_SKLEPKTHTYPOS"); entity.HasIndex(e => new { e.SklepId, e.SklepTypOsId }, "idx_SKKTHTYPOS_SKTYPOS"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepKthTypOs) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKKTHTYPOS_SKKTH"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepKthTypOs) .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKKTHTYPOS_SKTYPOS"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepMagId }) .HasName("PK_SKLEPMAGAZYN"); entity.ToTable("SklepMagazyn"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepMagazyns) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPMAG_REF_SKMAG_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.TowId, e.KontrId }) .HasName("PK_SKLEPNARZDOST"); entity.ToTable("SklepNarzDost"); entity.HasIndex(e => e.KontrId, "idx_SklepNarzDostKth"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Kontr) .WithMany(p => p.SklepNarzDosts) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPNAR_REF_SKLEP_KONTRAHE"); entity.HasOne(d => d.SklepFlagi) .WithMany(p => p.SklepNarzDosts) .HasForeignKey(d => new { d.SklepId, d.TowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPNAR_REF_SKLEP_SKLEPFLA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }) .HasName("PK_SKLEPNOTATKI"); entity.ToTable("SklepNotatki"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepNotatkis) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPNOT_REF_SKNOT_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.NrFormat }) .HasName("PK_SKLEPNRREJ"); entity.ToTable("SklepNrRej"); entity.HasIndex(e => new { e.NrFormat, e.SklepId, e.SklepKontrId }, "idx_SkNumerRej"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrFormat) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.NrWpisany) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepNrRejs) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkNrRejKth"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.NrFormat, e.SklepKartaId }) .HasName("PK_SKLEPNRREJKARTA"); entity.HasIndex(e => new { e.SklepId, e.SklepKartaId, e.SklepKontrId, e.NrFormat }, "idx_SkNrRejKartaId"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NrFormat) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SklepKartaId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepNrRejKarta) .HasForeignKey(d => new { d.SklepId, d.SklepKartaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkKartaNrRej"); entity.HasOne(d => d.SklepNrRej) .WithMany(p => p.SklepNrRejKarta) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId, d.NrFormat }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkNrRejKarta"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepOplataId }); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepOplataId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataDo).HasColumnType("datetime"); entity.Property(e => e.DataOd).HasColumnType("datetime"); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.OplataId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKbid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepKBId"); entity.Property(e => e.StawkaProc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepOplata) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKOPLATA_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepPanelId }) .HasName("PK_SKLEP_PANEL"); entity.ToTable("SklepPanel"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepPanelId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.PanelId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TypAplikacji).HasDefaultValueSql("((3))"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Panel) .WithMany(p => p.SklepPanels) .HasForeignKey(d => d.PanelId) .HasConstraintName("FK_SKLEPPANEL_REFERENCE_PANEL"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPanels) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .HasConstraintName("FK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepPanelId, e.ParNazwa }) .HasName("PK_SKLEP_PANEL_PARAM"); entity.ToTable("SklepPanelParam"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepPanelId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParNazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPanelParams) .HasForeignKey(d => new { d.SklepId, d.SklepPanelId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }) .HasName("PK_SKLEPPARBON"); entity.ToTable("SklepParBon"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Numer) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Typ) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepParBons) .HasForeignKey(d => new { d.SklepId, d.SklepParId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPB_SKLEPPAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Typ, e.Gdzie }) .HasName("PK_SKLEPPARPUNKTY"); entity.ToTable("SklepParPunkty"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy).HasColumnType("datetime"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepParPunkties) .HasForeignKey(d => new { d.SklepId, d.SklepParId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPPAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepWalId }) .HasName("PK_SKLEPPARWALUTA"); entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkWalPar"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ParKwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepParWaluta) .HasForeignKey(d => new { d.SklepId, d.SklepParId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPWZ_SKLEPPAR"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepParWaluta) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKWAL_SKLEPWAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId }) .HasName("PK_SKLEPPARAGON"); entity.ToTable("SklepParagon"); entity.HasIndex(e => new { e.SklepId, e.SklepKasaId }, "idx_SkParKasa"); entity.HasIndex(e => new { e.SklepId, e.Kasjer }, "idx_SkParKasjer"); entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkParWal"); entity.HasIndex(e => e.Zmiana, "idx_SkParZmiana"); entity.HasIndex(e => new { e.SklepId, e.DataCzas }, "idx_SklepParDataCzas"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Bony).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Brutto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CechyPar) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.CentrEksportFk).HasColumnName("CentrEksportFK"); entity.Property(e => e.Czek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.DataCzas).HasColumnType("datetime"); entity.Property(e => e.DodFplat) .HasColumnType("decimal(15, 4)") .HasColumnName("DodFPlat"); entity.Property(e => e.EksportFk).HasColumnName("EksportFK"); entity.Property(e => e.Gotowka).HasColumnType("decimal(15, 4)"); entity.Property(e => e.GrupyGtu) .HasMaxLength(255) .IsUnicode(false) .HasColumnName("GrupyGTU"); entity.Property(e => e.InneFplat) .HasColumnType("decimal(15, 4)") .HasColumnName("InneFPlat"); entity.Property(e => e.Karta).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kasjer) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.KodKarty) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nip) .HasMaxLength(40) .IsUnicode(false) .HasColumnName("NIP"); entity.Property(e => e.OpakWyd).HasColumnType("decimal(15, 4)"); entity.Property(e => e.OpakZwr).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Przelew).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Rabat).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Waluty).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepParagons) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKLEP_SKLEP"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepParagons) .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPKAS"); entity.HasOne(d => d.Sklep1) .WithMany(p => p.SklepParagons) .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPWAL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }) .HasName("PK_SKLEPPARTIA"); entity.HasIndex(e => new { e.TypPartii, e.SklepId, e.SklepTowId, e.Pozostalo }, "idx_SkPrtTypTowIle"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cecha1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Cecha2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.DataWazn).HasColumnType("datetime"); entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPartia) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPRT_SKLEPTOW"); entity.HasOne(d => d.SklepPozDok) .WithOne(p => p.SklepPartium) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPAR_REF_SKPRT_SKLEPPOZ"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepNoweKontoId, e.RodzajPow }) .HasName("PK_SKLEPPOWKONTLOJ"); entity.ToTable("SklepPowKontLoj"); entity.HasIndex(e => e.SklepStareKontoId, "idx_PowStareSKLoj"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepNoweKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepStareKontoId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPowKontLojSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepNoweKontoId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepNoweKonto"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepPowKontLojSklepNavigations) .HasForeignKey(d => new { d.SklepId, d.SklepStareKontoId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepStareKonto"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepUzId, e.RodzajPow, e.Id }) .HasName("PK_SK_POW_UZ"); entity.ToTable("SklepPowiazanieUz"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPowiazanieUzs) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPOW_REF_SKPOW_SKLEPUZY"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepGrAkcId }) .HasName("PK_SKLEPPOZAKCYZA"); entity.ToTable("SklepPozAkcyza"); entity.HasIndex(e => new { e.SklepId, e.SklepGrAkcId }, "idx_SkPozAkcGr"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPozAkcyzas) .HasForeignKey(d => new { d.SklepId, d.SklepGrAkcId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkAkcPoz"); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepPozAkcyzas) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkPozAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }) .HasName("PK_SKLEPPOZDOK"); entity.ToTable("SklepPozDok"); entity.HasIndex(e => new { e.SklepId, e.SklepDokId, e.NrPozycji }, "idx_SklepPozDokNrPoz"); entity.HasIndex(e => new { e.SklepId, e.SklepTowId }, "idx_SklepPozDokTowId"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDomyslna).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaPoRab).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaPrzedRab).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IleWzgrzewce) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWZgrzewce"); entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPozDoks) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepPozDoks) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }) .HasName("PK_SKLEPPOZPAR"); entity.ToTable("SklepPozPar"); entity.HasIndex(e => new { e.SklepId, e.SklepTowId }, "idx_SkPozParTow"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.GrupaGtu) .HasMaxLength(4) .IsUnicode(false) .HasColumnName("GrupaGTU"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Kod) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.RabatKwot).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WartoscBrutto).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPozPars) .HasForeignKey(d => new { d.SklepId, d.SklepParId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepPozPars) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .HasConstraintName("FK_SKLEPPOZ_REF_SKTOW_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }) .HasName("PK_SKLEPPOZPARSZCZEG"); entity.ToTable("SklepPozParSzczeg"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DodInfo) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.SklepPozPar) .WithOne(p => p.SklepPozParSzczeg) .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepProfilId }) .HasName("PK_SKLEPPROFIL"); entity.ToTable("SklepProfil"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Utworzony).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Profil) .WithMany(p => p.SklepProfils) .HasForeignKey(d => d.ProfilId) .HasConstraintName("FK_SKLEPPROFIL_REFERENCE_PROFIL"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepProfils) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPROFIL_REFERENCE_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepProfilId, e.ParGrupa, e.ParNazwa, e.Kolejny }) .HasName("PK_SKLEPPROFIL_KONFIG"); entity.ToTable("SklepProfilKonfig"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParGrupa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.ParNazwa) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Utworzony).HasColumnType("datetime"); entity.Property(e => e.Wartosc) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepProfilKonfigs) .HasForeignKey(d => new { d.SklepId, d.SklepProfilId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Pmid }) .HasName("PK_SKLEPPRTMAG"); entity.ToTable("SklepPrtMag"); entity.HasIndex(e => new { e.SklepId, e.SklepTowId, e.SklepMagId, e.Data, e.KolejnyWdniu, e.Pmid }, "idx_SkPrtMagFifo"); entity.HasIndex(e => new { e.NrPartii, e.SklepId, e.SklepTowId, e.Pmid }, "idx_SkPrtMagNrPrt"); entity.HasIndex(e => e.Zmiana, "idx_SkPrtMagZmn"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.DataWazn).HasColumnType("datetime"); entity.Property(e => e.Dostarczono).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KolejnyWdniu).HasColumnName("KolejnyWDniu"); entity.Property(e => e.NrDostawy) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.NrPartii) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Rezerwacja).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkPrtMagMagazyn"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkPrtMagTowar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.AsId }) .HasName("PK_SKLEPPRZYDZIAL"); entity.ToTable("SklepPrzydzial"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.As) .WithMany(p => p.SklepPrzydzials) .HasForeignKey(d => d.AsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPRZ_REF_SKLEP_ASORT"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepPrzydzials) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPPRZ_REF_SKLEP_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRwpid }) .HasName("PK_SKLEPRAPWARTPOCZ"); entity.ToTable("SklepRapWartPocz"); entity.HasIndex(e => new { e.SklepId, e.TypRap, e.Data }, "idx_SRWP_TypRapData"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRwpid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepRWPId"); entity.Property(e => e.Data).HasColumnType("datetime"); entity.Property(e => e.ParamTxt) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Wykonano).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRapWartPoczs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRwpid, e.SklepMagId, e.Typ, e.Numer }) .HasName("PK_SKLEPRAPWARTPOCZDANE"); entity.ToTable("SklepRapWartPoczDane"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRwpid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepRWPId"); entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Typ).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRapWartPoczDanes) .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepRapWartPoczDanes) .HasForeignKey(d => new { d.SklepId, d.SklepRwpid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRegulaId }) .HasName("PK_SKLEPREGULA"); entity.ToTable("SklepRegula"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataCzasDo).HasColumnType("datetime"); entity.Property(e => e.DataCzasOd).HasColumnType("datetime"); entity.Property(e => e.Nazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Number1).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number2).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number3).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Number4).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Str1) .HasMaxLength(128) .IsUnicode(false); entity.Property(e => e.Str2) .HasMaxLength(128) .IsUnicode(false); entity.Property(e => e.Usunieto).HasColumnType("datetime"); entity.Property(e => e.Utworzono).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulas) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULA_REFERENCE_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.SklepAsId, e.Znaczenie }) .HasName("PK_SKLEPREGULAASORT"); entity.ToTable("SklepRegulaAsort"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepAsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepAsNazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulaAsorts) .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepRegulaId, e.Kolejnosc }) .HasName("PK_SKLEPREGULADOK"); entity.ToTable("SklepRegulaDok"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Konto) .WithMany(p => p.SklepRegulaDoks) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_SkRegDokKonto"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulaDoks) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegDokDok"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepRegulaId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_SKLREGULADOKSZCZEG"); entity.ToTable("SklepRegulaDokSzczeg"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Param3) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepRegulaDok) .WithMany(p => p.SklepRegulaDokSzczegs) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.SklepRegulaId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SklRgDokSzczegSklRgDok"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepRegulaId, e.Kolejnosc }) .HasName("PK_SKLEPREGULAPAR"); entity.ToTable("SklepRegulaPar"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Konto) .WithMany(p => p.SklepRegulaPars) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_SkRegParKonto"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulaPars) .HasForeignKey(d => new { d.SklepId, d.SklepParId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegParPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepRegulaId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_SKLREGULAPARSZCZEG"); entity.ToTable("SklepRegulaParSzczeg"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Param3) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepRegulaPar) .WithMany(p => p.SklepRegulaParSzczegs) .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.SklepRegulaId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SklRgParSzczegSklRPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.Znaczenie }) .HasName("PK_SKLEPREGULAPARAM"); entity.ToTable("SklepRegulaParam"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Param2) .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulaParams) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULAPA_REFERENCE_SKLEP"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepRegulaParams) .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepRegulaId, e.Typ }) .HasName("PK_SKLEPREGULAPOZDOK"); entity.ToTable("SklepRegulaPozDok"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepRegulaPozDoks) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegPozPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepRegulaId, e.Typ, e.KolejnoscRegulaDok }) .HasName("PK_SKLREGPOZDOKSZ"); entity.ToTable("SklepRegulaPozDokSzczeg"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepRegulaPozDokSzczegs) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegPozSzPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc, e.SklepRegulaId, e.Typ }) .HasName("PK_SKLEPREGULAPOZPAR"); entity.ToTable("SklepRegulaPozPar"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPozPar) .WithMany(p => p.SklepRegulaPozPars) .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegPozPar"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc, e.SklepRegulaId, e.Typ, e.KolejnoscRegulaPar }) .HasName("PK_SKLREGPOZPARSZ"); entity.ToTable("SklepRegulaPozParSzczeg"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPozPar) .WithMany(p => p.SklepRegulaPozParSzczegs) .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRegPozPSzPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.SklepTowId, e.Znaczenie }) .HasName("PK_SKLEPREGULATOWAR"); entity.ToTable("SklepRegulaTowar"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRegulaTowars) .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULATO_REFERENCE_SKLEPREGULA"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepRegulaTowars) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepRolaId }) .HasName("PK_SKLEPROLA"); entity.ToTable("SklepRola"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.CentrRola) .WithMany(p => p.SklepRolas) .HasForeignKey(d => d.CentrRolaId) .HasConstraintName("Ref_SklepRolaRola"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRolas) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepRolaSklep"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Pmid, e.Znaczenie, e.SklepDokId, e.Kolejnosc }) .HasName("PK_SKLEPROZPRTMAG"); entity.ToTable("SklepRozPrtMag"); entity.HasIndex(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.Znaczenie, e.Pmid }, "idx_SkRozPrtMagPoz"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.IloscPrt).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepRozPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRozPrtMagPoz"); entity.HasOne(d => d.SklepPrtMag) .WithMany(p => p.SklepRozPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkRozPrtMagPrt"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Stawka }) .HasName("PK_SKLEPROZBICIEDOK"); entity.ToTable("SklepRozbicieDok"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRozbicieDoks) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPROZ_REF_SKLEP_SKLEPDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.RozSklepDokId, e.RozKolejnosc, e.PrtSklepDokId, e.PrtKolejnosc }) .HasName("PK_SKLEPROZLPARTII"); entity.ToTable("SklepRozlPartii"); entity.HasIndex(e => new { e.SklepId, e.PrtSklepDokId, e.PrtKolejnosc }, "idx_SkRozPrt"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RozSklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PrtSklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepPartium) .WithMany(p => p.SklepRozlPartiis) .HasForeignKey(d => new { d.SklepId, d.PrtSklepDokId, d.PrtKolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPROZ_REF_SKPRT_SKLEPPAR"); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepRozlPartiis) .HasForeignKey(d => new { d.SklepId, d.RozSklepDokId, d.RozKolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPROZ_REF_SKROZ_SKLEPPOZ"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }) .HasName("PK_SKLEPROZLICZA"); entity.ToTable("SklepRozlicza"); entity.HasIndex(e => new { e.RozliczanySklepId, e.RozliczanySklepDokId }, "idx_SkRozliczany"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RozliczanySklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.RozliczanySklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); entity.Property(e => e.RozliczeniePodatku).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.RozliczanySklep) .WithMany(p => p.SklepRozliczaRozliczanySkleps) .HasForeignKey(d => new { d.RozliczanySklepId, d.RozliczanySklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPROZ_REF_SKKOG_SKLEPDOK"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepRozliczaSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPROZ_REF_SKKTO_SKLEPDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDkid, e.Kolejnosc }) .HasName("PK_SKSKLDEFKODU"); entity.ToTable("SklepSkladnikDefinicjiKodu"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDkid) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepDKId"); entity.Property(e => e.Tekst) .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepSkladnikDefinicjiKodus) .HasForeignKey(d => new { d.SklepId, d.SklepDkid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKSKLDEFKODUDEFDOKU"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepSkWzId }) .HasName("PK_SKLEPSKLADNIKWZORCA"); entity.ToTable("SklepSkladnikWzorca"); entity.HasIndex(e => new { e.SklepTowIdWzorca, e.Kolejnosc }, "idx_SkSkladnikWzorca_SkTowIdWzorca"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepSkWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SkWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowIdWzorca).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepSkladnikWzorcas) .HasForeignKey(d => new { d.SklepId, d.SklepTowIdWzorca }) .HasConstraintName("FK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.CentralaId, e.SklepId }) .HasName("PK_SKLEPSKLEP"); entity.ToTable("SklepSklep"); entity.Property(e => e.CentralaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Centrala) .WithMany(p => p.SklepSklepCentralas) .HasForeignKey(d => d.CentralaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPSKL_REF_SKCEN_SKLEP"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepSklepSkleps) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPSKL_REF_SKSKL_SKLEP"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Dzien, e.SklepTowId, e.Pmid }) .HasName("PK_SKLEPSTANPRTMAG"); entity.ToTable("SklepStanPrtMag"); entity.HasIndex(e => new { e.SklepId, e.SklepTowId, e.Pmid, e.Dzien }, "idx_SkStanPrt"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.StanPrt).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepDzienRozl) .WithMany(p => p.SklepStanPrtMags) .HasForeignKey(d => new { d.SklepId, d.Dzien }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkStanPrtDzien"); entity.HasOne(d => d.SklepPrtMag) .WithMany(p => p.SklepStanPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkStanPrtMag"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Pmid, e.TypDanych }) .HasName("PK_SKLEPSZCZEGPRTMAG"); entity.ToTable("SklepSzczegPrtMag"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepPrtMag) .WithMany(p => p.SklepSzczegPrtMags) .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepSzczegPrtMag"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }) .HasName("PK_SKLEPTEKSTDOK"); entity.ToTable("SklepTekstDok"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTekstDoks) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPTEK_REF_SKLEP_SKLEPDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_SKLEPTEKSTPOZ"); entity.ToTable("SklepTekstPoz"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepPozDok) .WithMany(p => p.SklepTekstPozs) .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepTekstPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepZgId, e.Wersja, e.Kolejnosc }) .HasName("PK_SKLEPTEKSTZGODY"); entity.ToTable("SklepTekstZgody"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTekstZgodies) .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKTXTZG_SKZGODA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }) .HasName("PK_SKLEPTOWAKCYZA"); entity.ToTable("SklepTowAkcyza"); entity.HasIndex(e => new { e.SklepId, e.SklepGrAkcId }, "idx_SkTowAkcGr"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaMax).HasColumnType("decimal(15, 4)"); entity.Property(e => e.IleAkcJm) .HasColumnType("decimal(15, 4)") .HasColumnName("IleAkcJM"); entity.Property(e => e.KodCn) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("KodCN"); entity.Property(e => e.Sklad).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowAkcyzas) .HasForeignKey(d => new { d.SklepId, d.SklepGrAkcId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkAkcTow"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepTowAkcyzas) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkTowAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }) .HasName("PK_SKLEPTOWDODATEK"); entity.ToTable("SklepTowDodatek"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.DodSklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SklepTowar) .WithMany(p => p.SklepTowDodatekSklepTowars) .HasForeignKey(d => new { d.SklepId, d.DodSklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkDodTow"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowDodatekSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkTowDod"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }) .HasName("PK_SKLEPTOWKOD"); entity.ToTable("SklepTowKod"); entity.HasIndex(e => e.Kod, "idx_SklepKod"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IleWkodzie) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWKodzie"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.PrefPlu).HasColumnName("PrefPLU"); entity.Property(e => e.Skrot) .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowKods) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPTOW_REF_KODSK_SKLEPTOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Znaczenie }) .HasName("PK_SKLEPTOWPOWIAZANIE"); entity.ToTable("SklepTowPowiazanie"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PowSklepTowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.SklepTowar) .WithMany(p => p.SklepTowPowiazanieSklepTowars) .HasForeignKey(d => new { d.SklepId, d.PowSklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkPowTowPow_SkTow"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowPowiazanieSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SkTowPow_SkTow"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.IdxRodzStrat }) .HasName("PK_SKLEPTOWSTRATY"); entity.ToTable("SklepTowStraty"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowStraties) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKTWSTR_TOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTowId }) .HasName("PK_SKLEPTOWAR"); entity.ToTable("SklepTowar"); entity.HasIndex(e => new { e.SklepId, e.SklepArtId }, "idx_SklepTowArt"); entity.HasIndex(e => new { e.SklepId, e.SklepProducent }, "idx_SklepTowProd"); entity.HasIndex(e => new { e.SklepId, e.TowId }, "idx_SklepTowSkTow"); entity.HasIndex(e => e.TowId, "idx_SklepTowTow"); entity.HasIndex(e => e.Zmiana, "idx_SklepTowZmiana"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Asortyment) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaEw).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CentrTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cku) .IsRequired() .HasMaxLength(20) .IsUnicode(false) .HasColumnName("CKU"); entity.Property(e => e.GrupaGtu) .HasMaxLength(3) .IsUnicode(false) .HasColumnName("GrupaGTU"); entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); entity.Property(e => e.IleWcalosci) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWCalosci"); entity.Property(e => e.IleWopak) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWOpak"); entity.Property(e => e.IleWzgrzewce) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWZgrzewce"); entity.Property(e => e.Indeks1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Indeks2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Jm) .IsRequired() .HasMaxLength(10) .IsUnicode(false) .HasColumnName("JM"); entity.Property(e => e.Kategoria) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.KodCn) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("KodCN"); entity.Property(e => e.KodKrajuPochodzenia) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); entity.Property(e => e.MaxCenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.MinCenaSp).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); entity.Property(e => e.NowoscOd).HasColumnType("datetime"); entity.Property(e => e.Opis1) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis2) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis3) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis4) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PrzeliczJm) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("PrzeliczJM"); entity.Property(e => e.Rezerwa1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Rezerwa2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.SklepArtId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepOpakId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepProducent).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowars) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_SKLEP"); entity.HasOne(d => d.Tow) .WithMany(p => p.SklepTowars) .HasForeignKey(d => d.TowId) .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_TOWAR"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepTowars) .HasForeignKey(d => new { d.SklepId, d.SklepArtId }) .HasConstraintName("FK_SKLEPTOW_REF_SKTOW_SKLEPART"); entity.HasOne(d => d.Sklep1) .WithMany(p => p.SklepTowars) .HasForeignKey(d => new { d.SklepId, d.SklepProducent }) .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_SKLEPKON"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepSkWzId, e.SklepTowId }) .HasName("PK_SKLEPTOWARSKLADNIKA"); entity.ToTable("SklepTowarSkladnika"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepSkWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaZkartyTow).HasColumnName("CenaZKartyTow"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTowarSkladnikas) .HasForeignKey(d => new { d.SklepId, d.SklepSkWzId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepTowarSkladnikas) .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepTypOsId }) .HasName("PK_SKLEPTYPOS"); entity.HasIndex(e => e.TypOsId, "idx_SKTYPOS_TYPOS"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrTypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepTypOs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKTYPOS_SKLEP"); entity.HasOne(d => d.TypOs) .WithMany(p => p.SklepTypOs) .HasForeignKey(d => d.TypOsId) .HasConstraintName("FK_SKTYPOS_TYPOS"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepUzId, e.Rodzaj }) .HasName("PK_SKLEPUPRAWNIENIE"); entity.ToTable("SklepUprawnienie"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepUprawnienies) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPUPR_REF_SKUPR_SKLEPUZY"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepUzId }) .HasName("PK_SKLEPUZYTKOWNIK"); entity.ToTable("SklepUzytkownik"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Haslo) .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.HasloPrepaid) .HasMaxLength(100) .IsUnicode(false); entity.Property(e => e.IdentPrepaid) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Identyfikator) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Jezyk) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KodKasjera) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Nazwisko) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.OstZmianaHasla).HasColumnType("datetime"); entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepUzytkowniks) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPUZY_REF_SKUZ_SKLEP"); entity.HasOne(d => d.Uz) .WithMany(p => p.SklepUzytkowniks) .HasForeignKey(d => d.UzId) .HasConstraintName("FK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepUzytkowniks) .HasForeignKey(d => new { d.SklepId, d.SklepProfilId }) .HasConstraintName("FK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepWalId }) .HasName("PK_SK_WALUTA"); entity.HasIndex(e => e.WalId, "idx_SkWal"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot1) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Skrot100) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepWaluta) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPWAL_REF_SKWAL_SKLEP"); entity.HasOne(d => d.Wal) .WithMany(p => p.SklepWaluta) .HasForeignKey(d => d.WalId) .HasConstraintName("FK_SKLEPWAL_REF_SKWAL_WALUTA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepDokId }) .HasName("PK_SKLEPZALEZNOSC"); entity.ToTable("SklepZaleznosc"); entity.HasIndex(e => new { e.PoprzedniSklepId, e.PoprzedniSklepDokId }, "idx_SklepPoprzedniDokId"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PoprzedniSklepDokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PoprzedniSklepId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.PoprzedniSklep) .WithMany(p => p.SklepZaleznoscPoprzedniSkleps) .HasForeignKey(d => new { d.PoprzedniSklepId, d.PoprzedniSklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPZAL_REF_SKDOD_SKLEPDOK"); entity.HasOne(d => d.Sklep) .WithOne(p => p.SklepZaleznoscSklep) .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKLEPZAL_REF_SKODD_SKLEPDOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.Tabela, e.Id, e.Typ }) .HasName("PK_SKLEPZASOB"); entity.ToTable("SklepZasob"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Typ) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Sciezka) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepZasobs) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SklepZasobSklep"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Kiedy }) .HasName("PK_SKLEPZDARZOS"); entity.HasIndex(e => new { e.SklepId, e.SklepUzId, e.Kiedy }, "idx_SKZDOSUZKIEDY"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId, e.SklepZgId, e.DataDec }, "idx_SKZDOS_OSTDEC"); entity.HasIndex(e => new { e.SklepId, e.SklepKontrId, e.SklepZgId, e.Kiedy }, "idx_SKZDOS_OSTZGODA"); entity.HasIndex(e => new { e.SklepId, e.SklepTypOsId }, "idx_SKZDOS_SKTPOS"); entity.HasIndex(e => new { e.SklepId, e.SklepZgId }, "idx_SKZDOS_SKZG"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.DataDec).HasColumnType("datetime"); entity.Property(e => e.DodPar) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepZdarzOs) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKZDOS_SKKTH"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.SklepZdarzOs) .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) .HasConstraintName("FK_SKZDOS_SKTPOS"); entity.HasOne(d => d.Sklep1) .WithMany(p => p.SklepZdarzOs) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .HasConstraintName("FK_SKZDOSUZ"); entity.HasOne(d => d.Sklep2) .WithMany(p => p.SklepZdarzOs) .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) .HasConstraintName("FK_SKZDOS_SKZG"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Kiedy, e.Znaczenie }) .HasName("PK_SKZDARZOSOPIS"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.SklepZdarzO) .WithMany(p => p.SklepZdarzOsOpis) .HasForeignKey(d => new { d.SklepId, d.SklepKontrId, d.Kiedy }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKZDOSOPIS"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SklepId, e.SklepZgId }) .HasName("PK_SKLEPZGODA"); entity.HasIndex(e => e.ZgId, "idx_SKZG_ZGODA"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DaneOs) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Zastosowania) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.SklepZgoda) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_SKZG_SKLEP"); entity.HasOne(d => d.Zg) .WithMany(p => p.SklepZgoda) .HasForeignKey(d => d.ZgId) .HasConstraintName("FK_SKZG_ZGODA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.SklepId, e.CzasId, e.SklepTowId }) .HasName("PK_SPRZEDAZ"); entity.ToTable("Sprzedaz"); entity.HasIndex(e => new { e.CzasId, e.SklepId, e.TowId }, "Sprzedaz_Czas_Sklep_Towar"); entity.HasIndex(e => new { e.CzasId, e.TowId, e.SklepId }, "Sprzedaz_Czas_Towar_Sklep"); entity.HasIndex(e => new { e.SklepId, e.TowId }, "Sprzedaz_Sklep_Towar"); entity.HasIndex(e => new { e.TowId, e.SklepId }, "Sprzedaz_Towar_Sklep"); entity.HasIndex(e => e.SklepId, "idx_Sprzedaz_SklepId"); entity.HasIndex(e => e.TowId, "idx_Sprzedaz_TowId"); entity.Property(e => e.TowId) .HasColumnType("numeric(9, 0)") .HasColumnName("TowID"); entity.Property(e => e.SklepId) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepID"); entity.Property(e => e.CzasId) .HasColumnType("numeric(9, 0)") .HasColumnName("CzasID"); entity.Property(e => e.SklepTowId) .HasColumnType("numeric(9, 0)") .HasColumnName("SklepTowID"); entity.Property(e => e.CenaSprzedazyBrutto).HasColumnType("decimal(14, 3)"); entity.Property(e => e.CenaSprzedazyNetto).HasColumnType("decimal(14, 3)"); entity.Property(e => e.CenaZakInne).HasColumnType("decimal(14, 3)"); entity.Property(e => e.CenaZakPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.CenaZakZakupy).HasColumnType("decimal(14, 3)"); entity.Property(e => e.CenaZakupuNetto).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSprzedana).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSztTowFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSztTowHurt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSztTowPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSztTowPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlSztTowRozchody).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlTowFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlTowPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlZakInne).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlZakPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlZakZakupy).HasColumnType("decimal(14, 3)"); entity.Property(e => e.IlZakupiona).HasColumnType("decimal(14, 3)"); entity.Property(e => e.StanTowaru).HasColumnType("decimal(14, 3)"); entity.Property(e => e.Version) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.WartNetZapas).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzBrtFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzBrtHurt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzBrtPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzBrtPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzBrtRozchody).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzNetFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzNetHurt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzNetPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzNetPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartSprzNetRozchody).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakBrtFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakBrtHurt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakBrtPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakBrtPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakBrtRozchody).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakInne).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakNetFakt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakNetHurt).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakNetPar).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakNetPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakNetRozchody).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakPrzes).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartZakZakupy).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartoscSprzedazWcenieZakupu) .HasColumnType("decimal(14, 3)") .HasColumnName("WartoscSprzedazWCenieZakupu"); entity.Property(e => e.WartoscSprzedazyBrutto).HasColumnType("decimal(14, 3)"); entity.Property(e => e.WartoscSprzedazyNetto).HasColumnType("decimal(14, 3)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Dzien, e.TowId, e.Pmid }) .HasName("PK_STANPRTMAG"); entity.ToTable("StanPrtMag"); entity.HasIndex(e => new { e.TowId, e.Pmid, e.Dzien }, "idx_StanPrt"); entity.Property(e => e.Dzien).HasColumnType("datetime"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.StanPrt).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.DzienNavigation) .WithMany(p => p.StanPrtMags) .HasForeignKey(d => d.Dzien) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_StanPrtDzien"); entity.HasOne(d => d.PrtMag) .WithMany(p => p.StanPrtMags) .HasForeignKey(d => new { d.TowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_StanPrtMag"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.ZgId }) .HasName("PK_STANZGODY"); entity.ToTable("StanZgody"); entity.HasIndex(e => e.ZgId, "idx_STZG_ZG"); entity.HasIndex(e => e.Zmiana, "idx_STZG_ZMIANA"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DataDec).HasColumnType("datetime"); entity.Property(e => e.Kiedy) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kontr) .WithMany(p => p.StanZgodies) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_STZG_KTH"); entity.HasOne(d => d.Zg) .WithMany(p => p.StanZgodies) .HasForeignKey(d => d.ZgId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_STZG_ZG"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ModId) .HasName("PK_STRUKTURA_7_3"); entity.ToTable("Struktura_7_3"); entity.Property(e => e.ModId).ValueGeneratedNever(); entity.Property(e => e.Kiedy).HasColumnType("datetime"); entity.Property(e => e.Wersja) .HasMaxLength(40) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.KodSubsys) .HasName("PK_SUBSYS"); entity.HasIndex(e => new { e.TowId, e.KodSubsys }, "idx_SubsysTow"); entity.HasIndex(e => e.Zmiana, "idx_SubsysZmiana"); entity.Property(e => e.KodSubsys) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.DataDok).HasColumnType("datetime"); entity.Property(e => e.IleWzgrzewce) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWZgrzewce"); entity.Property(e => e.KodZgrzewki) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.NrDok) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Tow) .WithMany(p => p.Subsies) .HasForeignKey(d => d.TowId) .HasConstraintName("FK_SUBSYS_TOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Pmid, e.TypDanych }) .HasName("PK_SZCZEGPRTMAG"); entity.ToTable("SzczegPrtMag"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Pmid) .HasColumnType("numeric(9, 0)") .HasColumnName("PMId"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.PrtMag) .WithMany(p => p.SzczegPrtMags) .HasForeignKey(d => new { d.TowId, d.Pmid }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_SzczegPrtMag"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.GrAkcId, e.OdDaty }) .HasName("PK_TABELAAKCYZOWA"); entity.ToTable("TabelaAkcyzowa"); entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.OdDaty).HasColumnType("datetime"); entity.Property(e => e.MinStawkaAkc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.ProcCenyMax).HasColumnType("decimal(10, 4)"); entity.Property(e => e.StawkaAkc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.GrAkc) .WithMany(p => p.TabelaAkcyzowas) .HasForeignKey(d => d.GrAkcId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_TabAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Znaczenie }) .HasName("PK_TEKSTDOK"); entity.ToTable("TekstDok"); entity.HasIndex(e => new { e.Tekst, e.Znaczenie }, "idx_TekstDokTekstZnaczenie"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Dok) .WithMany(p => p.TekstDoks) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TEKSTDOK_REF_TEKST_DOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.Znaczenie }) .HasName("PK_TEKSTPOZ"); entity.ToTable("TekstPoz"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.PozDok) .WithMany(p => p.TekstPozs) .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_TekstPoz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ZgId, e.Wersja, e.Kolejnosc }) .HasName("PK_TEKSTZGODY"); entity.ToTable("TekstZgody"); entity.HasIndex(e => e.Zmiana, "idx_TXTZG_ZMIANA"); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Zg) .WithMany(p => p.TekstZgodies) .HasForeignKey(d => d.ZgId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TXTZG_ZGODA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Kolejnosc }) .HasName("PK_TOWAKCYZA"); entity.ToTable("TowAkcyza"); entity.HasIndex(e => e.GrAkcId, "idx_TowAkcGr"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaMax).HasColumnType("decimal(15, 4)"); entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.IleAkcJm) .HasColumnType("decimal(15, 4)") .HasColumnName("IleAkcJM"); entity.Property(e => e.KodCn) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("KodCN"); entity.Property(e => e.Sklad).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.GrAkc) .WithMany(p => p.TowAkcyzas) .HasForeignKey(d => d.GrAkcId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_AkcTow"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowAkcyzas) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_TowAkc"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Kolejnosc }) .HasName("PK_TOWDODATEK"); entity.ToTable("TowDodatek"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.DodTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.DodTow) .WithMany(p => p.TowDodatekDodTows) .HasForeignKey(d => d.DodTowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_DodTow"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowDodatekTows) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_TowDod"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.KrajId }) .HasName("PK_TOWKRAJ"); entity.ToTable("TowKraj"); entity.HasIndex(e => new { e.KrajId, e.TowId }, "idx_KrajTow"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Indeks1) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Indeks2) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Nazwa) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Opis1) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis2) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis3) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis4) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Skrot) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kraj) .WithMany(p => p.TowKrajs) .HasForeignKey(d => d.KrajId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Ref_KrajTow"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowKrajs) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Ref_TowKraj"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.Znaczenie }) .HasName("PK_TOWPOWIAZANIE"); entity.ToTable("TowPowiazanie"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PowTowId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.PowTow) .WithMany(p => p.TowPowiazaniePowTows) .HasForeignKey(d => d.PowTowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_PowTowPow_Tow"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowPowiazanieTows) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_TowPow_Tow"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.IdxRodzStrat }) .HasName("PK_TOWSTRATY"); entity.ToTable("TowStraty"); entity.HasIndex(e => e.IdxRodzStrat, "idx_TwStrRS"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowStraties) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TWSTR_TOW"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.IdxRodzStrat, e.SklepId }) .HasName("PK_TOWSTRATYDLASKLEPU"); entity.ToTable("TowStratyDlaSklepu"); entity.HasIndex(e => e.SklepId, "idx_TwStrSk"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); entity.HasOne(d => d.Sklep) .WithMany(p => p.TowStratyDlaSklepus) .HasForeignKey(d => d.SklepId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TWSTRSKL_SKL"); entity.HasOne(d => d.TowStraty) .WithMany(p => p.TowStratyDlaSklepus) .HasForeignKey(d => new { d.TowId, d.IdxRodzStrat }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TWSTRSKL_TWSTR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.TowId, e.ParId }) .HasName("PK_TOWWARTOSC"); entity.ToTable("TowWartosc"); entity.HasIndex(e => new { e.ParId, e.Wartosc }, "idx_TowWartParIdWart"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Par) .WithMany(p => p.TowWartoscs) .HasForeignKey(d => d.ParId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWWARTO_REF_PARTO_PARAMETR"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowWartoscs) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWWARTO_REF_TOWWA_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TowId) .HasName("PK_TOWAR"); entity.ToTable("Towar"); entity.HasIndex(e => e.ArtId, "idx_TowArtId"); entity.HasIndex(e => e.AsId, "idx_TowAsId"); entity.HasIndex(e => e.Cku, "idx_TowCKU"); entity.HasIndex(e => e.Jmid, "idx_TowJMId"); entity.HasIndex(e => e.KatId, "idx_TowKatId"); entity.HasIndex(e => e.Kod, "idx_TowKod"); entity.HasIndex(e => e.KodZgrzewki, "idx_TowKodZgrzewki"); entity.HasIndex(e => e.Producent, "idx_TowProducent"); entity.HasIndex(e => e.Skrot, "idx_TowSkrot"); entity.HasIndex(e => e.Zmiana, "idx_TowZmiana"); entity.Property(e => e.TowId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.ArtId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaEw).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CentrTowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cku) .IsRequired() .HasMaxLength(20) .IsUnicode(false) .HasColumnName("CKU"); entity.Property(e => e.GrupaGtu) .HasMaxLength(3) .IsUnicode(false) .HasColumnName("GrupaGTU"); entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); entity.Property(e => e.IleWcalosci) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWCalosci"); entity.Property(e => e.IleWzgrzewce) .HasColumnType("decimal(15, 4)") .HasColumnName("IleWZgrzewce"); entity.Property(e => e.Indeks1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Indeks2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Jmid) .HasColumnType("numeric(9, 0)") .HasColumnName("JMId"); entity.Property(e => e.KatId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KodCn) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("KodCN"); entity.Property(e => e.KodZgrzewki) .IsRequired() .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.KrajIdPochodzenia).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); entity.Property(e => e.MaxCenaZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.MinCenaSp).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); entity.Property(e => e.NowoscOd).HasColumnType("datetime"); entity.Property(e => e.Opis1) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis2) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis3) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Opis4) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.PrefPlu).HasColumnName("PrefPLU"); entity.Property(e => e.Producent).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); entity.Property(e => e.PrzeliczJm) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("PrzeliczJM"); entity.Property(e => e.Rezerwa1) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Rezerwa2) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.SubsysKoduGlownego) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); entity.Property(e => e.ZmianaTylkoCen).HasColumnType("datetime"); entity.HasOne(d => d.Art) .WithMany(p => p.Towars) .HasForeignKey(d => d.ArtId) .HasConstraintName("FK_TOWAR_REF_TOWAR_ARTYKUL"); entity.HasOne(d => d.As) .WithMany(p => p.Towars) .HasForeignKey(d => d.AsId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWAR_REF_TOWAS_ASORT"); entity.HasOne(d => d.Jm) .WithMany(p => p.Towars) .HasForeignKey(d => d.Jmid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWAR_REF_TOWJM_JM"); entity.HasOne(d => d.Kat) .WithMany(p => p.Towars) .HasForeignKey(d => d.KatId) .HasConstraintName("FK_TOWAR_REF_TOWKA_KATEGORI"); entity.HasOne(d => d.KrajIdPochodzeniaNavigation) .WithMany(p => p.Towars) .HasForeignKey(d => d.KrajIdPochodzenia) .HasConstraintName("FK_Ref_TowarKrajPochodzenia"); entity.HasOne(d => d.ProducentNavigation) .WithMany(p => p.Towars) .HasForeignKey(d => d.Producent) .HasConstraintName("FK_TOWAR_REF_PRODU_KONTRAHE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.SkWzId, e.TowId }) .HasName("PK_TOWARSKLADNIKA"); entity.ToTable("TowarSkladnika"); entity.HasIndex(e => e.SkWzId, "idx_TowarSkladniaka"); entity.Property(e => e.SkWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); entity.Property(e => e.CenaZkartyTow).HasColumnName("CenaZKartyTow"); entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); entity.HasOne(d => d.SkWz) .WithMany(p => p.TowarSkladnikas) .HasForeignKey(d => d.SkWzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA"); entity.HasOne(d => d.Tow) .WithMany(p => p.TowarSkladnikas) .HasForeignKey(d => d.TowId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_TOWARSKLADNIKA_REFERENCE_TOWAR"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TypOsId) .HasName("PK_TYPOS"); entity.HasIndex(e => e.Zmiana, "idx_TYPOS_ZMIANA"); entity.Property(e => e.TypOsId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrTypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.UzId, e.Rodzaj }) .HasName("PK_UPRAWNIENIE"); entity.ToTable("Uprawnienie"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Uz) .WithMany(p => p.Uprawnienies) .HasForeignKey(d => d.UzId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_UPRAWNIE_REF_UZUPR_UZYTKOWN"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.UzNsid, e.Rodzaj }) .HasName("PK_UPRAWNIENIENASKLEP"); entity.ToTable("UprawnienieNaSklep"); entity.Property(e => e.UzNsid) .HasColumnType("numeric(9, 0)") .HasColumnName("UzNSId"); entity.HasOne(d => d.UzNs) .WithMany(p => p.UprawnienieNaSkleps) .HasForeignKey(d => d.UzNsid) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("Ref_UprNaSklepUzNaSklep"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.UzNsid) .HasName("PK_UZNASKLEP"); entity.ToTable("UzNaSklep"); entity.HasIndex(e => e.Identyfikator, "idx_UzNaSklelp_Ident"); entity.HasIndex(e => new { e.SklepId, e.SklepUzId }, "idx_UzNaSklelp_SIdSUzId"); entity.Property(e => e.UzNsid) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd() .HasColumnName("UzNSId"); entity.Property(e => e.Haslo) .IsRequired() .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.HasloPrepaid) .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.IdentPrePaid) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Identyfikator) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Jezyk) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KodKasjera) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Nazwisko) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WymusZmianeHasla).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Sklep) .WithMany(p => p.UzNaSkleps) .HasForeignKey(d => d.SklepId) .HasConstraintName("Ref_UzNaSklepSklep"); entity.HasOne(d => d.SklepNavigation) .WithMany(p => p.UzNaSkleps) .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) .HasConstraintName("Ref_UzNaSklepSklepUz"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.UzId) .HasName("PK_UZYTKOWNIK"); entity.ToTable("Uzytkownik"); entity.HasIndex(e => e.CentrUzId, "idx_CentrUzId"); entity.Property(e => e.UzId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrUzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.CentrUzNsid) .HasColumnType("numeric(9, 0)") .HasColumnName("CentrUzNSId"); entity.Property(e => e.Haslo) .IsRequired() .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.HasloPrepaid) .HasMaxLength(100) .IsUnicode(false); entity.Property(e => e.IdentPrepaid) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Identyfikator) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Jezyk) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.KodKasjera) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Nazwisko) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.OstZmianaHasla).HasColumnType("datetime"); entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.WymusZmianeHasla).HasColumnType("datetime"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Profil) .WithMany(p => p.Uzytkowniks) .HasForeignKey(d => d.ProfilId) .HasConstraintName("FK_UZYTKOWINK_REFERENCE_PROFIL"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Stawka) .HasName("PK_VAT"); entity.ToTable("Vat"); entity.Property(e => e.Stawka).ValueGeneratedNever(); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.WalId) .HasName("PK_WALUTA"); entity.HasIndex(e => e.CentrWalId, "idx_CentrWalId"); entity.Property(e => e.WalId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrWalId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kod) .IsRequired() .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); entity.Property(e => e.KursZak).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Skrot1) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Skrot100) .HasMaxLength(10) .IsUnicode(false); entity.Property(e => e.Spread).HasColumnType("decimal(15, 4)"); entity.Property(e => e.SpreadZak).HasColumnType("decimal(15, 4)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Upgrade) .HasName("PK_WERSJA_7_2"); entity.ToTable("Wersja_7_2"); entity.Property(e => e.Upgrade).ValueGeneratedNever(); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.WzId) .HasName("PK_WZORZEC"); entity.ToTable("Wzorzec"); entity.HasIndex(e => e.CentrWzId, "idx_CentrWzId"); entity.Property(e => e.WzId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrWzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Opis) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Param1).HasColumnType("decimal(10, 4)"); entity.Property(e => e.Param2).HasColumnType("decimal(10, 4)"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DokId) .HasName("PK_ZALEZNOSC"); entity.ToTable("Zaleznosc"); entity.HasIndex(e => e.PoprzedniDokId, "idx_PoprzedniDokId"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.PoprzedniDokId).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Dok) .WithOne(p => p.ZaleznoscDok) .HasForeignKey(d => d.DokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZALEZNOS_REF_ODDOK_DOK"); entity.HasOne(d => d.PoprzedniDok) .WithMany(p => p.ZaleznoscPoprzedniDoks) .HasForeignKey(d => d.PoprzedniDokId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZALEZNOS_REF_DODOK_DOK"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Tabela, e.Id, e.Typ }) .HasName("PK_ZASOB"); entity.ToTable("Zasob"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Typ) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.Sciezka) .IsRequired() .HasMaxLength(255) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.ToTable("ZdarzLoj"); entity.HasIndex(e => e.Cecha, "IxZdarzLoj_Cecha"); entity.HasIndex(e => e.DataCzas, "IxZdarzLoj_DataCzas"); entity.HasIndex(e => e.KodKarty, "IxZdarzLoj_KodKarty"); entity.HasIndex(e => e.KontoId, "IxZdarzLoj_KontoId"); entity.Property(e => e.ZdarzLojId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Cecha) .HasMaxLength(64) .IsUnicode(false); entity.Property(e => e.DataCzas).HasColumnType("datetime"); entity.Property(e => e.DataCzasZapisu).HasColumnType("datetime"); entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KartaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.KodKarty) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); entity.Property(e => e.Opis) .HasMaxLength(64) .IsUnicode(false); entity.Property(e => e.PosNo) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ShopNo) .HasMaxLength(32) .IsUnicode(false); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.StanPo).HasColumnType("decimal(15, 4)"); entity.Property(e => e.StanPrzed).HasColumnType("decimal(15, 4)"); entity.Property(e => e.TransUuid) .HasMaxLength(64) .IsUnicode(false) .HasColumnName("TransUUID"); entity.HasOne(d => d.Karta) .WithMany(p => p.ZdarzLojs) .HasForeignKey(d => d.KartaId) .HasConstraintName("Ref_ZdarzKarta"); entity.HasOne(d => d.Konto) .WithMany(p => p.ZdarzLojs) .HasForeignKey(d => d.KontoId) .HasConstraintName("Ref_ZdarzKonto"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Kiedy }) .HasName("PK_ZDARZOS"); entity.HasIndex(e => new { e.UzId, e.Kiedy }, "idx_ZDOSUZKIEDY"); entity.HasIndex(e => new { e.KontrId, e.ZgId, e.DataDec }, "idx_ZDOS_OSTDEC"); entity.HasIndex(e => new { e.KontrId, e.ZgId, e.Kiedy }, "idx_ZDOS_OSTZGODA"); entity.HasIndex(e => e.TypOsId, "idx_ZDOS_TPOS"); entity.HasIndex(e => e.ZgId, "idx_ZDOS_ZG"); entity.HasIndex(e => e.Zmiana, "idx_ZDOS_ZMIANA"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.DataDec).HasColumnType("datetime"); entity.Property(e => e.DodPar) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kontr) .WithMany(p => p.ZdarzOs) .HasForeignKey(d => d.KontrId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZDOS_KTH"); entity.HasOne(d => d.TypOs) .WithMany(p => p.ZdarzOs) .HasForeignKey(d => d.TypOsId) .HasConstraintName("FK_ZDOS_TPOS"); entity.HasOne(d => d.Uz) .WithMany(p => p.ZdarzOs) .HasForeignKey(d => d.UzId) .HasConstraintName("FK_ZDOSUZ"); entity.HasOne(d => d.Zg) .WithMany(p => p.ZdarzOs) .HasForeignKey(d => d.ZgId) .HasConstraintName("FK_ZDOS_ZG"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KontrId, e.Kiedy, e.Znaczenie }) .HasName("PK_ZDARZOSOPIS"); entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Kiedy) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.K) .WithMany(p => p.ZdarzOsOpis) .HasForeignKey(d => new { d.KontrId, d.Kiedy }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZDOSOPIS"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ZgId) .HasName("PK_ZGODA"); entity.HasIndex(e => e.Zmiana, "idx_ZG_ZMIANA"); entity.Property(e => e.ZgId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.CentrZgId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.DaneOs) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Komentarz) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Nazwa) .IsRequired() .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.Wersja) .HasMaxLength(20) .IsUnicode(false); entity.Property(e => e.Zastosowania) .HasMaxLength(120) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.ZlecId, e.Kolejnosc }) .HasName("PK_ZLECKOMUNIKAT"); entity.ToTable("ZlecKomunikat"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Zlecenie) .WithMany(p => p.ZlecKomunikats) .HasForeignKey(d => new { d.KasaId, d.ZlecId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZLECKOMU_REF_ZLECK_ZLECENIE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.ZlecId, e.ParNazwa }) .HasName("PK_ZLECPARAM"); entity.ToTable("ZlecParam"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ParNazwa) .HasMaxLength(40) .IsUnicode(false); entity.Property(e => e.ParWartosc) .IsRequired() .HasMaxLength(255) .IsUnicode(false); entity.HasOne(d => d.Zlecenie) .WithMany(p => p.ZlecParams) .HasForeignKey(d => new { d.KasaId, d.ZlecId }) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZLECPARA_REF_ZLECP_ZLECENIE"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.KasaId, e.ZlecId }) .HasName("PK_ZLECENIE"); entity.ToTable("Zlecenie"); entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.NazwaDod) .HasMaxLength(60) .IsUnicode(false); entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Utworzono).HasColumnType("datetime"); entity.Property(e => e.Wstrzymanie) .HasMaxLength(255) .IsUnicode(false); entity.Property(e => e.Zmiana).HasColumnType("datetime"); entity.HasOne(d => d.Kasa) .WithMany(p => p.Zlecenies) .HasForeignKey(d => d.KasaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZLECENIE_REF_ZLECK_KASA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ZmId) .HasName("PK_ZMIANA"); entity.ToTable("Zmiana"); entity.HasIndex(e => new { e.SklepId, e.TabId, e.Czas }, "idx_ZmSkTabIdCzas"); entity.HasIndex(e => new { e.TabId, e.Czas }, "idx_ZmTabIdCzas"); entity.HasIndex(e => e.SesjaId, "idx_ZmianaSesjaId"); entity.Property(e => e.ZmId) .HasColumnType("numeric(9, 0)") .ValueGeneratedOnAdd(); entity.Property(e => e.Czas).HasColumnType("datetime"); entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.TabId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Tekst) .IsRequired() .HasMaxLength(40) .IsUnicode(false); entity.HasOne(d => d.Sesja) .WithMany(p => p.Zmianas) .HasForeignKey(d => d.SesjaId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZMIANA_REF_SESJA_SESJA"); }); modelBuilder.Entity(entity => { entity.HasKey(e => new { e.ZmId, e.Id }) .HasName("PK_ZMIANATABELI"); entity.ToTable("ZmianaTabeli"); entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); entity.HasOne(d => d.Zm) .WithMany(p => p.ZmianaTabelis) .HasForeignKey(d => d.ZmId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_ZMIANATA_REF_ZMTAB_ZMIANA"); }); } }