From e80e6ef7d41ba4f80fd67067fb1833c95891539f Mon Sep 17 00:00:00 2001 From: maja Date: Wed, 28 Oct 2026 17:25:18 +0100 Subject: [PATCH] Database 1 --- .../Web-Jarmark/Data/ApplicationDbContext.cs | 30 +- .../20261028162308_261028_Uvod.Designer.cs | 542 ++++++++++++++++++ .../Migrations/20261028162308_261028_Uvod.cs | 143 +++++ .../ApplicationDbContextModelSnapshot.cs | 201 +++++++ Web-Jarmark/Web-Jarmark/jarmark.db | Bin 118784 -> 147456 bytes Web-Jarmark/Web-Jarmark/jarmark.db-shm | Bin 32768 -> 0 bytes Web-Jarmark/Web-Jarmark/jarmark.db-wal | Bin 65952 -> 0 bytes 7 files changed, 900 insertions(+), 16 deletions(-) create mode 100644 Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.Designer.cs create mode 100644 Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.cs delete mode 100644 Web-Jarmark/Web-Jarmark/jarmark.db-shm delete mode 100644 Web-Jarmark/Web-Jarmark/jarmark.db-wal diff --git a/Web-Jarmark/Web-Jarmark/Data/ApplicationDbContext.cs b/Web-Jarmark/Web-Jarmark/Data/ApplicationDbContext.cs index be1a1e6..e2532a8 100644 --- a/Web-Jarmark/Web-Jarmark/Data/ApplicationDbContext.cs +++ b/Web-Jarmark/Web-Jarmark/Data/ApplicationDbContext.cs @@ -7,21 +7,19 @@ namespace Web_Jarmark.Data { public class ApplicationDbContext(DbContextOptions options) : IdentityDbContext(options) { + public DbSet Categories { get; set; } + public DbSet Products { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + // Nastavení vazby 1:N mezi Category a Product + modelBuilder.Entity() + .HasMany(c => c.Products) // Jedna kategorie obsahuje mnoho produktů + .WithOne(p => p.Category) // Každý produkt patří ke jedné kategorii + .HasForeignKey(p => p.CategoryId); // Cizí klíč v tabulce Product + } } + } -public class ApplicationDbContext(DbContextOptions options) : IdentityDbContext(options) -{ - public DbSet Categories { get; set; } - public DbSet Products { get; set; } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - // Nastavení vazby 1:N mezi Category a Product - modelBuilder.Entity() - .HasMany(c => c.Products) // Jedna kategorie obsahuje mnoho produktů - .WithOne(p => p.Category) // Každý produkt patří ke jedné kategorii - .HasForeignKey(p => p.CategoryId); // Cizí klíč v tabulce Product - } -} \ No newline at end of file diff --git a/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.Designer.cs b/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.Designer.cs new file mode 100644 index 0000000..2f65981 --- /dev/null +++ b/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.Designer.cs @@ -0,0 +1,542 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Web_Jarmark.Data; + +#nullable disable + +namespace Web_Jarmark.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20261028162308_261028_Uvod")] + partial class _261028_Uvod + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.13"); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderKey") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderDisplayName") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey", b => + { + b.Property("CredentialId") + .HasMaxLength(1024) + .HasColumnType("BLOB"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("CredentialId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserPasskeys", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Web_Jarmark.Data.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessFailedCount") + .HasColumnType("INTEGER"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("EmailConfirmed") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnabled") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnd") + .HasColumnType("TEXT"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("PhoneNumber") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("INTEGER"); + + b.Property("SecurityStamp") + .HasColumnType("TEXT"); + + b.Property("TwoFactorEnabled") + .HasColumnType("INTEGER"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CancelledAt") + .HasColumnType("TEXT"); + + b.Property("Code") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("CustomerName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ExpiresAt") + .HasColumnType("TEXT"); + + b.Property("IssuedAt") + .HasColumnType("TEXT"); + + b.Property("IssuedByUserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Note") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PaidAt") + .HasColumnType("TEXT"); + + b.Property("PaymentReference") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PreferredPayment") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("TotalAmount") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Order"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("OrderId") + .HasColumnType("INTEGER"); + + b.Property("ProductId") + .HasColumnType("INTEGER"); + + b.Property("ProductName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Quantity") + .HasColumnType("INTEGER"); + + b.Property("UnitPrice") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("OrderItem"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CategoryId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageUrl") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IsVisible") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("TEXT"); + + b.Property("StockQuantity") + .HasColumnType("INTEGER"); + + b.Property("UpdatedAt") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Products"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Web_Jarmark.Data.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Web_Jarmark.Data.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserPasskey", b => + { + b.HasOne("Web_Jarmark.Data.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 => + { + b1.Property("IdentityUserPasskeyCredentialId"); + + b1.Property("AttestationObject") + .IsRequired(); + + b1.Property("ClientDataJson") + .IsRequired(); + + b1.Property("CreatedAt"); + + b1.Property("IsBackedUp"); + + b1.Property("IsBackupEligible"); + + b1.Property("IsUserVerified"); + + b1.Property("Name"); + + b1.Property("PublicKey") + .IsRequired(); + + b1.Property("SignCount"); + + b1.PrimitiveCollection("Transports"); + + b1.HasKey("IdentityUserPasskeyCredentialId"); + + b1.ToTable("AspNetUserPasskeys"); + + b1 + .ToJson("Data") + .HasColumnType("TEXT"); + + b1.WithOwner() + .HasForeignKey("IdentityUserPasskeyCredentialId"); + }); + + b.Navigation("Data") + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Web_Jarmark.Data.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Web_Jarmark.Data.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.OrderItem", b => + { + b.HasOne("Web_Jarmark.Data.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Web_Jarmark.Data.Models.Product", "Product") + .WithMany("OrderItems") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.HasOne("Web_Jarmark.Data.Models.Category", "Category") + .WithMany("Products") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Category", b => + { + b.Navigation("Products"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Order", b => + { + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.Navigation("OrderItems"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.cs b/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.cs new file mode 100644 index 0000000..9441d65 --- /dev/null +++ b/Web-Jarmark/Web-Jarmark/Migrations/20261028162308_261028_Uvod.cs @@ -0,0 +1,143 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Web_Jarmark.Migrations +{ + /// + public partial class _261028_Uvod : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Categories", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false), + Slug = table.Column(type: "TEXT", nullable: false), + IsActive = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Categories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Order", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Code = table.Column(type: "TEXT", nullable: false), + Status = table.Column(type: "INTEGER", nullable: false), + CustomerName = table.Column(type: "TEXT", nullable: false), + Email = table.Column(type: "TEXT", nullable: false), + Phone = table.Column(type: "TEXT", nullable: false), + Note = table.Column(type: "TEXT", nullable: false), + PreferredPayment = table.Column(type: "INTEGER", nullable: false), + PaymentReference = table.Column(type: "TEXT", nullable: false), + TotalAmount = table.Column(type: "TEXT", nullable: false), + CreatedAt = table.Column(type: "TEXT", nullable: false), + ExpiresAt = table.Column(type: "TEXT", nullable: true), + PaidAt = table.Column(type: "TEXT", nullable: true), + IssuedAt = table.Column(type: "TEXT", nullable: true), + IssuedByUserId = table.Column(type: "TEXT", nullable: false), + CancelledAt = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Order", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Products", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + CategoryId = table.Column(type: "INTEGER", nullable: false), + Name = table.Column(type: "TEXT", nullable: false), + Description = table.Column(type: "TEXT", nullable: false), + Price = table.Column(type: "TEXT", nullable: false), + StockQuantity = table.Column(type: "INTEGER", nullable: false), + ImageUrl = table.Column(type: "TEXT", nullable: false), + IsVisible = table.Column(type: "INTEGER", nullable: false), + UpdatedAt = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Products", x => x.Id); + table.ForeignKey( + name: "FK_Products_Categories_CategoryId", + column: x => x.CategoryId, + principalTable: "Categories", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OrderItem", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + OrderId = table.Column(type: "INTEGER", nullable: false), + ProductId = table.Column(type: "INTEGER", nullable: false), + ProductName = table.Column(type: "TEXT", nullable: false), + UnitPrice = table.Column(type: "TEXT", nullable: false), + Quantity = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_OrderItem", x => x.Id); + table.ForeignKey( + name: "FK_OrderItem_Order_OrderId", + column: x => x.OrderId, + principalTable: "Order", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_OrderItem_Products_ProductId", + column: x => x.ProductId, + principalTable: "Products", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_OrderItem_OrderId", + table: "OrderItem", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_OrderItem_ProductId", + table: "OrderItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Products_CategoryId", + table: "Products", + column: "CategoryId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "OrderItem"); + + migrationBuilder.DropTable( + name: "Order"); + + migrationBuilder.DropTable( + name: "Products"); + + migrationBuilder.DropTable( + name: "Categories"); + } + } +} diff --git a/Web-Jarmark/Web-Jarmark/Migrations/ApplicationDbContextModelSnapshot.cs b/Web-Jarmark/Web-Jarmark/Migrations/ApplicationDbContextModelSnapshot.cs index 2c740af..173169a 100644 --- a/Web-Jarmark/Web-Jarmark/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Web-Jarmark/Web-Jarmark/Migrations/ApplicationDbContextModelSnapshot.cs @@ -231,6 +231,162 @@ namespace Web_Jarmark.Migrations b.ToTable("AspNetUsers", (string)null); }); + modelBuilder.Entity("Web_Jarmark.Data.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CancelledAt") + .HasColumnType("TEXT"); + + b.Property("Code") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("CustomerName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ExpiresAt") + .HasColumnType("TEXT"); + + b.Property("IssuedAt") + .HasColumnType("TEXT"); + + b.Property("IssuedByUserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Note") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PaidAt") + .HasColumnType("TEXT"); + + b.Property("PaymentReference") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PreferredPayment") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("TotalAmount") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Order"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("OrderId") + .HasColumnType("INTEGER"); + + b.Property("ProductId") + .HasColumnType("INTEGER"); + + b.Property("ProductName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Quantity") + .HasColumnType("INTEGER"); + + b.Property("UnitPrice") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("OrderItem"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CategoryId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageUrl") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IsVisible") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("TEXT"); + + b.Property("StockQuantity") + .HasColumnType("INTEGER"); + + b.Property("UpdatedAt") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Products"); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) @@ -332,6 +488,51 @@ namespace Web_Jarmark.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.OrderItem", b => + { + b.HasOne("Web_Jarmark.Data.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Web_Jarmark.Data.Models.Product", "Product") + .WithMany("OrderItems") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.HasOne("Web_Jarmark.Data.Models.Category", "Category") + .WithMany("Products") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Category", b => + { + b.Navigation("Products"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Order", b => + { + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("Web_Jarmark.Data.Models.Product", b => + { + b.Navigation("OrderItems"); + }); #pragma warning restore 612, 618 } } diff --git a/Web-Jarmark/Web-Jarmark/jarmark.db b/Web-Jarmark/Web-Jarmark/jarmark.db index 12d37e15a589c70b6afd126b2daf1835a1962124..c785128e43ac948d476d0dc1f7011640a53a2278 100644 GIT binary patch delta 2645 zcmb_eU2NM_6!uM;#%Y^5fuYcKUEQpVjV-O?+DST5t&ZcgZqhV=Zqp*vIkD4)Hc4kY zZBrq&W0QbAprTCb6B;TABwjXFV2|575)&_jmkntMAtWROJh1Ts*ZFHVHrNA4{<-&_ zbMCq4yWhF?#{1@t4a;Vi-H0GaAG{mV`R<89VEpv-Wei}~Y(HWzkUre)IZ09{NpC+z zkUrAwIZhBK3Bn3p4A@l!yNzAlvD-exj`SIfOczOz9yhded&oh;H&^S-3Cl&vP4pA} z?!n6KfqvA0-9WIr*bV5ogY_ITGT_O6hMl{oj^L=ldLO}1>wW0*vvvIqtHCa~pjgh) z69R&why`^^GF%<$a}iXAa8X0#kZXt(Vb_zEvZ6R7W+^f+DhnlbBwfmr)E zkRF;1P}2-ed$XC0OnF=+k0(PMn3c8Dk*CR_L zoW>=l(_R;q&G=ktA}zZ-q9jXnnjRX;dgW|k1l|w}E*KesH$>raWA)5yiNpLEj*FLz zVb6dvD$Wb!LU`%yQfOJ#)~MOY*dUpon(~R`YiE4kRf?KlkygUO1V2y?g;-Wi(y2m8 zn_`BCC;VR8>!cTa}4d5bO%}Eo8?BSp29_08hgP!;412@-!e>cR=*7p6%1N?bF1yXbaH_ zuuBMb2}Zk!t-l6L!hmbyX#&2&s7n!96I5AAXhlVSl__aw;=)WcsOJi>&k=YvWaofw8(SaO*I@Zy)?mdb1Ow+0?B#v? z_WjiHhxMDbSjSEDEA;i&2d1FOWPHz<0_TmLzzFo?qbik7+pUTbY+S!M4wg;VA9w(2 zakX7Uo=5q zj-hUF&Ymks@+zO2iz-E_l+n~VR@CJAqEhCi#!w#{=a?ji^N|3T!kv#dcH)x}+}Ut( z;zymk6FHAvh#xdN91ifdQ4`aP@?^In$;zbu=&4VhWc*E@Y~f?a87hE;9LI2^zsEEUY3!EF`AdOL419IYm|(&50+uR1%K} z;qVD-8xF-86?4$+F$!K)OZp5?RQbzW_DOJX3ZeyQv_yRAbHW4No(fwVNcl^ILl7R!UKmc(LdUQe-`SDB2KTb7-0bCcXC7sn%$wbWqb z>ze`ar>ObLj9tSkqMPTGv?9ROqy+Q;3(G z$IkSa9W;z*sgZO&HP^JPw|2uh|0P__OL|POhUVCX-a}?bPY-y@UL&YZO+B$@z+N`~ zT(t`J5>>aTV%#*VK*H9k8#C{(Omv{;dP0?YzrEgXFxMg!a#~c$)kuiON+LX^v@)b= zXXR82_EK}|TFQ;Yop^9E&heuW9G+MZHfUC1&}VD0w{C_25!&@^l;vLFA9mk^Iv(eO zT%3!rT%uXfTTB=n@?6;0ZFY2bgEwKJz$$Lc+IZs+)37nD1JncoQV^{ZvfMzV%E|VC ztY(zll9nqLbZVNKkXYdXo>|y~%K?TiY)rN8nw-cWL delta 275 zcmZo@;A~jHK0#WLiGhJZ7KmX$XrhiWBh$u&`TUGrn*^ToD;t_97@Aobnpl~d>KU0C z8ygv#Y8x0>85r;awJ`EuW8lBGSdTfmR_Zax^0r^+>H{Y{YQ&`O60K^Rw zHnTYVmFML*Vc=r>$-r;J$H(__V$sCO3IZvcnHj~HSolqtA58c6Vzk~I!JNU!#&5!8 z8E!Z|(2G%NdV?{e>}FQhZ(O=QKD=C-AX^1kCNS{%^6~I2;fd$!;_~KL#gWPWl)aqo zGh06EW7ZT_CYA}C1qCu#wohJDJ^m2iX2<6lK&iYZ0AJj>F8G*V+AazJ4fP?j9#kw~OBVefcqde(P^p zpRK;5?E6`XpWnYjGiOESAhX>6ukY$wH*0#8`kV>^1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RlS{IL#L`FXDP<{g0<{EgEqit>d|no8;@YMO;St#;n*Z za1v*m3#<|#K!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfWW~CTpiqr9EiZa1ls%B P$UX!J5FkL{-wAvHsaY!2 diff --git a/Web-Jarmark/Web-Jarmark/jarmark.db-wal b/Web-Jarmark/Web-Jarmark/jarmark.db-wal deleted file mode 100644 index 56574853dc684b5d93d8cdc79ea932043576d44c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65952 zcmeI*Z)h8J9LMpbMVAapHWd_9-26LmwyqWS97!{6$5t&h9Ik|%%2cmdca;|t$y~2kcg4p4X^Rsh{%6P6nC{K=#>gK@WgdRGeD7zQzg^ZC+b=T7A zSZubSj!jkPMk75v*=R@&Mb%XQxExbsB_kG##*4*#DW6Ov)O^2cTZ(MzrY%);+b=1y zUzg0Vc#-{%W13|>5YmI!d2|Uwjcw4D!h-p1ipW13&VDg)nKiF&^{BET#aLwhr)@BpubP+%R0R#|0 z009ILKmY**5J2D#0$rWky?@@@AP#)AzOL2nHUfskDYAbsNvRVS_L ztmvxGMn=*`zBg)Qqefoz);HUKTc3R-nvW%F*2H{nZ)Lx&<|~0W^xzJU= zU!cQx%H=yn!oa%w@-ra>5I_I{1Q0*~0R#|00D*QD*wJaYTPfdk+-<(VgFo+F-f{K( z$(6dmWsxu7yWFl=oHqgpAbI&SMDXvi0M?Zl4Y z(z{1*J&&M6lmw^?Z0JuAlScpn1Q0*~0R#|0009ILXlH@e>H-b<0^7bnc>SXn&+Q~% zpq(!~=Z*jZ2q1s}0tg_000Ia!7x*Jzz`LYo4VTB`@_JgiLA_aiK(qb-N4`Ks(M(eh znUdcQ$Rc0BUzSWwytVbRYU@tG3I^m2oG;MuoWd>dU3`3-_wDoa5j6h}aRdSgAbP~O0O1ozcH z$DZRW&nbN6#KaqqP0Bs>x`5mFx=Sn!1Q0*~0R#|0009ILKmY**5cm%TUUJ`KbW7P* z;vSxl%ueT=Ib+tD$J|T