using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace gehGassi.Persistence.Migrations { public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AdvertisementCategories", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), OnlineStatus = table.Column(type: "int", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AdvertisementCategories", x => x.Id); }); migrationBuilder.CreateTable( name: "AppUsers", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Type = table.Column(type: "int", nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Title = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), FirstName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), LastName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), Sex = table.Column(type: "int", nullable: false), BirthDate = table.Column(type: "datetimeoffset", nullable: true), Photo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Contact_Email = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), Contact_Phone = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Contact_Mobile = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Address_State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), SocialMedia_Twitter = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Facebook = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_LinkedIn = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Xing = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Instagram = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Pinterest = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Blog = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_YouTube = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Vimeo = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_SnapChat = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_TikTok = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Reddit = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), SocialMedia_Show = table.Column(type: "bit", nullable: true), Comment = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), Locked = table.Column(type: "bit", nullable: false), LockedReason = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), LockedUntil = table.Column(type: "datetimeoffset", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AppUsers", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new { Id = table.Column(type: "nvarchar(450)", nullable: false), Permissions = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoles", x => x.Id); }); migrationBuilder.CreateTable( name: "Audits", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Key = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Table = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Action = table.Column(type: "int", nullable: false), DateTime = table.Column(type: "datetimeoffset", nullable: false), KeyValues = table.Column(type: "nvarchar(max)", nullable: true), OldValues = table.Column(type: "nvarchar(max)", nullable: true), NewValues = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Audits", x => x.Id); }); migrationBuilder.CreateTable( name: "Branches", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), OnlineStatus = table.Column(type: "int", nullable: false), ListingAllowed = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Branches", x => x.Id); }); migrationBuilder.CreateTable( name: "Conversations", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), SenderId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), SenderType = table.Column(type: "int", nullable: false), ReceiverId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ReceiverType = table.Column(type: "int", nullable: false), LastMessage = table.Column(type: "datetimeoffset", nullable: true), MessageCount = table.Column(type: "int", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Conversations", x => x.Id); }); migrationBuilder.CreateTable( name: "CustomerTypes", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CustomerTypes", x => x.Id); }); migrationBuilder.CreateTable( name: "DogRaces", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), AgeLocalized = table.Column(type: "nvarchar(max)", nullable: true), SizeAndWeightLocalized = table.Column(type: "nvarchar(max)", nullable: true), PersonalityLocalized = table.Column(type: "nvarchar(max)", nullable: true), CoexistenceLocalized = table.Column(type: "nvarchar(max)", nullable: true), CareLocalized = table.Column(type: "nvarchar(max)", nullable: true), DecisionLocalized = table.Column(type: "nvarchar(max)", nullable: true), Photo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DogRaces", x => x.Id); }); migrationBuilder.CreateTable( name: "EntityRelations", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), LeftId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), LeftType = table.Column(type: "int", nullable: false), LeftDeleted = table.Column(type: "bit", nullable: false), RightId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), RightType = table.Column(type: "int", nullable: false), RightDeleted = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EntityRelations", x => x.Id); }); migrationBuilder.CreateTable( name: "FidoStoredCredentials", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Username = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), CredentialType = table.Column(type: "int", nullable: false), UserId = table.Column(type: "varbinary(max)", nullable: false), PublicKey = table.Column(type: "varbinary(max)", nullable: false), UserHandle = table.Column(type: "varbinary(max)", nullable: false), SignatureCounter = table.Column(type: "bigint", nullable: false), CredType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), RegDate = table.Column(type: "datetimeoffset", nullable: false), AaGuid = table.Column(type: "uniqueidentifier", nullable: false), DescriptorJson = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_FidoStoredCredentials", x => x.Id); }); migrationBuilder.CreateTable( name: "NewsCategories", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), OnlineStatus = table.Column(type: "int", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_NewsCategories", x => x.Id); }); migrationBuilder.CreateTable( name: "Orders", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: false), OrderSource = table.Column(type: "int", nullable: false), AppUserId = table.Column(type: "nvarchar(max)", nullable: true), AppUserName = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), AppUserCompany = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), CustomerId = table.Column(type: "bigint", nullable: true), CustomerName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Counter = table.Column(type: "bigint", nullable: false), Subtotal = table.Column(type: "decimal(18,2)", nullable: false), SubtotalGross = table.Column(type: "decimal(18,2)", nullable: false), Total = table.Column(type: "decimal(18,2)", nullable: false), TotalGross = table.Column(type: "decimal(18,2)", nullable: false), Shipment = table.Column(type: "decimal(18,2)", nullable: false), ShipmentGross = table.Column(type: "decimal(18,2)", nullable: false), OrderStatus = table.Column(type: "int", nullable: false), PaymentType = table.Column(type: "int", nullable: false), PaymentStatus = table.Column(type: "int", nullable: false), ShipmentType = table.Column(type: "int", nullable: false), ShipmentStatus = table.Column(type: "int", nullable: false), ShipmentDate = table.Column(type: "datetimeoffset", nullable: true), DeliveryAddress_Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_Company = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), DeliveryAddress_Vat = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), DeliveryAddress_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DeliveryAddress_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), DeliveryAddress_State = table.Column(type: "nvarchar(25)", maxLength: 25, nullable: true), DeliveryAddress_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), BillingAddress_Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_Company = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), BillingAddress_Vat = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), BillingAddress_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), BillingAddress_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), BillingAddress_State = table.Column(type: "nvarchar(25)", maxLength: 25, nullable: true), BillingAddress_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), DeliveryAddressIsBilling = table.Column(type: "bit", nullable: false), Comment = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), TaxRatesJson = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false), LastUpdate = table.Column(type: "datetimeoffset", nullable: true), AcceptTermsAndConditionsDate = table.Column(type: "datetimeoffset", nullable: true), AcceptGdprDate = table.Column(type: "datetimeoffset", nullable: true), Deleted = table.Column(type: "bit", nullable: false), PaymentDate = table.Column(type: "datetimeoffset", nullable: true), PayPalOrderId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), KlarnaOrderId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), KlarnaShipmentSentDate = table.Column(type: "datetimeoffset", nullable: true), KlarnaShipmentError = table.Column(type: "bit", nullable: false), PaymentInfo = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Orders", x => x.Id); }); migrationBuilder.CreateTable( name: "PersistedTickets", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Key = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), UserId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), Expires = table.Column(type: "datetimeoffset", nullable: false), Ticket = table.Column(type: "varbinary(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PersistedTickets", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductCategories", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ParentId = table.Column(type: "int", nullable: true), Visibility = table.Column(type: "int", nullable: false), Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), DisplayOrder = table.Column(type: "int", nullable: false), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), Deleted = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductCategories", x => x.Id); }); migrationBuilder.CreateTable( name: "RefreshTokens", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), Token = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), Expires = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RefreshTokens", x => x.Id); }); migrationBuilder.CreateTable( name: "ShipmentCosts", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), WeightFrom = table.Column(type: "decimal(18,2)", nullable: false), WeightTo = table.Column(type: "decimal(18,2)", nullable: false), SubtotalFrom = table.Column(type: "decimal(18,2)", nullable: false), SubtotalTo = table.Column(type: "decimal(18,2)", nullable: false), FixedPrice = table.Column(type: "decimal(18,4)", nullable: false), SubtotalPercent = table.Column(type: "decimal(18,2)", nullable: false), TargetCountryIso = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false) }, constraints: table => { table.PrimaryKey("PK_ShipmentCosts", x => x.Id); }); migrationBuilder.CreateTable( name: "ShopSettings", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), OrderEmail = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false), PaymentOnInvoice = table.Column(type: "bit", nullable: false), PayPalEnabled = table.Column(type: "bit", nullable: false), PayPalClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), PayPalSecret = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), KlarnaEnabled = table.Column(type: "bit", nullable: false), KlarnaClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), KlarnaSecret = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), ShipmentCalculationType = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ShopSettings", x => x.Id); }); migrationBuilder.CreateTable( name: "TaxRates", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CountryIso = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), Value = table.Column(type: "decimal(18,2)", nullable: false), UseForShipment = table.Column(type: "bit", nullable: false), Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_TaxRates", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetRoleClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), RoleId = table.Column(type: "nvarchar(450)", nullable: false), ClaimType = table.Column(type: "nvarchar(max)", nullable: true), ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Messages", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), ConversationId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), SenderId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), SenderType = table.Column(type: "int", nullable: false), ReceiverId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ReceiverType = table.Column(type: "int", nullable: false), Content = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Messages", x => x.Id); table.ForeignKey( name: "FK_Messages_Conversations_ConversationId", column: x => x.ConversationId, principalTable: "Conversations", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Customers", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: true), TypeId = table.Column(type: "bigint", nullable: true), BranchId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), BranchesJson = table.Column(type: "nvarchar(max)", nullable: true), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), IsCompany = table.Column(type: "bit", nullable: false), Vat = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), Title = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Contact_Email = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), Contact_Phone = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Contact_Mobile = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Contact_Fax = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Contact_Web = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), Address_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Address_State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Comment = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), Languages = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Logo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), MarkupListing = table.Column(type: "decimal(18,2)", nullable: false), MarkupAdvertisement = table.Column(type: "decimal(18,2)", nullable: false), MarkupPin = table.Column(type: "decimal(18,2)", nullable: false), MarkupBanner = table.Column(type: "decimal(18,2)", nullable: false), PaymentOnInvoice = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Customers", x => x.Id); table.ForeignKey( name: "FK_Customers_Branches_BranchId", column: x => x.BranchId, principalTable: "Branches", principalColumn: "Id"); table.ForeignKey( name: "FK_Customers_CustomerTypes_TypeId", column: x => x.TypeId, principalTable: "CustomerTypes", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "Dogs", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), DogRaceId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), AppUserId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Description = table.Column(type: "nvarchar(max)", maxLength: 5000, nullable: true), Photo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), BirthDate = table.Column(type: "datetimeoffset", nullable: true), Sex = table.Column(type: "int", nullable: false), Size = table.Column(type: "int", nullable: false), PullsTheLeash = table.Column(type: "bit", nullable: false), WalksTheLeash = table.Column(type: "bit", nullable: false), BasicCommands = table.Column(type: "bit", nullable: false), Hunter = table.Column(type: "bit", nullable: false), Eating = table.Column(type: "bit", nullable: false), Jumper = table.Column(type: "bit", nullable: false), LikesAdults = table.Column(type: "bit", nullable: false), LikesChildren = table.Column(type: "bit", nullable: false), LikesConspecifics = table.Column(type: "bit", nullable: false), IsTrustful = table.Column(type: "bit", nullable: false), IsAggressiv = table.Column(type: "bit", nullable: false), IsLoneGunner = table.Column(type: "bit", nullable: false), AggressionLevel = table.Column(type: "int", nullable: false), RushesOutside = table.Column(type: "bit", nullable: false), IsCalm = table.Column(type: "bit", nullable: false), IsPeeing = table.Column(type: "bit", nullable: false), IsShy = table.Column(type: "bit", nullable: false), IsGuard = table.Column(type: "bit", nullable: false), Intolerances = table.Column(type: "nvarchar(max)", maxLength: 5000, nullable: true), Chiped = table.Column(type: "bit", nullable: false), Sterilized = table.Column(type: "bit", nullable: false), MedicalInfo = table.Column(type: "nvarchar(max)", maxLength: 5000, nullable: true), HouseTrained = table.Column(type: "bit", nullable: false), FeedingTimes = table.Column(type: "int", nullable: false), FeedingIndividual = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Comment = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Dogs", x => x.Id); table.ForeignKey( name: "FK_Dogs_AppUsers_AppUserId", column: x => x.AppUserId, principalTable: "AppUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Dogs_DogRaces_DogRaceId", column: x => x.DogRaceId, principalTable: "DogRaces", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "News", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CategoryId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Status = table.Column(type: "int", nullable: false), Visibility = table.Column(type: "int", nullable: false), Start = table.Column(type: "datetimeoffset", nullable: false), End = table.Column(type: "datetimeoffset", nullable: true), Creator = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), IsExternal = table.Column(type: "bit", nullable: false), Source = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Language = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Headline = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: false), GeoMode = table.Column(type: "int", nullable: false), State = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), Radius = table.Column(type: "float", nullable: false), Deleted = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_News", x => x.Id); table.ForeignKey( name: "FK_News_NewsCategories_CategoryId", column: x => x.CategoryId, principalTable: "NewsCategories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "CreditNotes", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Counter = table.Column(type: "bigint", nullable: false), OrderId = table.Column(type: "bigint", nullable: false), InvoiceNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Reason = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CreditNotes", x => x.Id); table.ForeignKey( name: "FK_CreditNotes_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "DeliveryNotes", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Counter = table.Column(type: "bigint", nullable: false), OrderId = table.Column(type: "bigint", nullable: false), InvoiceNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Reason = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DeliveryNotes", x => x.Id); table.ForeignKey( name: "FK_DeliveryNotes_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Invoices", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UniqueId = table.Column(type: "uniqueidentifier", nullable: false), Number = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Counter = table.Column(type: "bigint", nullable: false), OrderId = table.Column(type: "bigint", nullable: false), Cancelled = table.Column(type: "bit", nullable: false), CancellationDate = table.Column(type: "datetimeoffset", nullable: true), CancellationReason = table.Column(type: "nvarchar(max)", nullable: true), CreditNoteCreated = table.Column(type: "bit", nullable: false), CreditNoteDate = table.Column(type: "datetimeoffset", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Invoices", x => x.Id); table.ForeignKey( name: "FK_Invoices_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Products", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ProductType = table.Column(type: "int", nullable: false), ListingType = table.Column(type: "int", nullable: false), AdvertisementCategoryId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ProductCategoryId = table.Column(type: "int", nullable: true), BranchId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Visibility = table.Column(type: "int", nullable: false), PriceType = table.Column(type: "int", nullable: false), PriceAliquotType = table.Column(type: "int", nullable: false), ProductStartType = table.Column(type: "int", nullable: false), BannerLocation = table.Column(type: "int", nullable: false), BannerSize = table.Column(type: "int", nullable: false), PinRadius = table.Column(type: "float", nullable: false), PinPercentPerKm = table.Column(type: "decimal(18,2)", nullable: false), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), ShortDescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Comment = table.Column(type: "nvarchar(max)", nullable: true), Sku = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), ManufacturerPartNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DownloadId = table.Column(type: "int", nullable: true), IsShipEnabled = table.Column(type: "bit", nullable: false), IsFreeShipping = table.Column(type: "bit", nullable: false), AdditionalShippingCharge = table.Column(type: "decimal(18,4)", nullable: false), IsTaxExempt = table.Column(type: "bit", nullable: false), TaxRateId = table.Column(type: "int", nullable: false), StockQuantity = table.Column(type: "int", nullable: false), DisplayStockAvailability = table.Column(type: "bit", nullable: false), DisplayStockQuantity = table.Column(type: "bit", nullable: false), NotifyAdminForQuantityBelow = table.Column(type: "int", nullable: false), OrderMinimumQuantity = table.Column(type: "int", nullable: false), OrderMaximumQuantity = table.Column(type: "int", nullable: false), Price = table.Column(type: "decimal(18,4)", nullable: false), OldPrice = table.Column(type: "decimal(18,4)", nullable: false), Price2 = table.Column(type: "decimal(18,4)", nullable: false), OldPrice2 = table.Column(type: "decimal(18,4)", nullable: false), Weight = table.Column(type: "decimal(18,2)", nullable: false), Length = table.Column(type: "decimal(18,2)", nullable: false), Width = table.Column(type: "decimal(18,2)", nullable: false), Height = table.Column(type: "decimal(18,2)", nullable: false), DisplayOrder = table.Column(type: "int", nullable: false), Deleted = table.Column(type: "bit", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Products", x => x.Id); table.ForeignKey( name: "FK_Products_ProductCategories_ProductCategoryId", column: x => x.ProductCategoryId, principalTable: "ProductCategories", principalColumn: "Id"); table.ForeignKey( name: "FK_Products_TaxRates_TaxRateId", column: x => x.TaxRateId, principalTable: "TaxRates", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "AspNetUsers", columns: table => new { Id = table.Column(type: "nvarchar(450)", nullable: false), UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), FirstName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), LastName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), FullName = table.Column(type: "nvarchar(320)", maxLength: 320, nullable: false), TimeZoneId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), PreferredLanguage = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Photo = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RegistrationDate = table.Column(type: "datetimeoffset", nullable: true), LastLoginDate = table.Column(type: "datetimeoffset", nullable: true), Permissions = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), CustomerId = table.Column(type: "bigint", nullable: true), AppUserId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), SettingsJson = table.Column(type: "nvarchar(max)", nullable: true), NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), EmailConfirmed = table.Column(type: "bit", nullable: false), PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumberConfirmed = table.Column(type: "bit", nullable: false), TwoFactorEnabled = table.Column(type: "bit", nullable: false), LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), LockoutEnabled = table.Column(type: "bit", nullable: false), AccessFailedCount = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUsers", x => x.Id); table.ForeignKey( name: "FK_AspNetUsers_AppUsers_AppUserId", column: x => x.AppUserId, principalTable: "AppUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_AspNetUsers_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "Carts", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), OrderSource = table.Column(type: "int", nullable: false), AppUserId = table.Column(type: "nvarchar(128)", nullable: true), CustomerId = table.Column(type: "bigint", nullable: true), Total = table.Column(type: "decimal(18,2)", nullable: false), TotalGross = table.Column(type: "decimal(18,2)", nullable: false), Shipment = table.Column(type: "decimal(18,2)", nullable: false), ShipmentGross = table.Column(type: "decimal(18,2)", nullable: false), TaxRatesJson = table.Column(type: "nvarchar(max)", nullable: true), BillingCountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), DeliveryCountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), LastUpdate = table.Column(type: "datetimeoffset", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Carts", x => x.Id); table.ForeignKey( name: "FK_Carts_AppUsers_AppUserId", column: x => x.AppUserId, principalTable: "AppUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Carts_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "OrderItems", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), OrderId = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "int", nullable: true), ProductCategoryId = table.Column(type: "int", nullable: true), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), NameDefault = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Sku = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), ProductType = table.Column(type: "int", nullable: false), ItemId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), TaxRateId = table.Column(type: "int", nullable: false), IsTaxExempt = table.Column(type: "bit", nullable: false), IsShipEnabled = table.Column(type: "bit", nullable: false), IsFreeShipping = table.Column(type: "bit", nullable: false), AdditionalShippingCharge = table.Column(type: "decimal(18,2)", nullable: false), Quantity = table.Column(type: "int", nullable: false), Price = table.Column(type: "decimal(18,4)", nullable: false), PriceGross = table.Column(type: "decimal(18,2)", nullable: false), Price2 = table.Column(type: "decimal(18,4)", nullable: false), Price2Gross = table.Column(type: "decimal(18,2)", nullable: false), Total = table.Column(type: "decimal(18,2)", nullable: false), TotalGross = table.Column(type: "decimal(18,2)", nullable: false), Weight = table.Column(type: "decimal(18,2)", nullable: false), Length = table.Column(type: "decimal(18,2)", nullable: false), Width = table.Column(type: "decimal(18,2)", nullable: false), Height = table.Column(type: "decimal(18,2)", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), LastUpdate = table.Column(type: "datetimeoffset", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OrderItems", x => x.Id); table.ForeignKey( name: "FK_OrderItems_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_OrderItems_ProductCategories_ProductCategoryId", column: x => x.ProductCategoryId, principalTable: "ProductCategories", principalColumn: "Id"); table.ForeignKey( name: "FK_OrderItems_Products_ProductId", column: x => x.ProductId, principalTable: "Products", principalColumn: "Id"); table.ForeignKey( name: "FK_OrderItems_TaxRates_TaxRateId", column: x => x.TaxRateId, principalTable: "TaxRates", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "ProductCountries", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ProductId = table.Column(type: "int", nullable: false), CountryIso = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), Price = table.Column(type: "decimal(18,4)", nullable: false), OldPrice = table.Column(type: "decimal(18,4)", nullable: false), Price2 = table.Column(type: "decimal(18,4)", nullable: false), OldPrice2 = table.Column(type: "decimal(18,4)", nullable: false), NotAvailable = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductCountries", x => x.Id); table.ForeignKey( name: "FK_ProductCountries_Products_ProductId", column: x => x.ProductId, principalTable: "Products", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(450)", nullable: false), ClaimType = table.Column(type: "nvarchar(max)", nullable: true), ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetUserClaims_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserLogins", columns: table => new { LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), ProviderKey = table.Column(type: "nvarchar(450)", nullable: false), ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true), UserId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); table.ForeignKey( name: "FK_AspNetUserLogins_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserRoles", columns: table => new { UserId = table.Column(type: "nvarchar(450)", nullable: false), RoleId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserTokens", columns: table => new { UserId = table.Column(type: "nvarchar(450)", nullable: false), LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), Name = table.Column(type: "nvarchar(450)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AspNetUserTokens_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "CartItems", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CartId = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "int", nullable: false), ProductType = table.Column(type: "int", nullable: false), ItemId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Quantity = table.Column(type: "int", nullable: false), Price = table.Column(type: "decimal(18,4)", nullable: false), PriceGross = table.Column(type: "decimal(18,2)", nullable: false), Price2 = table.Column(type: "decimal(18,4)", nullable: false), Price2Gross = table.Column(type: "decimal(18,2)", nullable: false), Total = table.Column(type: "decimal(18,2)", nullable: false), TotalGross = table.Column(type: "decimal(18,2)", nullable: false), TaxRate = table.Column(type: "decimal(18,2)", nullable: false), TaxRateValue = table.Column(type: "decimal(18,2)", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), LastUpdate = table.Column(type: "datetimeoffset", nullable: true) }, constraints: table => { table.PrimaryKey("PK_CartItems", x => x.Id); table.ForeignKey( name: "FK_CartItems_Carts_CartId", column: x => x.CartId, principalTable: "Carts", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_CartItems_Products_ProductId", column: x => x.ProductId, principalTable: "Products", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Advertisements", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), CustomerId = table.Column(type: "bigint", nullable: false), AdvertisementCategoryId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), StartDate = table.Column(type: "datetimeoffset", nullable: true), EndDate = table.Column(type: "datetimeoffset", nullable: true), Status = table.Column(type: "int", nullable: false), CartId = table.Column(type: "bigint", nullable: true), CartItemId = table.Column(type: "bigint", nullable: true), OrderId = table.Column(type: "bigint", nullable: true), OrderItemId = table.Column(type: "bigint", nullable: true), PaymentType = table.Column(type: "int", nullable: false), PaymentStatus = table.Column(type: "int", nullable: false), PayedDate = table.Column(type: "datetimeoffset", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Url = table.Column(type: "nvarchar(2083)", maxLength: 2083, nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), UrlLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), GeoMode = table.Column(type: "int", nullable: false), Address_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Address_State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), Radius = table.Column(type: "float", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Advertisements", x => x.Id); table.ForeignKey( name: "FK_Advertisements_AdvertisementCategories_AdvertisementCategoryId", column: x => x.AdvertisementCategoryId, principalTable: "AdvertisementCategories", principalColumn: "Id"); table.ForeignKey( name: "FK_Advertisements_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Advertisements_OrderItems_OrderItemId", column: x => x.OrderItemId, principalTable: "OrderItems", principalColumn: "Id"); table.ForeignKey( name: "FK_Advertisements_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "Banners", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), CustomerId = table.Column(type: "bigint", nullable: false), BannerLocation = table.Column(type: "int", nullable: false), BannerSize = table.Column(type: "int", nullable: false), CurrentViews = table.Column(type: "int", nullable: false), CurrentClicks = table.Column(type: "int", nullable: false), BudgetUsed = table.Column(type: "decimal(18,4)", nullable: false), Budget = table.Column(type: "decimal(18,4)", nullable: false), PriceView = table.Column(type: "decimal(18,4)", nullable: false), PriceClick = table.Column(type: "decimal(18,4)", nullable: false), StartDate = table.Column(type: "datetimeoffset", nullable: true), EndDate = table.Column(type: "datetimeoffset", nullable: true), Status = table.Column(type: "int", nullable: false), CartId = table.Column(type: "bigint", nullable: true), CartItemId = table.Column(type: "bigint", nullable: true), OrderId = table.Column(type: "bigint", nullable: true), OrderItemId = table.Column(type: "bigint", nullable: true), PaymentType = table.Column(type: "int", nullable: false), PaymentStatus = table.Column(type: "int", nullable: false), PayedDate = table.Column(type: "datetimeoffset", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Url = table.Column(type: "nvarchar(2083)", maxLength: 2083, nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), UrlLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), GeoMode = table.Column(type: "int", nullable: false), Address_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Address_State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), Radius = table.Column(type: "float", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Banners", x => x.Id); table.ForeignKey( name: "FK_Banners_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Banners_OrderItems_OrderItemId", column: x => x.OrderItemId, principalTable: "OrderItems", principalColumn: "Id"); table.ForeignKey( name: "FK_Banners_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "Listings", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), CustomerId = table.Column(type: "bigint", nullable: false), BranchId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), ListingType = table.Column(type: "int", nullable: false), StartDate = table.Column(type: "datetimeoffset", nullable: true), EndDate = table.Column(type: "datetimeoffset", nullable: true), ReservedUntil = table.Column(type: "datetimeoffset", nullable: true), Status = table.Column(type: "int", nullable: false), CartId = table.Column(type: "bigint", nullable: true), CartItemId = table.Column(type: "bigint", nullable: true), OrderId = table.Column(type: "bigint", nullable: true), OrderItemId = table.Column(type: "bigint", nullable: true), PaymentType = table.Column(type: "int", nullable: false), PaymentStatus = table.Column(type: "int", nullable: false), PayedDate = table.Column(type: "datetimeoffset", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Url = table.Column(type: "nvarchar(2083)", maxLength: 2083, nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), UrlLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), GeoMode = table.Column(type: "int", nullable: false), Address_AddressLine1 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_AddressLine2 = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_Zip = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Address_State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address_CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), Radius = table.Column(type: "float", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Listings", x => x.Id); table.ForeignKey( name: "FK_Listings_Branches_BranchId", column: x => x.BranchId, principalTable: "Branches", principalColumn: "Id"); table.ForeignKey( name: "FK_Listings_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Listings_OrderItems_OrderItemId", column: x => x.OrderItemId, principalTable: "OrderItems", principalColumn: "Id"); table.ForeignKey( name: "FK_Listings_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "Pins", columns: table => new { Id = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), CustomerId = table.Column(type: "bigint", nullable: false), ListingId = table.Column(type: "nvarchar(128)", nullable: true), StartDate = table.Column(type: "datetimeoffset", nullable: true), EndDate = table.Column(type: "datetimeoffset", nullable: true), Status = table.Column(type: "int", nullable: false), Radius = table.Column(type: "float", nullable: false), Lat = table.Column(type: "float", nullable: false), Lng = table.Column(type: "float", nullable: false), CartId = table.Column(type: "bigint", nullable: true), CartItemId = table.Column(type: "bigint", nullable: true), OrderId = table.Column(type: "bigint", nullable: true), OrderItemId = table.Column(type: "bigint", nullable: true), PaymentType = table.Column(type: "int", nullable: false), PaymentStatus = table.Column(type: "int", nullable: false), PayedDate = table.Column(type: "datetimeoffset", nullable: true), Image = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Url = table.Column(type: "nvarchar(2083)", maxLength: 2083, nullable: true), NameLocalized = table.Column(type: "nvarchar(max)", nullable: true), DescriptionLocalized = table.Column(type: "nvarchar(max)", nullable: true), ImageLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), UrlLanguageLocalized = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetimeoffset", nullable: false), Index = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Version = table.Column(type: "rowversion", rowVersion: true, nullable: true), UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), Deleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Pins", x => x.Id); table.ForeignKey( name: "FK_Pins_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Pins_Listings_ListingId", column: x => x.ListingId, principalTable: "Listings", principalColumn: "Id"); table.ForeignKey( name: "FK_Pins_OrderItems_OrderItemId", column: x => x.OrderItemId, principalTable: "OrderItems", principalColumn: "Id"); table.ForeignKey( name: "FK_Pins_Orders_OrderId", column: x => x.OrderId, principalTable: "Orders", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_AdvertisementCategories_Index", table: "AdvertisementCategories", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Advertisements_AdvertisementCategoryId", table: "Advertisements", column: "AdvertisementCategoryId"); migrationBuilder.CreateIndex( name: "IX_Advertisements_CustomerId", table: "Advertisements", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_Advertisements_Index", table: "Advertisements", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Advertisements_OrderId", table: "Advertisements", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Advertisements_OrderItemId", table: "Advertisements", column: "OrderItemId"); migrationBuilder.CreateIndex( name: "IX_AppUsers_Index", table: "AppUsers", column: "Index"); migrationBuilder.CreateIndex( name: "IX_AspNetRoleClaims_RoleId", table: "AspNetRoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "RoleNameIndex", table: "AspNetRoles", column: "NormalizedName", unique: true, filter: "[NormalizedName] IS NOT NULL"); migrationBuilder.CreateIndex( name: "IX_AspNetUserClaims_UserId", table: "AspNetUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserLogins_UserId", table: "AspNetUserLogins", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserRoles_RoleId", table: "AspNetUserRoles", column: "RoleId"); migrationBuilder.CreateIndex( name: "EmailIndex", table: "AspNetUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "IX_AspNetUsers_AppUserId", table: "AspNetUsers", column: "AppUserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUsers_CustomerId", table: "AspNetUsers", column: "CustomerId"); migrationBuilder.CreateIndex( name: "UserNameIndex", table: "AspNetUsers", column: "NormalizedUserName", unique: true, filter: "[NormalizedUserName] IS NOT NULL"); migrationBuilder.CreateIndex( name: "IX_Banners_CustomerId", table: "Banners", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_Banners_Index", table: "Banners", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Banners_OrderId", table: "Banners", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Banners_OrderItemId", table: "Banners", column: "OrderItemId"); migrationBuilder.CreateIndex( name: "IX_CartItems_CartId", table: "CartItems", column: "CartId"); migrationBuilder.CreateIndex( name: "IX_CartItems_ProductId", table: "CartItems", column: "ProductId"); migrationBuilder.CreateIndex( name: "IX_Carts_AppUserId", table: "Carts", column: "AppUserId"); migrationBuilder.CreateIndex( name: "IX_Carts_CustomerId", table: "Carts", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_Conversations_Index", table: "Conversations", column: "Index"); migrationBuilder.CreateIndex( name: "IX_CreditNotes_OrderId", table: "CreditNotes", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Customers_BranchId", table: "Customers", column: "BranchId"); migrationBuilder.CreateIndex( name: "IX_Customers_TypeId", table: "Customers", column: "TypeId"); migrationBuilder.CreateIndex( name: "IX_DeliveryNotes_OrderId", table: "DeliveryNotes", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_DogRaces_Index", table: "DogRaces", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Dogs_AppUserId", table: "Dogs", column: "AppUserId"); migrationBuilder.CreateIndex( name: "IX_Dogs_DogRaceId", table: "Dogs", column: "DogRaceId"); migrationBuilder.CreateIndex( name: "IX_Dogs_Index", table: "Dogs", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Invoices_OrderId", table: "Invoices", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Listings_BranchId", table: "Listings", column: "BranchId"); migrationBuilder.CreateIndex( name: "IX_Listings_CustomerId", table: "Listings", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_Listings_Index", table: "Listings", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Listings_OrderId", table: "Listings", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Listings_OrderItemId", table: "Listings", column: "OrderItemId"); migrationBuilder.CreateIndex( name: "IX_Messages_ConversationId", table: "Messages", column: "ConversationId"); migrationBuilder.CreateIndex( name: "IX_Messages_Index", table: "Messages", column: "Index"); migrationBuilder.CreateIndex( name: "IX_News_CategoryId", table: "News", column: "CategoryId"); migrationBuilder.CreateIndex( name: "IX_NewsCategories_Index", table: "NewsCategories", column: "Index"); migrationBuilder.CreateIndex( name: "IX_OrderItems_OrderId", table: "OrderItems", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_OrderItems_ProductCategoryId", table: "OrderItems", column: "ProductCategoryId"); migrationBuilder.CreateIndex( name: "IX_OrderItems_ProductId", table: "OrderItems", column: "ProductId"); migrationBuilder.CreateIndex( name: "IX_OrderItems_TaxRateId", table: "OrderItems", column: "TaxRateId"); migrationBuilder.CreateIndex( name: "IX_Pins_CustomerId", table: "Pins", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_Pins_Index", table: "Pins", column: "Index"); migrationBuilder.CreateIndex( name: "IX_Pins_ListingId", table: "Pins", column: "ListingId"); migrationBuilder.CreateIndex( name: "IX_Pins_OrderId", table: "Pins", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Pins_OrderItemId", table: "Pins", column: "OrderItemId"); migrationBuilder.CreateIndex( name: "IX_ProductCountries_ProductId", table: "ProductCountries", column: "ProductId"); migrationBuilder.CreateIndex( name: "IX_Products_ProductCategoryId", table: "Products", column: "ProductCategoryId"); migrationBuilder.CreateIndex( name: "IX_Products_TaxRateId", table: "Products", column: "TaxRateId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Advertisements"); migrationBuilder.DropTable( name: "AspNetRoleClaims"); migrationBuilder.DropTable( name: "AspNetUserClaims"); migrationBuilder.DropTable( name: "AspNetUserLogins"); migrationBuilder.DropTable( name: "AspNetUserRoles"); migrationBuilder.DropTable( name: "AspNetUserTokens"); migrationBuilder.DropTable( name: "Audits"); migrationBuilder.DropTable( name: "Banners"); migrationBuilder.DropTable( name: "CartItems"); migrationBuilder.DropTable( name: "CreditNotes"); migrationBuilder.DropTable( name: "DeliveryNotes"); migrationBuilder.DropTable( name: "Dogs"); migrationBuilder.DropTable( name: "EntityRelations"); migrationBuilder.DropTable( name: "FidoStoredCredentials"); migrationBuilder.DropTable( name: "Invoices"); migrationBuilder.DropTable( name: "Messages"); migrationBuilder.DropTable( name: "News"); migrationBuilder.DropTable( name: "PersistedTickets"); migrationBuilder.DropTable( name: "Pins"); migrationBuilder.DropTable( name: "ProductCountries"); migrationBuilder.DropTable( name: "RefreshTokens"); migrationBuilder.DropTable( name: "ShipmentCosts"); migrationBuilder.DropTable( name: "ShopSettings"); migrationBuilder.DropTable( name: "AdvertisementCategories"); migrationBuilder.DropTable( name: "AspNetRoles"); migrationBuilder.DropTable( name: "AspNetUsers"); migrationBuilder.DropTable( name: "Carts"); migrationBuilder.DropTable( name: "DogRaces"); migrationBuilder.DropTable( name: "Conversations"); migrationBuilder.DropTable( name: "NewsCategories"); migrationBuilder.DropTable( name: "Listings"); migrationBuilder.DropTable( name: "AppUsers"); migrationBuilder.DropTable( name: "Customers"); migrationBuilder.DropTable( name: "OrderItems"); migrationBuilder.DropTable( name: "Branches"); migrationBuilder.DropTable( name: "CustomerTypes"); migrationBuilder.DropTable( name: "Orders"); migrationBuilder.DropTable( name: "Products"); migrationBuilder.DropTable( name: "ProductCategories"); migrationBuilder.DropTable( name: "TaxRates"); } } }