From 860f111cde808252e442a31c734a554632d918b9 Mon Sep 17 00:00:00 2001 From: "Tizian.Breuch" Date: Tue, 12 Aug 2025 11:53:49 +0200 Subject: [PATCH] migration --- ...0250812095336_discountAndInfo.Designer.cs} | 69 ++++++++++++++++++- ...s.cs => 20250812095336_discountAndInfo.cs} | 29 +++++++- .../ApplicationDbContextModelSnapshot.cs | 65 +++++++++++++++++ 3 files changed, 160 insertions(+), 3 deletions(-) rename Webshop.Infrastructure/Migrations/{20250806081749_images.Designer.cs => 20250812095336_discountAndInfo.Designer.cs} (94%) rename Webshop.Infrastructure/Migrations/{20250806081749_images.cs => 20250812095336_discountAndInfo.cs} (95%) diff --git a/Webshop.Infrastructure/Migrations/20250806081749_images.Designer.cs b/Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.Designer.cs similarity index 94% rename from Webshop.Infrastructure/Migrations/20250806081749_images.Designer.cs rename to Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.Designer.cs index 8e805d6..80a8890 100644 --- a/Webshop.Infrastructure/Migrations/20250806081749_images.Designer.cs +++ b/Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.Designer.cs @@ -12,8 +12,8 @@ using Webshop.Infrastructure.Data; namespace Webshop.Infrastructure.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250806081749_images")] - partial class images + [Migration("20250812095336_discountAndInfo")] + partial class discountAndInfo { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -861,6 +861,71 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("ShippingMethods"); }); + modelBuilder.Entity("Webshop.Domain.Entities.ShopInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CompanyRegistrationNumber") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ContactEmail") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("FacebookUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("InstagramUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("ShopName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Slogan") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Street") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("TwitterUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("VatNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.ToTable("ShopInfos"); + }); + modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b => { b.Property("Id") diff --git a/Webshop.Infrastructure/Migrations/20250806081749_images.cs b/Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.cs similarity index 95% rename from Webshop.Infrastructure/Migrations/20250806081749_images.cs rename to Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.cs index b2dde71..1daeb28 100644 --- a/Webshop.Infrastructure/Migrations/20250806081749_images.cs +++ b/Webshop.Infrastructure/Migrations/20250812095336_discountAndInfo.cs @@ -7,7 +7,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Webshop.Infrastructure.Migrations { /// - public partial class images : Migration + public partial class discountAndInfo : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -126,6 +126,30 @@ namespace Webshop.Infrastructure.Migrations table.PrimaryKey("PK_ShippingMethods", x => x.Id); }); + migrationBuilder.CreateTable( + name: "ShopInfos", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ShopName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Slogan = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + ContactEmail = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + PhoneNumber = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Street = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + City = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + PostalCode = table.Column(type: "character varying(20)", maxLength: 20, nullable: true), + Country = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + VatNumber = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + CompanyRegistrationNumber = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + FacebookUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + InstagramUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + TwitterUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ShopInfos", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Users", columns: table => new @@ -811,6 +835,9 @@ namespace Webshop.Infrastructure.Migrations migrationBuilder.DropTable( name: "Settings"); + migrationBuilder.DropTable( + name: "ShopInfos"); + migrationBuilder.DropTable( name: "UserClaims"); diff --git a/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs b/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs index 77427a7..0392333 100644 --- a/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs @@ -858,6 +858,71 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("ShippingMethods"); }); + modelBuilder.Entity("Webshop.Domain.Entities.ShopInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CompanyRegistrationNumber") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ContactEmail") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("FacebookUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("InstagramUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("ShopName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Slogan") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Street") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("TwitterUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("VatNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.ToTable("ShopInfos"); + }); + modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b => { b.Property("Id")