From f7da908fc587864131778b441ee943522a164e1a Mon Sep 17 00:00:00 2001 From: Cihan T Date: Sun, 8 May 2022 15:37:04 +0300 Subject: [PATCH 1/3] DB providers splitted to projects --- SimplCommerce.sln | 34 +- .../ModuleInitializer.cs | 1 + .../DependencyInjection.cs | 22 + ...212090153_SimplCommerce_v1_0_0.Designer.cs | 2 +- .../20190212090153_SimplCommerce_v1_0_0.cs | 2 +- ...050227_AddedCartLockOnCheckout.Designer.cs | 2 +- .../20190224050227_AddedCartLockOnCheckout.cs | 2 +- .../20190302122027_MomoPayment.Designer.cs | 2 +- .../Migrations/20190302122027_MomoPayment.cs | 2 +- ...14044223_AddedNganLuongPayment.Designer.cs | 2 +- .../20190314044223_AddedNganLuongPayment.cs | 2 +- ...14_DefaultCultureConfiguration.Designer.cs | 2 +- ...90710165614_DefaultCultureConfiguration.cs | 2 +- ...726221912_AddedCurrencySetting.Designer.cs | 2 +- .../20190726221912_AddedCurrencySetting.cs | 2 +- ...83300_AddedContentLocalization.Designer.cs | 2 +- ...20190727083300_AddedContentLocalization.cs | 2 +- ...801065533_AddedCashfreePayment.Designer.cs | 2 +- .../20190801065533_AddedCashfreePayment.cs | 2 +- ...75214_AddedAssetBundlingConfig.Designer.cs | 2 +- ...20190803175214_AddedAssetBundlingConfig.cs | 2 +- .../Migrations/SimplDbContextModelSnapshot.cs | 2 +- .../SimplCommerce.Db.MsSql.csproj | 21 + .../DependencyInjection.cs | 22 + .../20220508115122_Initial.Designer.cs | 4689 ++++++++++++++++ .../Migrations/20220508115122_Initial.cs | 3190 +++++++++++ .../Migrations/SimplDbContextModelSnapshot.cs | 4687 ++++++++++++++++ .../SimplCommerce.Db.PgSql.csproj | 22 + .../Extensions/ServiceCollectionExtensions.cs | 8 - .../MigrationSimplDbContextFactory.cs | 64 +- src/SimplCommerce.WebHost/Program.cs | 5 +- .../SimplCommerce.WebHost.csproj | 20 +- .../20220508110554_Initial.Designer.cs | 4691 +++++++++++++++++ .../Migrations/20220508110554_Initial.cs | 3200 +++++++++++ 34 files changed, 20641 insertions(+), 73 deletions(-) create mode 100644 src/SimplCommerce.Db.MsSql/DependencyInjection.cs rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190212090153_SimplCommerce_v1_0_0.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190224050227_AddedCartLockOnCheckout.cs (93%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190302122027_MomoPayment.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190302122027_MomoPayment.cs (95%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190314044223_AddedNganLuongPayment.cs (95%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190710165614_DefaultCultureConfiguration.cs (94%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190726221912_AddedCurrencySetting.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190726221912_AddedCurrencySetting.cs (97%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190727083300_AddedContentLocalization.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190727083300_AddedContentLocalization.cs (98%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190801065533_AddedCashfreePayment.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190801065533_AddedCashfreePayment.cs (95%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs (99%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/20190803175214_AddedAssetBundlingConfig.cs (94%) rename src/{SimplCommerce.WebHost => SimplCommerce.Db.MsSql}/Migrations/SimplDbContextModelSnapshot.cs (99%) create mode 100644 src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj create mode 100644 src/SimplCommerce.Db.PgSql/DependencyInjection.cs create mode 100644 src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs create mode 100644 src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.cs create mode 100644 src/SimplCommerce.Db.PgSql/Migrations/SimplDbContextModelSnapshot.cs create mode 100644 src/SimplCommerce.Db.PgSql/SimplCommerce.Db.PgSql.csproj create mode 100644 src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs create mode 100644 src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs diff --git a/SimplCommerce.sln b/SimplCommerce.sln index 78a141ca08..f8d3e78d6d 100644 --- a/SimplCommerce.sln +++ b/SimplCommerce.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29020.237 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32421.90 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C9BFDDC4-5671-47A3-B57D-197C2A51FA8A}" EndProject @@ -134,6 +134,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Module.Paymen EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Module.PaymentCashfree", "src\Modules\SimplCommerce.Module.PaymentCashfree\SimplCommerce.Module.PaymentCashfree.csproj", "{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Db.MsSql", "src\SimplCommerce.Db.MsSql\SimplCommerce.Db.MsSql.csproj", "{2FD1634B-E0ED-4E68-A993-57AAEF2B9474}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimplCommerce.Db.PgSql", "src\SimplCommerce.Db.PgSql\SimplCommerce.Db.PgSql.csproj", "{61985132-75C9-4601-9030-6E2B76781E0F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -696,6 +700,30 @@ Global {E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x64.Build.0 = Release|Any CPU {E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x86.ActiveCfg = Release|Any CPU {E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x86.Build.0 = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x64.ActiveCfg = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x64.Build.0 = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x86.ActiveCfg = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x86.Build.0 = Debug|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|Any CPU.Build.0 = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x64.ActiveCfg = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x64.Build.0 = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x86.ActiveCfg = Release|Any CPU + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x86.Build.0 = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x64.ActiveCfg = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x64.Build.0 = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x86.ActiveCfg = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x86.Build.0 = Debug|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|Any CPU.Build.0 = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x64.ActiveCfg = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x64.Build.0 = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.ActiveCfg = Release|Any CPU + {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -750,6 +778,8 @@ Global {1A8B6FA0-8341-4D27-9B71-57F70AB37571} = {0A27C140-4CCB-40DD-BE48-F5DE16D1177B} {14586564-62CC-4117-AC1B-858ED53C2D6C} = {7EFA2FA7-32DD-4047-B021-50E77A83D714} {E30CF10F-FABF-4917-8BEB-CB81E4CE2C92} = {7EFA2FA7-32DD-4047-B021-50E77A83D714} + {2FD1634B-E0ED-4E68-A993-57AAEF2B9474} = {C9BFDDC4-5671-47A3-B57D-197C2A51FA8A} + {61985132-75C9-4601-9030-6E2B76781E0F} = {C9BFDDC4-5671-47A3-B57D-197C2A51FA8A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B9D0D8F0-1AB9-44DD-839F-ED8CEE7DDB10} diff --git a/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs b/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs index 24158fed7c..376b83505f 100644 --- a/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs +++ b/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs @@ -29,6 +29,7 @@ public void ConfigureServices(IServiceCollection serviceCollection) public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + // Method intentionally left empty. } } } diff --git a/src/SimplCommerce.Db.MsSql/DependencyInjection.cs b/src/SimplCommerce.Db.MsSql/DependencyInjection.cs new file mode 100644 index 0000000000..96a12cd8e6 --- /dev/null +++ b/src/SimplCommerce.Db.MsSql/DependencyInjection.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using SimplCommerce.Module.Core.Data; +using SimplCommerce.Module.Core.Extensions; + +namespace SimplCommerce.Db.MsSql +{ + public static class DependencyInjection + { + public static IServiceCollection AddDbConfiguration(this IServiceCollection services, string connectionString) + { + services.AddDbContextPool(options => + options.UseSqlServer(connectionString, + x => x.MigrationsAssembly( + typeof(DependencyInjection).Assembly.FullName) + )); + return services; + } + } +} diff --git a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs index 13c22acee4..0e8ebb496c 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190212090153_SimplCommerce_v1_0_0")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs index 572ca3f207..62481ae9fb 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class SimplCommerce_v1_0_0 : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs index e3186988ef..8d731a9641 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190224050227_AddedCartLockOnCheckout")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs similarity index 93% rename from src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs index 85c972d2b8..f7ebd7a7ec 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedCartLockOnCheckout : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs index 1ff5880623..440d18626d 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190302122027_MomoPayment")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs similarity index 95% rename from src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs index 15f0c73aa4..2616bc01ff 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class MomoPayment : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs index 15a34673cb..5659dedf2e 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190314044223_AddedNganLuongPayment")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs similarity index 95% rename from src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs index 5513b4e818..44ddc4092a 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedNganLuongPayment : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs index 06651706a5..1bb3aa047d 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190710165614_DefaultCultureConfiguration")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs similarity index 94% rename from src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs index a457e41c60..137b5cf257 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class DefaultCultureConfiguration : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs index 75cfb8d5de..4f20666ce3 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190726221912_AddedCurrencySetting")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs similarity index 97% rename from src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs index 2229c8af6c..dfbc5ffb75 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedCurrencySetting : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs index 77e9fc7d54..1b16683a57 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190727083300_AddedContentLocalization")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs similarity index 98% rename from src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs index 283edaca43..9c15f2986a 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedContentLocalization : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs index 6811cfcef2..0b387dbc97 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190801065533_AddedCashfreePayment")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs similarity index 95% rename from src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs index 47a58a8057..8249b1ca13 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedCashfreePayment : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs index 4f485d4b8c..6ec2d40991 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] [Migration("20190803175214_AddedAssetBundlingConfig")] diff --git a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs similarity index 94% rename from src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs rename to src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs index f95b94de04..93b7cdf6cc 100644 --- a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { public partial class AddedAssetBundlingConfig : Migration { diff --git a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs similarity index 99% rename from src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs rename to src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs index 21da213780..3f59aeaa25 100644 --- a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs +++ b/src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SimplCommerce.Module.Core.Data; -namespace SimplCommerce.WebHost.Migrations +namespace SimplCommerce.Db.MsSql.Migrations { [DbContext(typeof(SimplDbContext))] partial class SimplDbContextModelSnapshot : ModelSnapshot diff --git a/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj b/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj new file mode 100644 index 0000000000..17891d99b3 --- /dev/null +++ b/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/SimplCommerce.Db.PgSql/DependencyInjection.cs b/src/SimplCommerce.Db.PgSql/DependencyInjection.cs new file mode 100644 index 0000000000..c7890f13db --- /dev/null +++ b/src/SimplCommerce.Db.PgSql/DependencyInjection.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using SimplCommerce.Module.Core.Data; +using SimplCommerce.Module.Core.Extensions; + +namespace SimplCommerce.Db.PgSql +{ + public static class DependencyInjection + { + public static IServiceCollection AddDbConfiguration(this IServiceCollection services, string connectionString) + { + services.AddDbContextPool(options => + options.UseNpgsql(connectionString, + x => x.MigrationsAssembly( + typeof(DependencyInjection).Assembly.FullName) + )); + return services; + } + } +} diff --git a/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs new file mode 100644 index 0000000000..eefadb5e90 --- /dev/null +++ b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs @@ -0,0 +1,4689 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SimplCommerce.Module.Core.Data; + +#nullable disable + +namespace SimplCommerce.Db.PgSql.Migrations +{ + [DbContext(typeof(SimplDbContext))] + [Migration("20220508115122_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_RoleClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserLogin", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("Core_UserToken", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Localization_Culture", (string)null); + + b.HasData( + new + { + Id = "en-US", + Name = "English (US)" + }); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("text"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ProperyName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_LocalizedContentProperty", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_Resource", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActivityTypeId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeId"); + + b.ToTable("ActivityLog_Activity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("ActivityLog_ActivityType", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "EntityView" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_Brand", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IncludeInMenu") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Category", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BrandId") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("Gtin") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("HasOptions") + .HasColumnType("boolean"); + + b.Property("IsAllowToOrder") + .HasColumnType("boolean"); + + b.Property("IsCallForPricing") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsFeatured") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("IsVisibleIndividually") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("NormalizedName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OldPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Price") + .HasColumnType("numeric(18,2)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("RatingAverage") + .HasColumnType("double precision"); + + b.Property("ReviewsCount") + .HasColumnType("integer"); + + b.Property("ShortDescription") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Sku") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SpecialPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("SpecialPriceStart") + .HasColumnType("timestamp with time zone"); + + b.Property("Specification") + .HasColumnType("text"); + + b.Property("StockQuantity") + .HasColumnType("integer"); + + b.Property("StockTrackingIsEnabled") + .HasColumnType("boolean"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BrandId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("TaxClassId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Product", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Catalog_ProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductAttributeGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AttributeId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("AttributeId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductAttributeValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IsFeaturedProduct") + .HasColumnType("boolean"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LinkType") + .HasColumnType("integer"); + + b.Property("LinkedProductId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LinkedProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductLink", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductMedia", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductOption", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Color" + }, + new + { + Id = 2L, + Name = "Size" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("integer"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionCombination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DisplayType") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("integer"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OldPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Price") + .HasColumnType("numeric(18,2)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SpecialPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("SpecialPriceStart") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductPriceHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductTemplate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.Property("ProductTemplateId") + .HasColumnType("bigint"); + + b.Property("ProductAttributeId") + .HasColumnType("bigint"); + + b.HasKey("ProductTemplateId", "ProductAttributeId"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("IsSystem") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Cms_Menu", (string)null); + + b.HasData( + new + { + Id = 1L, + IsPublished = true, + IsSystem = true, + Name = "Customer Services" + }, + new + { + Id = 2L, + IsPublished = true, + IsSystem = true, + Name = "Information" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CustomLink") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("MenuId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.HasIndex("MenuId"); + + b.HasIndex("ParentId"); + + b.ToTable("Cms_MenuItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .HasColumnType("text"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.ToTable("Cms_Page", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CommentText") + .HasColumnType("text"); + + b.Property("CommenterName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UserId"); + + b.ToTable("Comments_Comment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactAreaId") + .HasColumnType("bigint"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EmailAddress") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FullName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("PhoneNumber") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("ContactAreaId"); + + b.ToTable("Contacts_Contact", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Contacts_ContactArea", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_Address", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressLine1 = "364 Cong Hoa", + ContactName = "Thien Nguyen", + CountryId = "VN", + StateOrProvinceId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("IsVisibleInCommonSettingPage") + .HasColumnType("boolean"); + + b.Property("Module") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_AppSetting", (string)null); + + b.HasData( + new + { + Id = "Catalog.ProductPageSize", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "10" + }, + new + { + Id = "Catalog.IsProductPriceIncludeTax", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "Catalog.IsCommentsRequireApproval", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "GoogleAppKey", + IsVisibleInCommonSettingPage = false, + Module = "Contact", + Value = "" + }, + new + { + Id = "Global.AssetVersion", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "1.0" + }, + new + { + Id = "Global.AssetBundling", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "false" + }, + new + { + Id = "Theme", + IsVisibleInCommonSettingPage = false, + Module = "Core", + Value = "Generic" + }, + new + { + Id = "Global.DefaultCultureUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.DefaultCultureAdminUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyCulture", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyDecimalPlace", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "2" + }, + new + { + Id = "SmtpServer", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "smtp.gmail.com" + }, + new + { + Id = "SmtpPort", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "587" + }, + new + { + Id = "SmtpUsername", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "SmtpPassword", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "Localization.LocalizedConentEnable", + IsVisibleInCommonSettingPage = true, + Module = "Localization", + Value = "true" + }, + new + { + Id = "News.PageSize", + IsVisibleInCommonSettingPage = true, + Module = "News", + Value = "10" + }, + new + { + Id = "Tax.DefaultTaxClassId", + IsVisibleInCommonSettingPage = true, + Module = "Tax", + Value = "1" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Code3") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsBillingEnabled") + .HasColumnType("boolean"); + + b.Property("IsCityEnabled") + .HasColumnType("boolean"); + + b.Property("IsDistrictEnabled") + .HasColumnType("boolean"); + + b.Property("IsShippingEnabled") + .HasColumnType("boolean"); + + b.Property("IsZipCodeEnabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Country", (string)null); + + b.HasData( + new + { + Id = "VN", + Code3 = "VNM", + IsBillingEnabled = true, + IsCityEnabled = false, + IsDistrictEnabled = true, + IsShippingEnabled = true, + IsZipCodeEnabled = false, + Name = "Việt Nam" + }, + new + { + Id = "US", + Code3 = "USA", + IsBillingEnabled = true, + IsCityEnabled = true, + IsDistrictEnabled = false, + IsShippingEnabled = true, + IsZipCodeEnabled = true, + Name = "United States" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Core_CustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Core_CustomerGroupUser", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Location") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_District", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Quận 1", + StateOrProvinceId = 1L, + Type = "Quận" + }, + new + { + Id = 2L, + Name = "Quận 2", + StateOrProvinceId = 1L, + Type = "Quận" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("Core_Entity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AreaName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsMenuable") + .HasColumnType("boolean"); + + b.Property("RoutingAction") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RoutingController") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_EntityType", (string)null); + + b.HasData( + new + { + Id = "Category", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "CategoryDetail", + RoutingController = "Category" + }, + new + { + Id = "Brand", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "BrandDetail", + RoutingController = "Brand" + }, + new + { + Id = "Product", + AreaName = "Catalog", + IsMenuable = false, + RoutingAction = "ProductDetail", + RoutingController = "Product" + }, + new + { + Id = "Page", + AreaName = "Cms", + IsMenuable = true, + RoutingAction = "PageDetail", + RoutingController = "Page" + }, + new + { + Id = "Vendor", + AreaName = "Core", + IsMenuable = false, + RoutingAction = "VendorDetail", + RoutingController = "Vendor" + }, + new + { + Id = "NewsCategory", + AreaName = "News", + IsMenuable = true, + RoutingAction = "NewsCategoryDetail", + RoutingController = "NewsCategory" + }, + new + { + Id = "NewsItem", + AreaName = "News", + IsMenuable = false, + RoutingAction = "NewsItemDetail", + RoutingController = "NewsItem" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FileName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FileSize") + .HasColumnType("integer"); + + b.Property("MediaType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Core_Media", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("Core_Role", (string)null); + + b.HasData( + new + { + Id = 1L, + ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", + Name = "admin", + NormalizedName = "ADMIN" + }, + new + { + Id = 2L, + ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", + Name = "customer", + NormalizedName = "CUSTOMER" + }, + new + { + Id = 3L, + ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", + Name = "guest", + NormalizedName = "GUEST" + }, + new + { + Id = 4L, + ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", + Name = "vendor", + NormalizedName = "VENDOR" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Code") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.ToTable("Core_StateOrProvince", (string)null); + + b.HasData( + new + { + Id = 1L, + CountryId = "VN", + Name = "Hồ Chí Minh", + Type = "Thành Phố" + }, + new + { + Id = 2L, + Code = "WA", + CountryId = "US", + Name = "Washington" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Culture") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DefaultBillingAddressId") + .HasColumnType("bigint"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("bigint"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("ExtensionData") + .HasColumnType("text"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("RefreshTokenHash") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserGuid") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DefaultBillingAddressId"); + + b.HasIndex("DefaultShippingAddressId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.HasIndex("VendorId"); + + b.ToTable("Core_User", (string)null); + + b.HasData( + new + { + Id = 2L, + AccessFailedCount = 0, + ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "system@simplcommerce.com", + EmailConfirmed = false, + FullName = "System User", + IsDeleted = true, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", + NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", + TwoFactorEnabled = false, + UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), + UserName = "system@simplcommerce.com" + }, + new + { + Id = 10L, + AccessFailedCount = 0, + ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "admin@simplcommerce.com", + EmailConfirmed = false, + FullName = "Shop Admin", + IsDeleted = false, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", + NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", + TwoFactorEnabled = false, + UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), + UserName = "admin@simplcommerce.com" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AddressType") + .HasColumnType("integer"); + + b.Property("LastUsedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_UserRole", (string)null); + + b.HasData( + new + { + UserId = 10L, + RoleId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Vendor", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("CreateUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EditUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ViewComponentName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Widget", (string)null); + + b.HasData( + new + { + Id = "CategoryWidget", + CreateUrl = "widget-category-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-category-edit", + IsPublished = false, + Name = "Category Widget", + ViewComponentName = "CategoryWidget" + }, + new + { + Id = "ProductWidget", + CreateUrl = "widget-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-product-edit", + IsPublished = false, + Name = "Product Widget", + ViewComponentName = "ProductWidget" + }, + new + { + Id = "SimpleProductWidget", + CreateUrl = "widget-simple-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-simple-product-edit", + IsPublished = false, + Name = "Simple Product Widget", + ViewComponentName = "SimpleProductWidget" + }, + new + { + Id = "HtmlWidget", + CreateUrl = "widget-html-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-html-edit", + IsPublished = false, + Name = "Html Widget", + ViewComponentName = "HtmlWidget" + }, + new + { + Id = "CarouselWidget", + CreateUrl = "widget-carousel-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-carousel-edit", + IsPublished = false, + Name = "Carousel Widget", + ViewComponentName = "CarouselWidget" + }, + new + { + Id = "SpaceBarWidget", + CreateUrl = "widget-spacebar-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-spacebar-edit", + IsPublished = false, + Name = "SpaceBar Widget", + ViewComponentName = "SpaceBarWidget" + }, + new + { + Id = "RecentlyViewedWidget", + CreateUrl = "widget-recently-viewed-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-recently-viewed-edit", + IsPublished = false, + Name = "Recently Viewed Widget", + ViewComponentName = "RecentlyViewedWidget" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("HtmlData") + .HasColumnType("text"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("PublishStart") + .HasColumnType("timestamp with time zone"); + + b.Property("WidgetId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("WidgetZoneId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WidgetId"); + + b.HasIndex("WidgetZoneId"); + + b.ToTable("Core_WidgetInstance", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_WidgetZone", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Home Featured" + }, + new + { + Id = 2L, + Name = "Home Main Content" + }, + new + { + Id = 3L, + Name = "Home After Main Content" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("ReservedQuantity") + .HasColumnType("integer"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_Stock", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AdjustedQuantity") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_StockHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("VendorId"); + + b.ToTable("Inventory_Warehouse", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressId = 1L, + Name = "Default warehouse" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("News_NewsCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("FullContent") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ShortContent") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("News_NewsItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("NewsItemId") + .HasColumnType("bigint"); + + b.HasKey("CategoryId", "NewsItemId"); + + b.HasIndex("NewsItemId"); + + b.ToTable("News_NewsItemCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("IsMasterOrder") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OrderStatus") + .HasColumnType("integer"); + + b.Property("OrderTotal") + .HasColumnType("numeric(18,2)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PaymentFeeAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ShippingAddressId") + .HasColumnType("bigint"); + + b.Property("ShippingFeeAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SubTotal") + .HasColumnType("numeric(18,2)"); + + b.Property("SubTotalWithDiscount") + .HasColumnType("numeric(18,2)"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BillingAddressId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ParentId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Orders_Order", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Orders_OrderAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("NewStatus") + .HasColumnType("integer"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OldStatus") + .HasColumnType("integer"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("OrderSnapshot") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.ToTable("Orders_OrderHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("ProductPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("TaxPercent") + .HasColumnType("numeric(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("Orders_OrderItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("numeric(18,2)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("FailureMessage") + .HasColumnType("text"); + + b.Property("GatewayTransactionId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("PaymentFee") + .HasColumnType("numeric(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("Payments_Payment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AdditionalSettings") + .HasColumnType("text"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("LandingViewComponentName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Payments_PaymentProvider", (string)null); + + b.HasData( + new + { + Id = "Braintree", + AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", + ConfigureUrl = "payments-braintree-config", + IsEnabled = true, + LandingViewComponentName = "BraintreeLanding", + Name = "Braintree" + }, + new + { + Id = "CoD", + ConfigureUrl = "payments-cod-config", + IsEnabled = true, + LandingViewComponentName = "CoDLanding", + Name = "Cash On Delivery" + }, + new + { + Id = "PaypalExpress", + AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", + ConfigureUrl = "payments-paypalExpress-config", + IsEnabled = true, + LandingViewComponentName = "PaypalExpressLanding", + Name = "Paypal Express" + }, + new + { + Id = "Stripe", + AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", + ConfigureUrl = "payments-stripe-config", + IsEnabled = true, + LandingViewComponentName = "StripeLanding", + Name = "Stripe" + }, + new + { + Id = "MomoPayment", + AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", + ConfigureUrl = "payments-momo-config", + IsEnabled = true, + LandingViewComponentName = "MomoLanding", + Name = "Momo Payment" + }, + new + { + Id = "NganLuong", + AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", + ConfigureUrl = "payments-nganluong-config", + IsEnabled = true, + LandingViewComponentName = "NganLuongLanding", + Name = "Ngan Luong Payment" + }, + new + { + Id = "Cashfree", + AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", + ConfigureUrl = "payments-cashfree-config", + IsEnabled = true, + LandingViewComponentName = "CashfreeLanding", + Name = "Cashfree Payment Gateway" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("DiscountStep") + .HasColumnType("integer"); + + b.Property("EndOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsCouponRequired") + .HasColumnType("boolean"); + + b.Property("MaxDiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StartOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UsageLimitPerCoupon") + .HasColumnType("integer"); + + b.Property("UsageLimitPerCustomer") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CartRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CategoryId"); + + b.HasIndex("CategoryId"); + + b.ToTable("Pricing_CartRuleCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Pricing_CartRuleProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CouponId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.HasIndex("CouponId"); + + b.HasIndex("UserId"); + + b.ToTable("Pricing_CartRuleUsage", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("EndOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("MaxDiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StartOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CatalogRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.Property("CatalogRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CatalogRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.ToTable("Pricing_Coupon", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("UserId"); + + b.ToTable("ProductComparison_ComparingProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LatestViewedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplierName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ReviewId"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Reply", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Rating") + .HasColumnType("integer"); + + b.Property("ReviewerName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Title") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Review", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("QueryText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ResultsCount") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Search_Query", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("TrackingNumber") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Shipments_Shipment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OrderItemId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("ShipmentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("ShipmentId"); + + b.ToTable("Shipments_ShipmentItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AdditionalSettings") + .HasColumnType("text"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OnlyCountryIdsString") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OnlyStateOrProvinceIdsString") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ShippingPriceServiceTypeName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ToAllShippingEnabledCountries") + .HasColumnType("boolean"); + + b.Property("ToAllShippingEnabledStatesOrProvinces") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("Shipping_ShippingProvider", (string)null); + + b.HasData( + new + { + Id = "FreeShip", + AdditionalSettings = "{MinimumOrderAmount : 1}", + ConfigureUrl = "", + IsEnabled = true, + Name = "Free Ship", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }, + new + { + Id = "TableRate", + ConfigureUrl = "shipping-table-rate-config", + IsEnabled = true, + Name = "Table Rate", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("MinOrderSubtotal") + .HasColumnType("numeric(18,2)"); + + b.Property("Note") + .HasColumnType("text"); + + b.Property("ShippingPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsProductPriceIncludeTax") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockedOnCheckout") + .HasColumnType("boolean"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ShippingAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("ShippingData") + .HasColumnType("text"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.ToTable("ShoppingCart_Cart", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CartId"); + + b.HasIndex("ProductId"); + + b.ToTable("ShoppingCart_CartItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Tax_TaxClass", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Standard VAT" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Rate") + .HasColumnType("numeric(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("StateOrProvinceId"); + + b.HasIndex("TaxClassId"); + + b.ToTable("Tax_TaxRate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("SharingCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("WishList_WishList", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("WishListId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WishListId"); + + b.ToTable("WishList_WishListItem", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany("Resources") + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") + .WithMany() + .HasForeignKey("ActivityTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ActivityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") + .WithMany() + .HasForeignKey("BrandId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Brand"); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("TaxClass"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") + .WithMany("Attributes") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") + .WithMany() + .HasForeignKey("AttributeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("AttributeValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Attribute"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Categories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") + .WithMany("LinkedProductLinks") + .HasForeignKey("LinkedProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("ProductLinks") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("LinkedProduct"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") + .WithMany() + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Medias") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionCombinations") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("PriceHistories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") + .WithMany("ProductTemplates") + .HasForeignKey("ProductAttributeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") + .WithMany("ProductAttributes") + .HasForeignKey("ProductTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProductAttribute"); + + b.Navigation("ProductTemplate"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") + .WithMany("MenuItems") + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Entity"); + + b.Navigation("Menu"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") + .WithMany("Replies") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Parent"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") + .WithMany() + .HasForeignKey("ContactAreaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContactArea"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany("Users") + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("CustomerGroups") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomerGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("EntityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany("StatesOrProvinces") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") + .WithMany() + .HasForeignKey("DefaultBillingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") + .WithMany() + .HasForeignKey("DefaultShippingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) + .WithMany("Users") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("DefaultBillingAddress"); + + b.Navigation("DefaultShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany("UserAddresses") + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("UserAddresses") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") + .WithMany() + .HasForeignKey("WidgetId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") + .WithMany() + .HasForeignKey("WidgetZoneId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Widget"); + + b.Navigation("WidgetZone"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") + .WithMany() + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Address"); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") + .WithMany("NewsItems") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") + .WithMany("Categories") + .HasForeignKey("NewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("NewsItem"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") + .WithMany() + .HasForeignKey("BillingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BillingAddress"); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("Parent"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Categories") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("CustomerGroups") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Products") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany() + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") + .WithMany() + .HasForeignKey("CouponId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Coupon"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") + .WithMany("CustomerGroups") + .HasForeignKey("CatalogRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CatalogRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Coupons") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CartRule"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") + .WithMany("Replies") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") + .WithMany("Items") + .HasForeignKey("ShipmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Shipment"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.HasOne("SimplCommerce.Module.ShoppingCart.Models.Cart", "Cart") + .WithMany("Items") + .HasForeignKey("CartId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Cart"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("StateOrProvince"); + + b.Navigation("TaxClass"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") + .WithMany("Items") + .HasForeignKey("WishListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("WishList"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Navigation("Resources"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Navigation("AttributeValues"); + + b.Navigation("Categories"); + + b.Navigation("LinkedProductLinks"); + + b.Navigation("Medias"); + + b.Navigation("OptionCombinations"); + + b.Navigation("OptionValues"); + + b.Navigation("PriceHistories"); + + b.Navigation("ProductLinks"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Navigation("ProductTemplates"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Navigation("ProductAttributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Navigation("MenuItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Navigation("StatesOrProvinces"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Navigation("CustomerGroups"); + + b.Navigation("Roles"); + + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Navigation("NewsItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Navigation("Categories"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Navigation("Children"); + + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Navigation("Categories"); + + b.Navigation("Coupons"); + + b.Navigation("CustomerGroups"); + + b.Navigation("Products"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Navigation("CustomerGroups"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.cs b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.cs new file mode 100644 index 0000000000..ffdca095fb --- /dev/null +++ b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.cs @@ -0,0 +1,3190 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace SimplCommerce.Db.PgSql.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ActivityLog_ActivityType", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityLog_ActivityType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Brand", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Brand", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttributeGroup", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttributeGroup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOption", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOption", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductTemplate", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductTemplate", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Cms_Menu", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + IsPublished = table.Column(type: "boolean", nullable: false), + IsSystem = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_Menu", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Contacts_ContactArea", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Contacts_ContactArea", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_AppSetting", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Value = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Module = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + IsVisibleInCommonSettingPage = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_AppSetting", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Country", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Code3 = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + IsBillingEnabled = table.Column(type: "boolean", nullable: false), + IsShippingEnabled = table.Column(type: "boolean", nullable: false), + IsCityEnabled = table.Column(type: "boolean", nullable: false), + IsZipCodeEnabled = table.Column(type: "boolean", nullable: false), + IsDistrictEnabled = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Country", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_CustomerGroup", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true), + IsActive = table.Column(type: "boolean", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_CustomerGroup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_EntityType", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + IsMenuable = table.Column(type: "boolean", nullable: false), + AreaName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + RoutingController = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + RoutingAction = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_EntityType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Media", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Caption = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + FileSize = table.Column(type: "integer", nullable: false), + FileName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MediaType = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Media", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Role", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Role", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Vendor", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true), + Email = table.Column(type: "text", nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + IsActive = table.Column(type: "boolean", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Vendor", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Widget", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + ViewComponentName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CreateUrl = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + EditUrl = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + IsPublished = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Widget", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_WidgetZone", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_WidgetZone", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Localization_Culture", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_Culture", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "News_NewsCategory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "text", nullable: true), + Description = table.Column(type: "text", nullable: true), + DisplayOrder = table.Column(type: "integer", nullable: false), + IsPublished = table.Column(type: "boolean", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Payments_PaymentProvider", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + ConfigureUrl = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + LandingViewComponentName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + AdditionalSettings = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payments_PaymentProvider", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRule", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true), + IsActive = table.Column(type: "boolean", nullable: false), + StartOn = table.Column(type: "timestamp with time zone", nullable: true), + EndOn = table.Column(type: "timestamp with time zone", nullable: true), + IsCouponRequired = table.Column(type: "boolean", nullable: false), + RuleToApply = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "numeric(18,2)", nullable: false), + MaxDiscountAmount = table.Column(type: "numeric(18,2)", nullable: true), + DiscountStep = table.Column(type: "integer", nullable: true), + UsageLimitPerCoupon = table.Column(type: "integer", nullable: true), + UsageLimitPerCustomer = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRule", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CatalogRule", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "text", nullable: true), + IsActive = table.Column(type: "boolean", nullable: false), + StartOn = table.Column(type: "timestamp with time zone", nullable: true), + EndOn = table.Column(type: "timestamp with time zone", nullable: true), + RuleToApply = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "numeric(18,2)", nullable: false), + MaxDiscountAmount = table.Column(type: "numeric(18,2)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CatalogRule", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ProductRecentlyViewed_RecentlyViewedProduct", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + LatestViewedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProductRecentlyViewed_RecentlyViewedProduct", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Search_Query", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + QueryText = table.Column(type: "character varying(500)", maxLength: 500, nullable: false), + ResultsCount = table.Column(type: "integer", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Search_Query", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Shipping_ShippingProvider", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + ConfigureUrl = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ToAllShippingEnabledCountries = table.Column(type: "boolean", nullable: false), + OnlyCountryIdsString = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + ToAllShippingEnabledStatesOrProvinces = table.Column(type: "boolean", nullable: false), + OnlyStateOrProvinceIdsString = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + AdditionalSettings = table.Column(type: "text", nullable: true), + ShippingPriceServiceTypeName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipping_ShippingProvider", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Tax_TaxClass", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Tax_TaxClass", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ActivityLog_Activity", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ActivityTypeId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + EntityId = table.Column(type: "bigint", nullable: false), + EntityTypeId = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityLog_Activity", x => x.Id); + table.ForeignKey( + name: "FK_ActivityLog_Activity_ActivityLog_ActivityType_ActivityTypeId", + column: x => x.ActivityTypeId, + principalTable: "ActivityLog_ActivityType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttribute", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + GroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttribute", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductAttribute_Catalog_ProductAttributeGroup_Grou~", + column: x => x.GroupId, + principalTable: "Catalog_ProductAttributeGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Contacts_Contact", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + FullName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + PhoneNumber = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + EmailAddress = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Address = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Content = table.Column(type: "text", nullable: true), + ContactAreaId = table.Column(type: "bigint", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Contacts_Contact", x => x.Id); + table.ForeignKey( + name: "FK_Contacts_Contact_Contacts_ContactArea_ContactAreaId", + column: x => x.ContactAreaId, + principalTable: "Contacts_ContactArea", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_StateOrProvince", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CountryId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Code = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Type = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_StateOrProvince", x => x.Id); + table.ForeignKey( + name: "FK_Core_StateOrProvince_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_Entity", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + EntityId = table.Column(type: "bigint", nullable: false), + EntityTypeId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Entity", x => x.Id); + table.ForeignKey( + name: "FK_Core_Entity_Core_EntityType_EntityTypeId", + column: x => x.EntityTypeId, + principalTable: "Core_EntityType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Category", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "text", nullable: true), + Description = table.Column(type: "text", nullable: true), + DisplayOrder = table.Column(type: "integer", nullable: false), + IsPublished = table.Column(type: "boolean", nullable: false), + IncludeInMenu = table.Column(type: "boolean", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + ParentId = table.Column(type: "bigint", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Category", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_Category_Catalog_Category_ParentId", + column: x => x.ParentId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Category_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_RoleClaim", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RoleId = table.Column(type: "bigint", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_RoleClaim", x => x.Id); + table.ForeignKey( + name: "FK_Core_RoleClaim_Core_Role_RoleId", + column: x => x.RoleId, + principalTable: "Core_Role", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_WidgetInstance", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + PublishStart = table.Column(type: "timestamp with time zone", nullable: true), + PublishEnd = table.Column(type: "timestamp with time zone", nullable: true), + WidgetId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + WidgetZoneId = table.Column(type: "bigint", nullable: false), + DisplayOrder = table.Column(type: "integer", nullable: false), + Data = table.Column(type: "text", nullable: true), + HtmlData = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_WidgetInstance", x => x.Id); + table.ForeignKey( + name: "FK_Core_WidgetInstance_Core_Widget_WidgetId", + column: x => x.WidgetId, + principalTable: "Core_Widget", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_WidgetInstance_Core_WidgetZone_WidgetZoneId", + column: x => x.WidgetZoneId, + principalTable: "Core_WidgetZone", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Localization_LocalizedContentProperty", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + EntityId = table.Column(type: "bigint", nullable: false), + EntityType = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CultureId = table.Column(type: "text", nullable: false), + ProperyName = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_LocalizedContentProperty", x => x.Id); + table.ForeignKey( + name: "FK_Localization_LocalizedContentProperty_Localization_Culture_~", + column: x => x.CultureId, + principalTable: "Localization_Culture", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Localization_Resource", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Key = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Value = table.Column(type: "text", nullable: true), + CultureId = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_Resource", x => x.Id); + table.ForeignKey( + name: "FK_Localization_Resource_Localization_Culture_CultureId", + column: x => x.CultureId, + principalTable: "Localization_Culture", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleCustomerGroup", + columns: table => new + { + CartRuleId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleCustomerGroup", x => new { x.CartRuleId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleCustomerGroup_Core_CustomerGroup_CustomerGr~", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleCustomerGroup_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_Coupon", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CartRuleId = table.Column(type: "bigint", nullable: false), + Code = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_Coupon", x => x.Id); + table.ForeignKey( + name: "FK_Pricing_Coupon_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CatalogRuleCustomerGroup", + columns: table => new + { + CatalogRuleId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CatalogRuleCustomerGroup", x => new { x.CatalogRuleId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Pricing_CatalogRuleCustomerGroup_Core_CustomerGroup_Custome~", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CatalogRuleCustomerGroup_Pricing_CatalogRule_Catalo~", + column: x => x.CatalogRuleId, + principalTable: "Pricing_CatalogRule", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductTemplateProductAttribute", + columns: table => new + { + ProductTemplateId = table.Column(type: "bigint", nullable: false), + ProductAttributeId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductTemplateProductAttribute", x => new { x.ProductTemplateId, x.ProductAttributeId }); + table.ForeignKey( + name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductAttr~", + column: x => x.ProductAttributeId, + principalTable: "Catalog_ProductAttribute", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductTemp~", + column: x => x.ProductTemplateId, + principalTable: "Catalog_ProductTemplate", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_District", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Type = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Location = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_District", x => x.Id); + table.ForeignKey( + name: "FK_Core_District_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Tax_TaxRate", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TaxClassId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: true), + Rate = table.Column(type: "numeric(18,2)", nullable: false), + ZipCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Tax_TaxRate", x => x.Id); + table.ForeignKey( + name: "FK_Tax_TaxRate_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Tax_TaxRate_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Tax_TaxRate_Tax_TaxClass_TaxClassId", + column: x => x.TaxClassId, + principalTable: "Tax_TaxClass", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Cms_MenuItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ParentId = table.Column(type: "bigint", nullable: true), + MenuId = table.Column(type: "bigint", nullable: false), + EntityId = table.Column(type: "bigint", nullable: true), + CustomLink = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DisplayOrder = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_MenuItem", x => x.Id); + table.ForeignKey( + name: "FK_Cms_MenuItem_Cms_Menu_MenuId", + column: x => x.MenuId, + principalTable: "Cms_Menu", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Cms_MenuItem_Cms_MenuItem_ParentId", + column: x => x.ParentId, + principalTable: "Cms_MenuItem", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Cms_MenuItem_Core_Entity_EntityId", + column: x => x.EntityId, + principalTable: "Core_Entity", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleCategory", + columns: table => new + { + CategoryId = table.Column(type: "bigint", nullable: false), + CartRuleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleCategory", x => new { x.CartRuleId, x.CategoryId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleCategory_Catalog_Category_CategoryId", + column: x => x.CategoryId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleCategory_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_Address", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContactName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Phone = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + AddressLine1 = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + AddressLine2 = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + City = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ZipCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Address", x => x.Id); + table.ForeignKey( + name: "FK_Core_Address_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_Address_Core_District_DistrictId", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_Address_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderAddress", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContactName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Phone = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + AddressLine1 = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + AddressLine2 = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + City = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ZipCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderAddress", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_District_DistrictId", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShippingTableRate_PriceAndDestination", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CountryId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + ZipCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Note = table.Column(type: "text", nullable: true), + MinOrderSubtotal = table.Column(type: "numeric(18,2)", nullable: false), + ShippingPrice = table.Column(type: "numeric(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ShippingTableRate_PriceAndDestination", x => x.Id); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_District_Distric~", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_StateOrProvince_~", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Inventory_Warehouse", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + AddressId = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_Warehouse", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_Warehouse_Core_Address_AddressId", + column: x => x.AddressId, + principalTable: "Core_Address", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_Warehouse_Core_Vendor_VendorId", + column: x => x.VendorId, + principalTable: "Core_Vendor", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Product", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ShortDescription = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Description = table.Column(type: "text", nullable: true), + Specification = table.Column(type: "text", nullable: true), + Price = table.Column(type: "numeric(18,2)", nullable: false), + OldPrice = table.Column(type: "numeric(18,2)", nullable: true), + SpecialPrice = table.Column(type: "numeric(18,2)", nullable: true), + SpecialPriceStart = table.Column(type: "timestamp with time zone", nullable: true), + SpecialPriceEnd = table.Column(type: "timestamp with time zone", nullable: true), + HasOptions = table.Column(type: "boolean", nullable: false), + IsVisibleIndividually = table.Column(type: "boolean", nullable: false), + IsFeatured = table.Column(type: "boolean", nullable: false), + IsCallForPricing = table.Column(type: "boolean", nullable: false), + IsAllowToOrder = table.Column(type: "boolean", nullable: false), + StockTrackingIsEnabled = table.Column(type: "boolean", nullable: false), + StockQuantity = table.Column(type: "integer", nullable: false), + Sku = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Gtin = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + NormalizedName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DisplayOrder = table.Column(type: "integer", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true), + ReviewsCount = table.Column(type: "integer", nullable: false), + RatingAverage = table.Column(type: "double precision", nullable: true), + BrandId = table.Column(type: "bigint", nullable: true), + TaxClassId = table.Column(type: "bigint", nullable: true), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "text", nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + PublishedOn = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Product", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_Product_Catalog_Brand_BrandId", + column: x => x.BrandId, + principalTable: "Catalog_Brand", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Product_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Product_Tax_TaxClass_TaxClassId", + column: x => x.TaxClassId, + principalTable: "Tax_TaxClass", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttributeValue", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + AttributeId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttributeValue", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductAttributeValue_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductAttributeValue_Catalog_ProductAttribute_Attr~", + column: x => x.AttributeId, + principalTable: "Catalog_ProductAttribute", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductCategory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + IsFeaturedProduct = table.Column(type: "boolean", nullable: false), + DisplayOrder = table.Column(type: "integer", nullable: false), + CategoryId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductCategory", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductCategory_Catalog_Category_CategoryId", + column: x => x.CategoryId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductCategory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductLink", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: false), + LinkedProductId = table.Column(type: "bigint", nullable: false), + LinkType = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductLink", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductLink_Catalog_Product_LinkedProductId", + column: x => x.LinkedProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductLink_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductMedia", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: false), + MediaId = table.Column(type: "bigint", nullable: false), + DisplayOrder = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductMedia", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductMedia_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductMedia_Core_Media_MediaId", + column: x => x.MediaId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOptionCombination", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: false), + OptionId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + SortIndex = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOptionCombination", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductOptionCombination_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductOptionCombination_Catalog_ProductOption_Opti~", + column: x => x.OptionId, + principalTable: "Catalog_ProductOption", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOptionValue", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + OptionId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DisplayType = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + SortIndex = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOptionValue", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductOptionValue_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductOptionValue_Catalog_ProductOption_OptionId", + column: x => x.OptionId, + principalTable: "Catalog_ProductOption", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Inventory_Stock", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: false), + WarehouseId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "integer", nullable: false), + ReservedQuantity = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_Stock", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_Stock_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_Stock_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleProduct", + columns: table => new + { + ProductId = table.Column(type: "bigint", nullable: false), + CartRuleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleProduct", x => new { x.CartRuleId, x.ProductId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleProduct_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleProduct_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductPriceHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: true), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + Price = table.Column(type: "numeric(18,2)", nullable: true), + OldPrice = table.Column(type: "numeric(18,2)", nullable: true), + SpecialPrice = table.Column(type: "numeric(18,2)", nullable: true), + SpecialPriceStart = table.Column(type: "timestamp with time zone", nullable: true), + SpecialPriceEnd = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductPriceHistory", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductPriceHistory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Cms_Page", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Body = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "text", nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + PublishedOn = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_Page", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Comments_Comment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + CommentText = table.Column(type: "text", nullable: true), + CommenterName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "integer", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + EntityTypeId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + EntityId = table.Column(type: "bigint", nullable: false), + ParentId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Comments_Comment", x => x.Id); + table.ForeignKey( + name: "FK_Comments_Comment_Comments_Comment_ParentId", + column: x => x.ParentId, + principalTable: "Comments_Comment", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_CustomerGroupUser", + columns: table => new + { + UserId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_CustomerGroupUser", x => new { x.UserId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Core_CustomerGroupUser_Core_CustomerGroup_CustomerGroupId", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_User", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserGuid = table.Column(type: "uuid", nullable: false), + FullName = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + DefaultShippingAddressId = table.Column(type: "bigint", nullable: true), + DefaultBillingAddressId = table.Column(type: "bigint", nullable: true), + RefreshTokenHash = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Culture = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ExtensionData = table.Column(type: "text", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + EmailConfirmed = table.Column(type: "boolean", nullable: false), + PasswordHash = table.Column(type: "text", nullable: true), + SecurityStamp = table.Column(type: "text", nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true), + PhoneNumber = table.Column(type: "text", nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false), + AccessFailedCount = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_User", x => x.Id); + table.ForeignKey( + name: "FK_Core_User_Core_Vendor_VendorId", + column: x => x.VendorId, + principalTable: "Core_Vendor", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserAddress", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + AddressId = table.Column(type: "bigint", nullable: false), + AddressType = table.Column(type: "integer", nullable: false), + LastUsedOn = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserAddress", x => x.Id); + table.ForeignKey( + name: "FK_Core_UserAddress_Core_Address_AddressId", + column: x => x.AddressId, + principalTable: "Core_Address", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_UserAddress_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserClaim", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserClaim", x => x.Id); + table.ForeignKey( + name: "FK_Core_UserClaim_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_UserLogin", + columns: table => new + { + LoginProvider = table.Column(type: "text", nullable: false), + ProviderKey = table.Column(type: "text", nullable: false), + ProviderDisplayName = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserLogin", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_Core_UserLogin_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_UserRole", + columns: table => new + { + UserId = table.Column(type: "bigint", nullable: false), + RoleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserRole", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_Core_UserRole_Core_Role_RoleId", + column: x => x.RoleId, + principalTable: "Core_Role", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_UserRole_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserToken", + columns: table => new + { + UserId = table.Column(type: "bigint", nullable: false), + LoginProvider = table.Column(type: "text", nullable: false), + Name = table.Column(type: "text", nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserToken", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_Core_UserToken_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Inventory_StockHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProductId = table.Column(type: "bigint", nullable: false), + WarehouseId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + AdjustedQuantity = table.Column(type: "bigint", nullable: false), + Note = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_StockHistory", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "News_NewsItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ShortContent = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + FullContent = table.Column(type: "text", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true), + Name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "text", nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + PublishedOn = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsItem", x => x.Id); + table.ForeignKey( + name: "FK_News_NewsItem_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_News_NewsItem_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_News_NewsItem_Core_User_LatestUpdatedById", + column: x => x.LatestUpdatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_Order", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CustomerId = table.Column(type: "bigint", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + CouponCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CouponRuleName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "numeric(18,2)", nullable: false), + SubTotal = table.Column(type: "numeric(18,2)", nullable: false), + SubTotalWithDiscount = table.Column(type: "numeric(18,2)", nullable: false), + ShippingAddressId = table.Column(type: "bigint", nullable: false), + BillingAddressId = table.Column(type: "bigint", nullable: false), + OrderStatus = table.Column(type: "integer", nullable: false), + OrderNote = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + ParentId = table.Column(type: "bigint", nullable: true), + IsMasterOrder = table.Column(type: "boolean", nullable: false), + ShippingMethod = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ShippingFeeAmount = table.Column(type: "numeric(18,2)", nullable: false), + TaxAmount = table.Column(type: "numeric(18,2)", nullable: false), + OrderTotal = table.Column(type: "numeric(18,2)", nullable: false), + PaymentMethod = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + PaymentFeeAmount = table.Column(type: "numeric(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_Order", x => x.Id); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_CustomerId", + column: x => x.CustomerId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_LatestUpdatedById", + column: x => x.LatestUpdatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_Order_ParentId", + column: x => x.ParentId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_OrderAddress_BillingAddressId", + column: x => x.BillingAddressId, + principalTable: "Orders_OrderAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_OrderAddress_ShippingAddressId", + column: x => x.ShippingAddressId, + principalTable: "Orders_OrderAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleUsage", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CartRuleId = table.Column(type: "bigint", nullable: false), + CouponId = table.Column(type: "bigint", nullable: true), + UserId = table.Column(type: "bigint", nullable: false), + OrderId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleUsage", x => x.Id); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Pricing_Coupon_CouponId", + column: x => x.CouponId, + principalTable: "Pricing_Coupon", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ProductComparison_ComparingProduct", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProductComparison_ComparingProduct", x => x.Id); + table.ForeignKey( + name: "FK_ProductComparison_ComparingProduct_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ProductComparison_ComparingProduct_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Reviews_Review", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + Title = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Comment = table.Column(type: "text", nullable: true), + Rating = table.Column(type: "integer", nullable: false), + ReviewerName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "integer", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + EntityTypeId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + EntityId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Reviews_Review", x => x.Id); + table.ForeignKey( + name: "FK_Reviews_Review_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShoppingCart_Cart", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CustomerId = table.Column(type: "bigint", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + IsActive = table.Column(type: "boolean", nullable: false), + LockedOnCheckout = table.Column(type: "boolean", nullable: false), + CouponCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CouponRuleName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + ShippingMethod = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + IsProductPriceIncludeTax = table.Column(type: "boolean", nullable: false), + ShippingAmount = table.Column(type: "numeric(18,2)", nullable: true), + TaxAmount = table.Column(type: "numeric(18,2)", nullable: true), + ShippingData = table.Column(type: "text", nullable: true), + OrderNote = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ShoppingCart_Cart", x => x.Id); + table.ForeignKey( + name: "FK_ShoppingCart_Cart_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShoppingCart_Cart_Core_User_CustomerId", + column: x => x.CustomerId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "WishList_WishList", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "bigint", nullable: false), + SharingCode = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WishList_WishList", x => x.Id); + table.ForeignKey( + name: "FK_WishList_WishList_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "News_NewsItemCategory", + columns: table => new + { + CategoryId = table.Column(type: "bigint", nullable: false), + NewsItemId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsItemCategory", x => new { x.CategoryId, x.NewsItemId }); + table.ForeignKey( + name: "FK_News_NewsItemCategory_News_NewsCategory_CategoryId", + column: x => x.CategoryId, + principalTable: "News_NewsCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_News_NewsItemCategory_News_NewsItem_NewsItemId", + column: x => x.NewsItemId, + principalTable: "News_NewsItem", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + OrderId = table.Column(type: "bigint", nullable: false), + OldStatus = table.Column(type: "integer", nullable: true), + NewStatus = table.Column(type: "integer", nullable: false), + OrderSnapshot = table.Column(type: "text", nullable: true), + Note = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderHistory", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderHistory_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderHistory_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + OrderId = table.Column(type: "bigint", nullable: true), + ProductId = table.Column(type: "bigint", nullable: false), + ProductPrice = table.Column(type: "numeric(18,2)", nullable: false), + Quantity = table.Column(type: "integer", nullable: false), + DiscountAmount = table.Column(type: "numeric(18,2)", nullable: false), + TaxAmount = table.Column(type: "numeric(18,2)", nullable: false), + TaxPercent = table.Column(type: "numeric(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderItem", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderItem_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Payments_Payment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + OrderId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + Amount = table.Column(type: "numeric(18,2)", nullable: false), + PaymentFee = table.Column(type: "numeric(18,2)", nullable: false), + PaymentMethod = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + GatewayTransactionId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "integer", nullable: false), + FailureMessage = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payments_Payment", x => x.Id); + table.ForeignKey( + name: "FK_Payments_Payment_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Shipments_Shipment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + OrderId = table.Column(type: "bigint", nullable: false), + TrackingNumber = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + WarehouseId = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipments_Shipment", x => x.Id); + table.ForeignKey( + name: "FK_Shipments_Shipment_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_Shipment_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_Shipment_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Reviews_Reply", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ReviewId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + Comment = table.Column(type: "text", nullable: true), + ReplierName = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "integer", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Reviews_Reply", x => x.Id); + table.ForeignKey( + name: "FK_Reviews_Reply_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Reviews_Reply_Reviews_Review_ReviewId", + column: x => x.ReviewId, + principalTable: "Reviews_Review", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShoppingCart_CartItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "integer", nullable: false), + CartId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ShoppingCart_CartItem", x => x.Id); + table.ForeignKey( + name: "FK_ShoppingCart_CartItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShoppingCart_CartItem_ShoppingCart_Cart_CartId", + column: x => x.CartId, + principalTable: "ShoppingCart_Cart", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "WishList_WishListItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + WishListId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Description = table.Column(type: "text", nullable: true), + Quantity = table.Column(type: "integer", nullable: false), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + LatestUpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WishList_WishListItem", x => x.Id); + table.ForeignKey( + name: "FK_WishList_WishListItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_WishList_WishListItem_WishList_WishList_WishListId", + column: x => x.WishListId, + principalTable: "WishList_WishList", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Shipments_ShipmentItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ShipmentId = table.Column(type: "bigint", nullable: false), + OrderItemId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipments_ShipmentItem", x => x.Id); + table.ForeignKey( + name: "FK_Shipments_ShipmentItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_ShipmentItem_Shipments_Shipment_ShipmentId", + column: x => x.ShipmentId, + principalTable: "Shipments_Shipment", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.InsertData( + table: "ActivityLog_ActivityType", + columns: new[] { "Id", "Name" }, + values: new object[] { 1L, "EntityView" }); + + migrationBuilder.InsertData( + table: "Catalog_ProductOption", + columns: new[] { "Id", "Name" }, + values: new object[,] + { + { 1L, "Color" }, + { 2L, "Size" } + }); + + migrationBuilder.InsertData( + table: "Cms_Menu", + columns: new[] { "Id", "IsPublished", "IsSystem", "Name" }, + values: new object[,] + { + { 1L, true, true, "Customer Services" }, + { 2L, true, true, "Information" } + }); + + migrationBuilder.InsertData( + table: "Core_AppSetting", + columns: new[] { "Id", "IsVisibleInCommonSettingPage", "Module", "Value" }, + values: new object[,] + { + { "Catalog.IsCommentsRequireApproval", true, "Catalog", "true" }, + { "Catalog.IsProductPriceIncludeTax", true, "Catalog", "true" }, + { "Catalog.ProductPageSize", true, "Catalog", "10" }, + { "Global.AssetBundling", true, "Core", "false" }, + { "Global.AssetVersion", true, "Core", "1.0" }, + { "Global.CurrencyCulture", true, "Core", "en-US" }, + { "Global.CurrencyDecimalPlace", true, "Core", "2" }, + { "Global.DefaultCultureAdminUI", true, "Core", "en-US" }, + { "Global.DefaultCultureUI", true, "Core", "en-US" }, + { "GoogleAppKey", false, "Contact", "" }, + { "Localization.LocalizedConentEnable", true, "Localization", "true" }, + { "News.PageSize", true, "News", "10" }, + { "SmtpPassword", false, "EmailSenderSmpt", "" }, + { "SmtpPort", false, "EmailSenderSmpt", "587" }, + { "SmtpServer", false, "EmailSenderSmpt", "smtp.gmail.com" }, + { "SmtpUsername", false, "EmailSenderSmpt", "" }, + { "Tax.DefaultTaxClassId", true, "Tax", "1" }, + { "Theme", false, "Core", "Generic" } + }); + + migrationBuilder.InsertData( + table: "Core_Country", + columns: new[] { "Id", "Code3", "IsBillingEnabled", "IsCityEnabled", "IsDistrictEnabled", "IsShippingEnabled", "IsZipCodeEnabled", "Name" }, + values: new object[,] + { + { "US", "USA", true, true, false, true, true, "United States" }, + { "VN", "VNM", true, false, true, true, false, "Việt Nam" } + }); + + migrationBuilder.InsertData( + table: "Core_EntityType", + columns: new[] { "Id", "AreaName", "IsMenuable", "RoutingAction", "RoutingController" }, + values: new object[,] + { + { "Brand", "Catalog", true, "BrandDetail", "Brand" }, + { "Category", "Catalog", true, "CategoryDetail", "Category" }, + { "NewsCategory", "News", true, "NewsCategoryDetail", "NewsCategory" }, + { "NewsItem", "News", false, "NewsItemDetail", "NewsItem" }, + { "Page", "Cms", true, "PageDetail", "Page" }, + { "Product", "Catalog", false, "ProductDetail", "Product" }, + { "Vendor", "Core", false, "VendorDetail", "Vendor" } + }); + + migrationBuilder.InsertData( + table: "Core_Role", + columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, + values: new object[,] + { + { 1L, "4776a1b2-dbe4-4056-82ec-8bed211d1454", "admin", "ADMIN" }, + { 2L, "00d172be-03a0-4856-8b12-26d63fcf4374", "customer", "CUSTOMER" }, + { 3L, "d4754388-8355-4018-b728-218018836817", "guest", "GUEST" }, + { 4L, "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", "vendor", "VENDOR" } + }); + + migrationBuilder.InsertData( + table: "Core_User", + columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "CreatedOn", "Culture", "DefaultBillingAddressId", "DefaultShippingAddressId", "Email", "EmailConfirmed", "ExtensionData", "FullName", "IsDeleted", "LatestUpdatedOn", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "RefreshTokenHash", "SecurityStamp", "TwoFactorEnabled", "UserGuid", "UserName", "VendorId" }, + values: new object[,] + { + { 2L, 0, "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "system@simplcommerce.com", false, null, "System User", true, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "SYSTEM@SIMPLCOMMERCE.COM", "SYSTEM@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "a9565acb-cee6-425f-9833-419a793f5fba", false, new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), "system@simplcommerce.com", null }, + { 10L, 0, "c83afcbc-312c-4589-bad7-8686bd4754c0", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "admin@simplcommerce.com", false, null, "Shop Admin", false, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "ADMIN@SIMPLCOMMERCE.COM", "ADMIN@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "d6847450-47f0-4c7a-9fed-0c66234bf61f", false, new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), "admin@simplcommerce.com", null } + }); + + migrationBuilder.InsertData( + table: "Core_Widget", + columns: new[] { "Id", "CreateUrl", "CreatedOn", "EditUrl", "IsPublished", "Name", "ViewComponentName" }, + values: new object[,] + { + { "CarouselWidget", "widget-carousel-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-carousel-edit", false, "Carousel Widget", "CarouselWidget" }, + { "CategoryWidget", "widget-category-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-category-edit", false, "Category Widget", "CategoryWidget" }, + { "HtmlWidget", "widget-html-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-html-edit", false, "Html Widget", "HtmlWidget" }, + { "ProductWidget", "widget-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-product-edit", false, "Product Widget", "ProductWidget" }, + { "RecentlyViewedWidget", "widget-recently-viewed-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-recently-viewed-edit", false, "Recently Viewed Widget", "RecentlyViewedWidget" }, + { "SimpleProductWidget", "widget-simple-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-simple-product-edit", false, "Simple Product Widget", "SimpleProductWidget" }, + { "SpaceBarWidget", "widget-spacebar-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-spacebar-edit", false, "SpaceBar Widget", "SpaceBarWidget" } + }); + + migrationBuilder.InsertData( + table: "Core_WidgetZone", + columns: new[] { "Id", "Description", "Name" }, + values: new object[,] + { + { 1L, null, "Home Featured" }, + { 2L, null, "Home Main Content" }, + { 3L, null, "Home After Main Content" } + }); + + migrationBuilder.InsertData( + table: "Localization_Culture", + columns: new[] { "Id", "Name" }, + values: new object[] { "en-US", "English (US)" }); + + migrationBuilder.InsertData( + table: "Payments_PaymentProvider", + columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "LandingViewComponentName", "Name" }, + values: new object[,] + { + { "Braintree", "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", "payments-braintree-config", true, "BraintreeLanding", "Braintree" }, + { "Cashfree", "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", "payments-cashfree-config", true, "CashfreeLanding", "Cashfree Payment Gateway" }, + { "CoD", null, "payments-cod-config", true, "CoDLanding", "Cash On Delivery" }, + { "MomoPayment", "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", "payments-momo-config", true, "MomoLanding", "Momo Payment" }, + { "NganLuong", "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", "payments-nganluong-config", true, "NganLuongLanding", "Ngan Luong Payment" }, + { "PaypalExpress", "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", "payments-paypalExpress-config", true, "PaypalExpressLanding", "Paypal Express" }, + { "Stripe", "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", "payments-stripe-config", true, "StripeLanding", "Stripe" } + }); + + migrationBuilder.InsertData( + table: "Shipping_ShippingProvider", + columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "Name", "OnlyCountryIdsString", "OnlyStateOrProvinceIdsString", "ShippingPriceServiceTypeName", "ToAllShippingEnabledCountries", "ToAllShippingEnabledStatesOrProvinces" }, + values: new object[,] + { + { "FreeShip", "{MinimumOrderAmount : 1}", "", true, "Free Ship", null, null, "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", true, true }, + { "TableRate", null, "shipping-table-rate-config", true, "Table Rate", null, null, "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", true, true } + }); + + migrationBuilder.InsertData( + table: "Tax_TaxClass", + columns: new[] { "Id", "Name" }, + values: new object[] { 1L, "Standard VAT" }); + + migrationBuilder.InsertData( + table: "Core_StateOrProvince", + columns: new[] { "Id", "Code", "CountryId", "Name", "Type" }, + values: new object[,] + { + { 1L, null, "VN", "Hồ Chí Minh", "Thành Phố" }, + { 2L, "WA", "US", "Washington", null } + }); + + migrationBuilder.InsertData( + table: "Core_UserRole", + columns: new[] { "RoleId", "UserId" }, + values: new object[] { 1L, 10L }); + + migrationBuilder.InsertData( + table: "Core_Address", + columns: new[] { "Id", "AddressLine1", "AddressLine2", "City", "ContactName", "CountryId", "DistrictId", "Phone", "StateOrProvinceId", "ZipCode" }, + values: new object[] { 1L, "364 Cong Hoa", null, null, "Thien Nguyen", "VN", null, null, 1L, null }); + + migrationBuilder.InsertData( + table: "Core_District", + columns: new[] { "Id", "Location", "Name", "StateOrProvinceId", "Type" }, + values: new object[,] + { + { 1L, null, "Quận 1", 1L, "Quận" }, + { 2L, null, "Quận 2", 1L, "Quận" } + }); + + migrationBuilder.InsertData( + table: "Inventory_Warehouse", + columns: new[] { "Id", "AddressId", "Name", "VendorId" }, + values: new object[] { 1L, 1L, "Default warehouse", null }); + + migrationBuilder.CreateIndex( + name: "IX_ActivityLog_Activity_ActivityTypeId", + table: "ActivityLog_Activity", + column: "ActivityTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Category_ParentId", + table: "Catalog_Category", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Category_ThumbnailImageId", + table: "Catalog_Category", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_BrandId", + table: "Catalog_Product", + column: "BrandId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_CreatedById", + table: "Catalog_Product", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_LatestUpdatedById", + table: "Catalog_Product", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_TaxClassId", + table: "Catalog_Product", + column: "TaxClassId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_ThumbnailImageId", + table: "Catalog_Product", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttribute_GroupId", + table: "Catalog_ProductAttribute", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttributeValue_AttributeId", + table: "Catalog_ProductAttributeValue", + column: "AttributeId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttributeValue_ProductId", + table: "Catalog_ProductAttributeValue", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductCategory_CategoryId", + table: "Catalog_ProductCategory", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductCategory_ProductId", + table: "Catalog_ProductCategory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductLink_LinkedProductId", + table: "Catalog_ProductLink", + column: "LinkedProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductLink_ProductId", + table: "Catalog_ProductLink", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductMedia_MediaId", + table: "Catalog_ProductMedia", + column: "MediaId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductMedia_ProductId", + table: "Catalog_ProductMedia", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionCombination_OptionId", + table: "Catalog_ProductOptionCombination", + column: "OptionId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionCombination_ProductId", + table: "Catalog_ProductOptionCombination", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionValue_OptionId", + table: "Catalog_ProductOptionValue", + column: "OptionId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionValue_ProductId", + table: "Catalog_ProductOptionValue", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductPriceHistory_CreatedById", + table: "Catalog_ProductPriceHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductPriceHistory_ProductId", + table: "Catalog_ProductPriceHistory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductTemplateProductAttribute_ProductAttributeId", + table: "Catalog_ProductTemplateProductAttribute", + column: "ProductAttributeId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_EntityId", + table: "Cms_MenuItem", + column: "EntityId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_MenuId", + table: "Cms_MenuItem", + column: "MenuId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_ParentId", + table: "Cms_MenuItem", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_Page_CreatedById", + table: "Cms_Page", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_Page_LatestUpdatedById", + table: "Cms_Page", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Comments_Comment_ParentId", + table: "Comments_Comment", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Comments_Comment_UserId", + table: "Comments_Comment", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Contacts_Contact_ContactAreaId", + table: "Contacts_Contact", + column: "ContactAreaId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_CountryId", + table: "Core_Address", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_DistrictId", + table: "Core_Address", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_StateOrProvinceId", + table: "Core_Address", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_CustomerGroup_Name", + table: "Core_CustomerGroup", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Core_CustomerGroupUser_CustomerGroupId", + table: "Core_CustomerGroupUser", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_District_StateOrProvinceId", + table: "Core_District", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Entity_EntityTypeId", + table: "Core_Entity", + column: "EntityTypeId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "Core_Role", + column: "NormalizedName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Core_RoleClaim_RoleId", + table: "Core_RoleClaim", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_StateOrProvince_CountryId", + table: "Core_StateOrProvince", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "Core_User", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_DefaultBillingAddressId", + table: "Core_User", + column: "DefaultBillingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_DefaultShippingAddressId", + table: "Core_User", + column: "DefaultShippingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_VendorId", + table: "Core_User", + column: "VendorId"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "Core_User", + column: "NormalizedUserName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserAddress_AddressId", + table: "Core_UserAddress", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserAddress_UserId", + table: "Core_UserAddress", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserClaim_UserId", + table: "Core_UserClaim", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserLogin_UserId", + table: "Core_UserLogin", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserRole_RoleId", + table: "Core_UserRole", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_WidgetInstance_WidgetId", + table: "Core_WidgetInstance", + column: "WidgetId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_WidgetInstance_WidgetZoneId", + table: "Core_WidgetInstance", + column: "WidgetZoneId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Stock_ProductId", + table: "Inventory_Stock", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Stock_WarehouseId", + table: "Inventory_Stock", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_CreatedById", + table: "Inventory_StockHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_ProductId", + table: "Inventory_StockHistory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_WarehouseId", + table: "Inventory_StockHistory", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Warehouse_AddressId", + table: "Inventory_Warehouse", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Warehouse_VendorId", + table: "Inventory_Warehouse", + column: "VendorId"); + + migrationBuilder.CreateIndex( + name: "IX_Localization_LocalizedContentProperty_CultureId", + table: "Localization_LocalizedContentProperty", + column: "CultureId"); + + migrationBuilder.CreateIndex( + name: "IX_Localization_Resource_CultureId", + table: "Localization_Resource", + column: "CultureId"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_CreatedById", + table: "News_NewsItem", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_LatestUpdatedById", + table: "News_NewsItem", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_ThumbnailImageId", + table: "News_NewsItem", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItemCategory_NewsItemId", + table: "News_NewsItemCategory", + column: "NewsItemId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_BillingAddressId", + table: "Orders_Order", + column: "BillingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_CreatedById", + table: "Orders_Order", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_CustomerId", + table: "Orders_Order", + column: "CustomerId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_LatestUpdatedById", + table: "Orders_Order", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_ParentId", + table: "Orders_Order", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_ShippingAddressId", + table: "Orders_Order", + column: "ShippingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_CountryId", + table: "Orders_OrderAddress", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_DistrictId", + table: "Orders_OrderAddress", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_StateOrProvinceId", + table: "Orders_OrderAddress", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderHistory_CreatedById", + table: "Orders_OrderHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderHistory_OrderId", + table: "Orders_OrderHistory", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderItem_OrderId", + table: "Orders_OrderItem", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderItem_ProductId", + table: "Orders_OrderItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Payments_Payment_OrderId", + table: "Payments_Payment", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleCategory_CategoryId", + table: "Pricing_CartRuleCategory", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleCustomerGroup_CustomerGroupId", + table: "Pricing_CartRuleCustomerGroup", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleProduct_ProductId", + table: "Pricing_CartRuleProduct", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_CartRuleId", + table: "Pricing_CartRuleUsage", + column: "CartRuleId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_CouponId", + table: "Pricing_CartRuleUsage", + column: "CouponId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_UserId", + table: "Pricing_CartRuleUsage", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CatalogRuleCustomerGroup_CustomerGroupId", + table: "Pricing_CatalogRuleCustomerGroup", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_Coupon_CartRuleId", + table: "Pricing_Coupon", + column: "CartRuleId"); + + migrationBuilder.CreateIndex( + name: "IX_ProductComparison_ComparingProduct_ProductId", + table: "ProductComparison_ComparingProduct", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_ProductComparison_ComparingProduct_UserId", + table: "ProductComparison_ComparingProduct", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Reply_ReviewId", + table: "Reviews_Reply", + column: "ReviewId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Reply_UserId", + table: "Reviews_Reply", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Review_UserId", + table: "Reviews_Review", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_CreatedById", + table: "Shipments_Shipment", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_OrderId", + table: "Shipments_Shipment", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_WarehouseId", + table: "Shipments_Shipment", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_ShipmentItem_ProductId", + table: "Shipments_ShipmentItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_ShipmentItem_ShipmentId", + table: "Shipments_ShipmentItem", + column: "ShipmentId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_CountryId", + table: "ShippingTableRate_PriceAndDestination", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_DistrictId", + table: "ShippingTableRate_PriceAndDestination", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_StateOrProvinceId", + table: "ShippingTableRate_PriceAndDestination", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_Cart_CreatedById", + table: "ShoppingCart_Cart", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_Cart_CustomerId", + table: "ShoppingCart_Cart", + column: "CustomerId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_CartItem_CartId", + table: "ShoppingCart_CartItem", + column: "CartId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_CartItem_ProductId", + table: "ShoppingCart_CartItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_CountryId", + table: "Tax_TaxRate", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_StateOrProvinceId", + table: "Tax_TaxRate", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_TaxClassId", + table: "Tax_TaxRate", + column: "TaxClassId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishList_UserId", + table: "WishList_WishList", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishListItem_ProductId", + table: "WishList_WishListItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishListItem_WishListId", + table: "WishList_WishListItem", + column: "WishListId"); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_Product_Core_User_CreatedById", + table: "Catalog_Product", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_Product_Core_User_LatestUpdatedById", + table: "Catalog_Product", + column: "LatestUpdatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_ProductPriceHistory_Core_User_CreatedById", + table: "Catalog_ProductPriceHistory", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Cms_Page_Core_User_CreatedById", + table: "Cms_Page", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Cms_Page_Core_User_LatestUpdatedById", + table: "Cms_Page", + column: "LatestUpdatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Comments_Comment_Core_User_UserId", + table: "Comments_Comment", + column: "UserId", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Core_CustomerGroupUser_Core_User_UserId", + table: "Core_CustomerGroupUser", + column: "UserId", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Core_User_Core_UserAddress_DefaultBillingAddressId", + table: "Core_User", + column: "DefaultBillingAddressId", + principalTable: "Core_UserAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Core_User_Core_UserAddress_DefaultShippingAddressId", + table: "Core_User", + column: "DefaultShippingAddressId", + principalTable: "Core_UserAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Core_UserAddress_Core_User_UserId", + table: "Core_UserAddress"); + + migrationBuilder.DropTable( + name: "ActivityLog_Activity"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttributeValue"); + + migrationBuilder.DropTable( + name: "Catalog_ProductCategory"); + + migrationBuilder.DropTable( + name: "Catalog_ProductLink"); + + migrationBuilder.DropTable( + name: "Catalog_ProductMedia"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOptionCombination"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOptionValue"); + + migrationBuilder.DropTable( + name: "Catalog_ProductPriceHistory"); + + migrationBuilder.DropTable( + name: "Catalog_ProductTemplateProductAttribute"); + + migrationBuilder.DropTable( + name: "Cms_MenuItem"); + + migrationBuilder.DropTable( + name: "Cms_Page"); + + migrationBuilder.DropTable( + name: "Comments_Comment"); + + migrationBuilder.DropTable( + name: "Contacts_Contact"); + + migrationBuilder.DropTable( + name: "Core_AppSetting"); + + migrationBuilder.DropTable( + name: "Core_CustomerGroupUser"); + + migrationBuilder.DropTable( + name: "Core_RoleClaim"); + + migrationBuilder.DropTable( + name: "Core_UserClaim"); + + migrationBuilder.DropTable( + name: "Core_UserLogin"); + + migrationBuilder.DropTable( + name: "Core_UserRole"); + + migrationBuilder.DropTable( + name: "Core_UserToken"); + + migrationBuilder.DropTable( + name: "Core_WidgetInstance"); + + migrationBuilder.DropTable( + name: "Inventory_Stock"); + + migrationBuilder.DropTable( + name: "Inventory_StockHistory"); + + migrationBuilder.DropTable( + name: "Localization_LocalizedContentProperty"); + + migrationBuilder.DropTable( + name: "Localization_Resource"); + + migrationBuilder.DropTable( + name: "News_NewsItemCategory"); + + migrationBuilder.DropTable( + name: "Orders_OrderHistory"); + + migrationBuilder.DropTable( + name: "Orders_OrderItem"); + + migrationBuilder.DropTable( + name: "Payments_Payment"); + + migrationBuilder.DropTable( + name: "Payments_PaymentProvider"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleCategory"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleCustomerGroup"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleProduct"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleUsage"); + + migrationBuilder.DropTable( + name: "Pricing_CatalogRuleCustomerGroup"); + + migrationBuilder.DropTable( + name: "ProductComparison_ComparingProduct"); + + migrationBuilder.DropTable( + name: "ProductRecentlyViewed_RecentlyViewedProduct"); + + migrationBuilder.DropTable( + name: "Reviews_Reply"); + + migrationBuilder.DropTable( + name: "Search_Query"); + + migrationBuilder.DropTable( + name: "Shipments_ShipmentItem"); + + migrationBuilder.DropTable( + name: "Shipping_ShippingProvider"); + + migrationBuilder.DropTable( + name: "ShippingTableRate_PriceAndDestination"); + + migrationBuilder.DropTable( + name: "ShoppingCart_CartItem"); + + migrationBuilder.DropTable( + name: "Tax_TaxRate"); + + migrationBuilder.DropTable( + name: "WishList_WishListItem"); + + migrationBuilder.DropTable( + name: "ActivityLog_ActivityType"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOption"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttribute"); + + migrationBuilder.DropTable( + name: "Catalog_ProductTemplate"); + + migrationBuilder.DropTable( + name: "Cms_Menu"); + + migrationBuilder.DropTable( + name: "Core_Entity"); + + migrationBuilder.DropTable( + name: "Contacts_ContactArea"); + + migrationBuilder.DropTable( + name: "Core_Role"); + + migrationBuilder.DropTable( + name: "Core_Widget"); + + migrationBuilder.DropTable( + name: "Core_WidgetZone"); + + migrationBuilder.DropTable( + name: "Localization_Culture"); + + migrationBuilder.DropTable( + name: "News_NewsCategory"); + + migrationBuilder.DropTable( + name: "News_NewsItem"); + + migrationBuilder.DropTable( + name: "Catalog_Category"); + + migrationBuilder.DropTable( + name: "Pricing_Coupon"); + + migrationBuilder.DropTable( + name: "Core_CustomerGroup"); + + migrationBuilder.DropTable( + name: "Pricing_CatalogRule"); + + migrationBuilder.DropTable( + name: "Reviews_Review"); + + migrationBuilder.DropTable( + name: "Shipments_Shipment"); + + migrationBuilder.DropTable( + name: "ShoppingCart_Cart"); + + migrationBuilder.DropTable( + name: "Catalog_Product"); + + migrationBuilder.DropTable( + name: "WishList_WishList"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttributeGroup"); + + migrationBuilder.DropTable( + name: "Core_EntityType"); + + migrationBuilder.DropTable( + name: "Pricing_CartRule"); + + migrationBuilder.DropTable( + name: "Inventory_Warehouse"); + + migrationBuilder.DropTable( + name: "Orders_Order"); + + migrationBuilder.DropTable( + name: "Catalog_Brand"); + + migrationBuilder.DropTable( + name: "Core_Media"); + + migrationBuilder.DropTable( + name: "Tax_TaxClass"); + + migrationBuilder.DropTable( + name: "Orders_OrderAddress"); + + migrationBuilder.DropTable( + name: "Core_User"); + + migrationBuilder.DropTable( + name: "Core_UserAddress"); + + migrationBuilder.DropTable( + name: "Core_Vendor"); + + migrationBuilder.DropTable( + name: "Core_Address"); + + migrationBuilder.DropTable( + name: "Core_District"); + + migrationBuilder.DropTable( + name: "Core_StateOrProvince"); + + migrationBuilder.DropTable( + name: "Core_Country"); + } + } +} diff --git a/src/SimplCommerce.Db.PgSql/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.Db.PgSql/Migrations/SimplDbContextModelSnapshot.cs new file mode 100644 index 0000000000..c872e67bae --- /dev/null +++ b/src/SimplCommerce.Db.PgSql/Migrations/SimplDbContextModelSnapshot.cs @@ -0,0 +1,4687 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SimplCommerce.Module.Core.Data; + +#nullable disable + +namespace SimplCommerce.Db.PgSql.Migrations +{ + [DbContext(typeof(SimplDbContext))] + partial class SimplDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_RoleClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserLogin", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("Core_UserToken", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Localization_Culture", (string)null); + + b.HasData( + new + { + Id = "en-US", + Name = "English (US)" + }); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("text"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ProperyName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_LocalizedContentProperty", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_Resource", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActivityTypeId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeId"); + + b.ToTable("ActivityLog_Activity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("ActivityLog_ActivityType", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "EntityView" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_Brand", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IncludeInMenu") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Category", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BrandId") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("Gtin") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("HasOptions") + .HasColumnType("boolean"); + + b.Property("IsAllowToOrder") + .HasColumnType("boolean"); + + b.Property("IsCallForPricing") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsFeatured") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("IsVisibleIndividually") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("NormalizedName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OldPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Price") + .HasColumnType("numeric(18,2)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("RatingAverage") + .HasColumnType("double precision"); + + b.Property("ReviewsCount") + .HasColumnType("integer"); + + b.Property("ShortDescription") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Sku") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SpecialPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("SpecialPriceStart") + .HasColumnType("timestamp with time zone"); + + b.Property("Specification") + .HasColumnType("text"); + + b.Property("StockQuantity") + .HasColumnType("integer"); + + b.Property("StockTrackingIsEnabled") + .HasColumnType("boolean"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BrandId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("TaxClassId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Product", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Catalog_ProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductAttributeGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AttributeId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("AttributeId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductAttributeValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IsFeaturedProduct") + .HasColumnType("boolean"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LinkType") + .HasColumnType("integer"); + + b.Property("LinkedProductId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LinkedProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductLink", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductMedia", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductOption", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Color" + }, + new + { + Id = 2L, + Name = "Size" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("integer"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionCombination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DisplayType") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("integer"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OldPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Price") + .HasColumnType("numeric(18,2)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SpecialPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("SpecialPriceStart") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductPriceHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductTemplate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.Property("ProductTemplateId") + .HasColumnType("bigint"); + + b.Property("ProductAttributeId") + .HasColumnType("bigint"); + + b.HasKey("ProductTemplateId", "ProductAttributeId"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("IsSystem") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Cms_Menu", (string)null); + + b.HasData( + new + { + Id = 1L, + IsPublished = true, + IsSystem = true, + Name = "Customer Services" + }, + new + { + Id = 2L, + IsPublished = true, + IsSystem = true, + Name = "Information" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CustomLink") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("MenuId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.HasIndex("MenuId"); + + b.HasIndex("ParentId"); + + b.ToTable("Cms_MenuItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .HasColumnType("text"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.ToTable("Cms_Page", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CommentText") + .HasColumnType("text"); + + b.Property("CommenterName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UserId"); + + b.ToTable("Comments_Comment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactAreaId") + .HasColumnType("bigint"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EmailAddress") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FullName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("PhoneNumber") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("ContactAreaId"); + + b.ToTable("Contacts_Contact", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Contacts_ContactArea", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_Address", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressLine1 = "364 Cong Hoa", + ContactName = "Thien Nguyen", + CountryId = "VN", + StateOrProvinceId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("IsVisibleInCommonSettingPage") + .HasColumnType("boolean"); + + b.Property("Module") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_AppSetting", (string)null); + + b.HasData( + new + { + Id = "Catalog.ProductPageSize", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "10" + }, + new + { + Id = "Catalog.IsProductPriceIncludeTax", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "Catalog.IsCommentsRequireApproval", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "GoogleAppKey", + IsVisibleInCommonSettingPage = false, + Module = "Contact", + Value = "" + }, + new + { + Id = "Global.AssetVersion", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "1.0" + }, + new + { + Id = "Global.AssetBundling", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "false" + }, + new + { + Id = "Theme", + IsVisibleInCommonSettingPage = false, + Module = "Core", + Value = "Generic" + }, + new + { + Id = "Global.DefaultCultureUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.DefaultCultureAdminUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyCulture", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyDecimalPlace", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "2" + }, + new + { + Id = "SmtpServer", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "smtp.gmail.com" + }, + new + { + Id = "SmtpPort", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "587" + }, + new + { + Id = "SmtpUsername", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "SmtpPassword", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "Localization.LocalizedConentEnable", + IsVisibleInCommonSettingPage = true, + Module = "Localization", + Value = "true" + }, + new + { + Id = "News.PageSize", + IsVisibleInCommonSettingPage = true, + Module = "News", + Value = "10" + }, + new + { + Id = "Tax.DefaultTaxClassId", + IsVisibleInCommonSettingPage = true, + Module = "Tax", + Value = "1" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Code3") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsBillingEnabled") + .HasColumnType("boolean"); + + b.Property("IsCityEnabled") + .HasColumnType("boolean"); + + b.Property("IsDistrictEnabled") + .HasColumnType("boolean"); + + b.Property("IsShippingEnabled") + .HasColumnType("boolean"); + + b.Property("IsZipCodeEnabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Country", (string)null); + + b.HasData( + new + { + Id = "VN", + Code3 = "VNM", + IsBillingEnabled = true, + IsCityEnabled = false, + IsDistrictEnabled = true, + IsShippingEnabled = true, + IsZipCodeEnabled = false, + Name = "Việt Nam" + }, + new + { + Id = "US", + Code3 = "USA", + IsBillingEnabled = true, + IsCityEnabled = true, + IsDistrictEnabled = false, + IsShippingEnabled = true, + IsZipCodeEnabled = true, + Name = "United States" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Core_CustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Core_CustomerGroupUser", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Location") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_District", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Quận 1", + StateOrProvinceId = 1L, + Type = "Quận" + }, + new + { + Id = 2L, + Name = "Quận 2", + StateOrProvinceId = 1L, + Type = "Quận" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("Core_Entity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AreaName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsMenuable") + .HasColumnType("boolean"); + + b.Property("RoutingAction") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RoutingController") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_EntityType", (string)null); + + b.HasData( + new + { + Id = "Category", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "CategoryDetail", + RoutingController = "Category" + }, + new + { + Id = "Brand", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "BrandDetail", + RoutingController = "Brand" + }, + new + { + Id = "Product", + AreaName = "Catalog", + IsMenuable = false, + RoutingAction = "ProductDetail", + RoutingController = "Product" + }, + new + { + Id = "Page", + AreaName = "Cms", + IsMenuable = true, + RoutingAction = "PageDetail", + RoutingController = "Page" + }, + new + { + Id = "Vendor", + AreaName = "Core", + IsMenuable = false, + RoutingAction = "VendorDetail", + RoutingController = "Vendor" + }, + new + { + Id = "NewsCategory", + AreaName = "News", + IsMenuable = true, + RoutingAction = "NewsCategoryDetail", + RoutingController = "NewsCategory" + }, + new + { + Id = "NewsItem", + AreaName = "News", + IsMenuable = false, + RoutingAction = "NewsItemDetail", + RoutingController = "NewsItem" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FileName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("FileSize") + .HasColumnType("integer"); + + b.Property("MediaType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Core_Media", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("Core_Role", (string)null); + + b.HasData( + new + { + Id = 1L, + ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", + Name = "admin", + NormalizedName = "ADMIN" + }, + new + { + Id = 2L, + ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", + Name = "customer", + NormalizedName = "CUSTOMER" + }, + new + { + Id = 3L, + ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", + Name = "guest", + NormalizedName = "GUEST" + }, + new + { + Id = 4L, + ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", + Name = "vendor", + NormalizedName = "VENDOR" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Code") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.ToTable("Core_StateOrProvince", (string)null); + + b.HasData( + new + { + Id = 1L, + CountryId = "VN", + Name = "Hồ Chí Minh", + Type = "Thành Phố" + }, + new + { + Id = 2L, + Code = "WA", + CountryId = "US", + Name = "Washington" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Culture") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DefaultBillingAddressId") + .HasColumnType("bigint"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("bigint"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("ExtensionData") + .HasColumnType("text"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("RefreshTokenHash") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserGuid") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DefaultBillingAddressId"); + + b.HasIndex("DefaultShippingAddressId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.HasIndex("VendorId"); + + b.ToTable("Core_User", (string)null); + + b.HasData( + new + { + Id = 2L, + AccessFailedCount = 0, + ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "system@simplcommerce.com", + EmailConfirmed = false, + FullName = "System User", + IsDeleted = true, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", + NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", + TwoFactorEnabled = false, + UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), + UserName = "system@simplcommerce.com" + }, + new + { + Id = 10L, + AccessFailedCount = 0, + ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "admin@simplcommerce.com", + EmailConfirmed = false, + FullName = "Shop Admin", + IsDeleted = false, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", + NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", + TwoFactorEnabled = false, + UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), + UserName = "admin@simplcommerce.com" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AddressType") + .HasColumnType("integer"); + + b.Property("LastUsedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_UserRole", (string)null); + + b.HasData( + new + { + UserId = 10L, + RoleId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Vendor", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("CreateUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EditUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ViewComponentName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Widget", (string)null); + + b.HasData( + new + { + Id = "CategoryWidget", + CreateUrl = "widget-category-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-category-edit", + IsPublished = false, + Name = "Category Widget", + ViewComponentName = "CategoryWidget" + }, + new + { + Id = "ProductWidget", + CreateUrl = "widget-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-product-edit", + IsPublished = false, + Name = "Product Widget", + ViewComponentName = "ProductWidget" + }, + new + { + Id = "SimpleProductWidget", + CreateUrl = "widget-simple-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-simple-product-edit", + IsPublished = false, + Name = "Simple Product Widget", + ViewComponentName = "SimpleProductWidget" + }, + new + { + Id = "HtmlWidget", + CreateUrl = "widget-html-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-html-edit", + IsPublished = false, + Name = "Html Widget", + ViewComponentName = "HtmlWidget" + }, + new + { + Id = "CarouselWidget", + CreateUrl = "widget-carousel-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-carousel-edit", + IsPublished = false, + Name = "Carousel Widget", + ViewComponentName = "CarouselWidget" + }, + new + { + Id = "SpaceBarWidget", + CreateUrl = "widget-spacebar-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-spacebar-edit", + IsPublished = false, + Name = "SpaceBar Widget", + ViewComponentName = "SpaceBarWidget" + }, + new + { + Id = "RecentlyViewedWidget", + CreateUrl = "widget-recently-viewed-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-recently-viewed-edit", + IsPublished = false, + Name = "Recently Viewed Widget", + ViewComponentName = "RecentlyViewedWidget" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("HtmlData") + .HasColumnType("text"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("PublishStart") + .HasColumnType("timestamp with time zone"); + + b.Property("WidgetId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("WidgetZoneId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WidgetId"); + + b.HasIndex("WidgetZoneId"); + + b.ToTable("Core_WidgetInstance", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_WidgetZone", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Home Featured" + }, + new + { + Id = 2L, + Name = "Home Main Content" + }, + new + { + Id = 3L, + Name = "Home After Main Content" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("ReservedQuantity") + .HasColumnType("integer"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_Stock", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AdjustedQuantity") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_StockHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("VendorId"); + + b.ToTable("Inventory_Warehouse", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressId = 1L, + Name = "Default warehouse" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayOrder") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("News_NewsCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("FullContent") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ShortContent") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("News_NewsItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("NewsItemId") + .HasColumnType("bigint"); + + b.HasKey("CategoryId", "NewsItemId"); + + b.HasIndex("NewsItemId"); + + b.ToTable("News_NewsItemCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("IsMasterOrder") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OrderStatus") + .HasColumnType("integer"); + + b.Property("OrderTotal") + .HasColumnType("numeric(18,2)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PaymentFeeAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ShippingAddressId") + .HasColumnType("bigint"); + + b.Property("ShippingFeeAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("SubTotal") + .HasColumnType("numeric(18,2)"); + + b.Property("SubTotalWithDiscount") + .HasColumnType("numeric(18,2)"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BillingAddressId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ParentId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Orders_Order", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Orders_OrderAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("NewStatus") + .HasColumnType("integer"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OldStatus") + .HasColumnType("integer"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("OrderSnapshot") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.ToTable("Orders_OrderHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("ProductPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("TaxPercent") + .HasColumnType("numeric(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("Orders_OrderItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("numeric(18,2)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("FailureMessage") + .HasColumnType("text"); + + b.Property("GatewayTransactionId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("PaymentFee") + .HasColumnType("numeric(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("Payments_Payment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AdditionalSettings") + .HasColumnType("text"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("LandingViewComponentName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Payments_PaymentProvider", (string)null); + + b.HasData( + new + { + Id = "Braintree", + AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", + ConfigureUrl = "payments-braintree-config", + IsEnabled = true, + LandingViewComponentName = "BraintreeLanding", + Name = "Braintree" + }, + new + { + Id = "CoD", + ConfigureUrl = "payments-cod-config", + IsEnabled = true, + LandingViewComponentName = "CoDLanding", + Name = "Cash On Delivery" + }, + new + { + Id = "PaypalExpress", + AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", + ConfigureUrl = "payments-paypalExpress-config", + IsEnabled = true, + LandingViewComponentName = "PaypalExpressLanding", + Name = "Paypal Express" + }, + new + { + Id = "Stripe", + AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", + ConfigureUrl = "payments-stripe-config", + IsEnabled = true, + LandingViewComponentName = "StripeLanding", + Name = "Stripe" + }, + new + { + Id = "MomoPayment", + AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", + ConfigureUrl = "payments-momo-config", + IsEnabled = true, + LandingViewComponentName = "MomoLanding", + Name = "Momo Payment" + }, + new + { + Id = "NganLuong", + AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", + ConfigureUrl = "payments-nganluong-config", + IsEnabled = true, + LandingViewComponentName = "NganLuongLanding", + Name = "Ngan Luong Payment" + }, + new + { + Id = "Cashfree", + AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", + ConfigureUrl = "payments-cashfree-config", + IsEnabled = true, + LandingViewComponentName = "CashfreeLanding", + Name = "Cashfree Payment Gateway" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("DiscountStep") + .HasColumnType("integer"); + + b.Property("EndOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsCouponRequired") + .HasColumnType("boolean"); + + b.Property("MaxDiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StartOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UsageLimitPerCoupon") + .HasColumnType("integer"); + + b.Property("UsageLimitPerCustomer") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CartRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CategoryId"); + + b.HasIndex("CategoryId"); + + b.ToTable("Pricing_CartRuleCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Pricing_CartRuleProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CouponId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.HasIndex("CouponId"); + + b.HasIndex("UserId"); + + b.ToTable("Pricing_CartRuleUsage", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("EndOn") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("MaxDiscountAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("StartOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CatalogRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.Property("CatalogRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CatalogRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.ToTable("Pricing_Coupon", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("UserId"); + + b.ToTable("ProductComparison_ComparingProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LatestViewedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplierName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ReviewId"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Reply", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Rating") + .HasColumnType("integer"); + + b.Property("ReviewerName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Title") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Review", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("QueryText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ResultsCount") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Search_Query", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("TrackingNumber") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Shipments_Shipment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OrderItemId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("ShipmentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("ShipmentId"); + + b.ToTable("Shipments_ShipmentItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AdditionalSettings") + .HasColumnType("text"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("OnlyCountryIdsString") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("OnlyStateOrProvinceIdsString") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ShippingPriceServiceTypeName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("ToAllShippingEnabledCountries") + .HasColumnType("boolean"); + + b.Property("ToAllShippingEnabledStatesOrProvinces") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("Shipping_ShippingProvider", (string)null); + + b.HasData( + new + { + Id = "FreeShip", + AdditionalSettings = "{MinimumOrderAmount : 1}", + ConfigureUrl = "", + IsEnabled = true, + Name = "Free Ship", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }, + new + { + Id = "TableRate", + ConfigureUrl = "shipping-table-rate-config", + IsEnabled = true, + Name = "Table Rate", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("MinOrderSubtotal") + .HasColumnType("numeric(18,2)"); + + b.Property("Note") + .HasColumnType("text"); + + b.Property("ShippingPrice") + .HasColumnType("numeric(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsProductPriceIncludeTax") + .HasColumnType("boolean"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockedOnCheckout") + .HasColumnType("boolean"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ShippingAmount") + .HasColumnType("numeric(18,2)"); + + b.Property("ShippingData") + .HasColumnType("text"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("TaxAmount") + .HasColumnType("numeric(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.ToTable("ShoppingCart_Cart", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CartId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CartId"); + + b.HasIndex("ProductId"); + + b.ToTable("ShoppingCart_CartItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.ToTable("Tax_TaxClass", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Standard VAT" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("Rate") + .HasColumnType("numeric(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("StateOrProvinceId"); + + b.HasIndex("TaxClassId"); + + b.ToTable("Tax_TaxRate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("SharingCode") + .HasMaxLength(450) + .HasColumnType("character varying(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("WishList_WishList", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("LatestUpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("integer"); + + b.Property("WishListId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WishListId"); + + b.ToTable("WishList_WishListItem", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany("Resources") + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") + .WithMany() + .HasForeignKey("ActivityTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ActivityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") + .WithMany() + .HasForeignKey("BrandId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Brand"); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("TaxClass"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") + .WithMany("Attributes") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") + .WithMany() + .HasForeignKey("AttributeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("AttributeValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Attribute"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Categories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") + .WithMany("LinkedProductLinks") + .HasForeignKey("LinkedProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("ProductLinks") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("LinkedProduct"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") + .WithMany() + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Medias") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionCombinations") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("PriceHistories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") + .WithMany("ProductTemplates") + .HasForeignKey("ProductAttributeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") + .WithMany("ProductAttributes") + .HasForeignKey("ProductTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProductAttribute"); + + b.Navigation("ProductTemplate"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") + .WithMany("MenuItems") + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Entity"); + + b.Navigation("Menu"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") + .WithMany("Replies") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Parent"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") + .WithMany() + .HasForeignKey("ContactAreaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContactArea"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany("Users") + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("CustomerGroups") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomerGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("EntityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany("StatesOrProvinces") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") + .WithMany() + .HasForeignKey("DefaultBillingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") + .WithMany() + .HasForeignKey("DefaultShippingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) + .WithMany("Users") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("DefaultBillingAddress"); + + b.Navigation("DefaultShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany("UserAddresses") + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("UserAddresses") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") + .WithMany() + .HasForeignKey("WidgetId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") + .WithMany() + .HasForeignKey("WidgetZoneId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Widget"); + + b.Navigation("WidgetZone"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") + .WithMany() + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Address"); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") + .WithMany("NewsItems") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") + .WithMany("Categories") + .HasForeignKey("NewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("NewsItem"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") + .WithMany() + .HasForeignKey("BillingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BillingAddress"); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("Parent"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Categories") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("CustomerGroups") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Products") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany() + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") + .WithMany() + .HasForeignKey("CouponId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Coupon"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") + .WithMany("CustomerGroups") + .HasForeignKey("CatalogRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CatalogRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Coupons") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CartRule"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") + .WithMany("Replies") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") + .WithMany("Items") + .HasForeignKey("ShipmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Shipment"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.HasOne("SimplCommerce.Module.ShoppingCart.Models.Cart", "Cart") + .WithMany("Items") + .HasForeignKey("CartId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Cart"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("StateOrProvince"); + + b.Navigation("TaxClass"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") + .WithMany("Items") + .HasForeignKey("WishListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("WishList"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Navigation("Resources"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Navigation("AttributeValues"); + + b.Navigation("Categories"); + + b.Navigation("LinkedProductLinks"); + + b.Navigation("Medias"); + + b.Navigation("OptionCombinations"); + + b.Navigation("OptionValues"); + + b.Navigation("PriceHistories"); + + b.Navigation("ProductLinks"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Navigation("ProductTemplates"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Navigation("ProductAttributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Navigation("MenuItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Navigation("StatesOrProvinces"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Navigation("CustomerGroups"); + + b.Navigation("Roles"); + + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Navigation("NewsItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Navigation("Categories"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Navigation("Children"); + + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Navigation("Categories"); + + b.Navigation("Coupons"); + + b.Navigation("CustomerGroups"); + + b.Navigation("Products"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Navigation("CustomerGroups"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/SimplCommerce.Db.PgSql/SimplCommerce.Db.PgSql.csproj b/src/SimplCommerce.Db.PgSql/SimplCommerce.Db.PgSql.csproj new file mode 100644 index 0000000000..a9af7b1f10 --- /dev/null +++ b/src/SimplCommerce.Db.PgSql/SimplCommerce.Db.PgSql.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs b/src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs index 6d02c5a3e8..1608c88229 100644 --- a/src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs +++ b/src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs @@ -216,14 +216,6 @@ public static IServiceCollection AddCustomizedIdentity(this IServiceCollection s return services; } - public static IServiceCollection AddCustomizedDataStore(this IServiceCollection services, IConfiguration configuration) - { - services.AddDbContextPool(options => - options.UseSqlServer(configuration.GetConnectionString("DefaultConnection"), - b => b.MigrationsAssembly("SimplCommerce.WebHost"))); - return services; - } - private static void TryLoadModuleAssembly(string moduleFolderPath, ModuleInfo module) { const string binariesFolderName = "bin"; diff --git a/src/SimplCommerce.WebHost/MigrationSimplDbContextFactory.cs b/src/SimplCommerce.WebHost/MigrationSimplDbContextFactory.cs index 8810a45ff8..91418a13aa 100644 --- a/src/SimplCommerce.WebHost/MigrationSimplDbContextFactory.cs +++ b/src/SimplCommerce.WebHost/MigrationSimplDbContextFactory.cs @@ -1,38 +1,38 @@ -using System; -using System.IO; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.EntityFrameworkCore.Design; -using SimplCommerce.Module.Core.Data; -using SimplCommerce.WebHost.Extensions; -using SimplCommerce.Infrastructure; +//using System; +//using System.IO; +//using Microsoft.Extensions.Configuration; +//using Microsoft.Extensions.DependencyInjection; +//using Microsoft.EntityFrameworkCore.Design; +//using SimplCommerce.Module.Core.Data; +//using SimplCommerce.WebHost.Extensions; +//using SimplCommerce.Infrastructure; -namespace SimplCommerce.WebHost -{ - public class MigrationSimplDbContextFactory : IDesignTimeDbContextFactory - { - public SimplDbContext CreateDbContext(string[] args) - { - var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); +//namespace SimplCommerce.WebHost +//{ +// public class MigrationSimplDbContextFactory : IDesignTimeDbContextFactory +// { +// public SimplDbContext CreateDbContext(string[] args) +// { +// var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - var contentRootPath = Directory.GetCurrentDirectory(); +// var contentRootPath = Directory.GetCurrentDirectory(); - var builder = new ConfigurationBuilder() - .SetBasePath(contentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{environmentName}.json", true); +// var builder = new ConfigurationBuilder() +// .SetBasePath(contentRootPath) +// .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) +// .AddJsonFile($"appsettings.{environmentName}.json", true); - builder.AddUserSecrets(typeof(MigrationSimplDbContextFactory).Assembly, optional: true); - builder.AddEnvironmentVariables(); - var _configuration = builder.Build(); +// builder.AddUserSecrets(typeof(MigrationSimplDbContextFactory).Assembly, optional: true); +// builder.AddEnvironmentVariables(); +// var _configuration = builder.Build(); - IServiceCollection services = new ServiceCollection(); - GlobalConfiguration.ContentRootPath = contentRootPath; - services.AddModules(); - services.AddCustomizedDataStore(_configuration); - var _serviceProvider = services.BuildServiceProvider(); +// IServiceCollection services = new ServiceCollection(); +// GlobalConfiguration.ContentRootPath = contentRootPath; +// services.AddModules(); +// services.AddCustomizedDataStore(_configuration); +// var _serviceProvider = services.BuildServiceProvider(); - return _serviceProvider.GetRequiredService(); - } - } -} +// return _serviceProvider.GetRequiredService(); +// } +// } +//} diff --git a/src/SimplCommerce.WebHost/Program.cs b/src/SimplCommerce.WebHost/Program.cs index 9746ab4231..1a2c24bdd7 100644 --- a/src/SimplCommerce.WebHost/Program.cs +++ b/src/SimplCommerce.WebHost/Program.cs @@ -21,6 +21,7 @@ using SimplCommerce.Module.Localization.Extensions; using SimplCommerce.Module.Localization.TagHelpers; using SimplCommerce.WebHost.Extensions; +using SimplCommerce.Db.MsSql; // Select namespace for db configuration var builder = WebApplication.CreateBuilder(args); ConfigureService(); @@ -31,14 +32,12 @@ void ConfigureService() { var connectionString = builder.Configuration.GetConnectionString("DefaultConnection"); - builder.Configuration.AddEntityFrameworkConfig(options => - options.UseSqlServer(connectionString)); GlobalConfiguration.WebRootPath = builder.Environment.WebRootPath; GlobalConfiguration.ContentRootPath = builder.Environment.ContentRootPath; + builder.Services.AddDbConfiguration(connectionString); //add-migration -p SimplCommerce.Db.PgSql builder.Services.AddModules(); - builder.Services.AddCustomizedDataStore(builder.Configuration); builder.Services.AddCustomizedIdentity(builder.Configuration); builder.Services.AddHttpClient(); builder.Services.AddTransient(typeof(IRepository<>), typeof(Repository<>)); diff --git a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj index f43c7b2080..ee167d6724 100644 --- a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj +++ b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj @@ -45,6 +45,8 @@ + + @@ -57,19 +59,19 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + diff --git a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs new file mode 100644 index 0000000000..dde3d04d17 --- /dev/null +++ b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs @@ -0,0 +1,4691 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SimplCommerce.Module.Core.Data; + +#nullable disable + +namespace SimplCommerce.WebHost.Migrations +{ + [DbContext(typeof(SimplDbContext))] + [Migration("20220508110554_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_RoleClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserLogin", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("Core_UserToken", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Localization_Culture", (string)null); + + b.HasData( + new + { + Id = "en-US", + Name = "English (US)" + }); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ProperyName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_LocalizedContentProperty", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_Resource", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ActivityTypeId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeId"); + + b.ToTable("ActivityLog_Activity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("ActivityLog_ActivityType", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "EntityView" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_Brand", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IncludeInMenu") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Category", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BrandId") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("Gtin") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("HasOptions") + .HasColumnType("bit"); + + b.Property("IsAllowToOrder") + .HasColumnType("bit"); + + b.Property("IsCallForPricing") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsVisibleIndividually") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("NormalizedName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("RatingAverage") + .HasColumnType("float"); + + b.Property("ReviewsCount") + .HasColumnType("int"); + + b.Property("ShortDescription") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Sku") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.Property("Specification") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQuantity") + .HasColumnType("int"); + + b.Property("StockTrackingIsEnabled") + .HasColumnType("bit"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BrandId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("TaxClassId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Product", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Catalog_ProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductAttributeGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AttributeId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AttributeId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductAttributeValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsFeaturedProduct") + .HasColumnType("bit"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LinkType") + .HasColumnType("int"); + + b.Property("LinkedProductId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LinkedProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductLink", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductMedia", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductOption", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Color" + }, + new + { + Id = 2L, + Name = "Size" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionCombination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("DisplayType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductPriceHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductTemplate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.Property("ProductTemplateId") + .HasColumnType("bigint"); + + b.Property("ProductAttributeId") + .HasColumnType("bigint"); + + b.HasKey("ProductTemplateId", "ProductAttributeId"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsSystem") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Cms_Menu", (string)null); + + b.HasData( + new + { + Id = 1L, + IsPublished = true, + IsSystem = true, + Name = "Customer Services" + }, + new + { + Id = 2L, + IsPublished = true, + IsSystem = true, + Name = "Information" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CustomLink") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("MenuId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.HasIndex("MenuId"); + + b.HasIndex("ParentId"); + + b.ToTable("Cms_MenuItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Body") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.ToTable("Cms_Page", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CommentText") + .HasColumnType("nvarchar(max)"); + + b.Property("CommenterName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UserId"); + + b.ToTable("Comments_Comment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Address") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactAreaId") + .HasColumnType("bigint"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EmailAddress") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FullName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PhoneNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ContactAreaId"); + + b.ToTable("Contacts_Contact", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Contacts_ContactArea", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_Address", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressLine1 = "364 Cong Hoa", + ContactName = "Thien Nguyen", + CountryId = "VN", + StateOrProvinceId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("IsVisibleInCommonSettingPage") + .HasColumnType("bit"); + + b.Property("Module") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_AppSetting", (string)null); + + b.HasData( + new + { + Id = "Catalog.ProductPageSize", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "10" + }, + new + { + Id = "Catalog.IsProductPriceIncludeTax", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "Catalog.IsCommentsRequireApproval", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "GoogleAppKey", + IsVisibleInCommonSettingPage = false, + Module = "Contact", + Value = "" + }, + new + { + Id = "Global.AssetVersion", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "1.0" + }, + new + { + Id = "Global.AssetBundling", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "false" + }, + new + { + Id = "Theme", + IsVisibleInCommonSettingPage = false, + Module = "Core", + Value = "Generic" + }, + new + { + Id = "Global.DefaultCultureUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.DefaultCultureAdminUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyCulture", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyDecimalPlace", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "2" + }, + new + { + Id = "SmtpServer", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "smtp.gmail.com" + }, + new + { + Id = "SmtpPort", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "587" + }, + new + { + Id = "SmtpUsername", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "SmtpPassword", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "Localization.LocalizedConentEnable", + IsVisibleInCommonSettingPage = true, + Module = "Localization", + Value = "true" + }, + new + { + Id = "News.PageSize", + IsVisibleInCommonSettingPage = true, + Module = "News", + Value = "10" + }, + new + { + Id = "Tax.DefaultTaxClassId", + IsVisibleInCommonSettingPage = true, + Module = "Tax", + Value = "1" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Code3") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsBillingEnabled") + .HasColumnType("bit"); + + b.Property("IsCityEnabled") + .HasColumnType("bit"); + + b.Property("IsDistrictEnabled") + .HasColumnType("bit"); + + b.Property("IsShippingEnabled") + .HasColumnType("bit"); + + b.Property("IsZipCodeEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Country", (string)null); + + b.HasData( + new + { + Id = "VN", + Code3 = "VNM", + IsBillingEnabled = true, + IsCityEnabled = false, + IsDistrictEnabled = true, + IsShippingEnabled = true, + IsZipCodeEnabled = false, + Name = "Việt Nam" + }, + new + { + Id = "US", + Code3 = "USA", + IsBillingEnabled = true, + IsCityEnabled = true, + IsDistrictEnabled = false, + IsShippingEnabled = true, + IsZipCodeEnabled = true, + Name = "United States" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Core_CustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Core_CustomerGroupUser", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Location") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_District", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Quận 1", + StateOrProvinceId = 1L, + Type = "Quận" + }, + new + { + Id = 2L, + Name = "Quận 2", + StateOrProvinceId = 1L, + Type = "Quận" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("Core_Entity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AreaName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsMenuable") + .HasColumnType("bit"); + + b.Property("RoutingAction") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RoutingController") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_EntityType", (string)null); + + b.HasData( + new + { + Id = "Category", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "CategoryDetail", + RoutingController = "Category" + }, + new + { + Id = "Brand", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "BrandDetail", + RoutingController = "Brand" + }, + new + { + Id = "Product", + AreaName = "Catalog", + IsMenuable = false, + RoutingAction = "ProductDetail", + RoutingController = "Product" + }, + new + { + Id = "Page", + AreaName = "Cms", + IsMenuable = true, + RoutingAction = "PageDetail", + RoutingController = "Page" + }, + new + { + Id = "Vendor", + AreaName = "Core", + IsMenuable = false, + RoutingAction = "VendorDetail", + RoutingController = "Vendor" + }, + new + { + Id = "NewsCategory", + AreaName = "News", + IsMenuable = true, + RoutingAction = "NewsCategoryDetail", + RoutingController = "NewsCategory" + }, + new + { + Id = "NewsItem", + AreaName = "News", + IsMenuable = false, + RoutingAction = "NewsItemDetail", + RoutingController = "NewsItem" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Caption") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("MediaType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Core_Media", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Core_Role", (string)null); + + b.HasData( + new + { + Id = 1L, + ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", + Name = "admin", + NormalizedName = "ADMIN" + }, + new + { + Id = 2L, + ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", + Name = "customer", + NormalizedName = "CUSTOMER" + }, + new + { + Id = 3L, + ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", + Name = "guest", + NormalizedName = "GUEST" + }, + new + { + Id = 4L, + ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", + Name = "vendor", + NormalizedName = "VENDOR" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Code") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.ToTable("Core_StateOrProvince", (string)null); + + b.HasData( + new + { + Id = 1L, + CountryId = "VN", + Name = "Hồ Chí Minh", + Type = "Thành Phố" + }, + new + { + Id = 2L, + Code = "WA", + CountryId = "US", + Name = "Washington" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Culture") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DefaultBillingAddressId") + .HasColumnType("bigint"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("bigint"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("ExtensionData") + .HasColumnType("nvarchar(max)"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("RefreshTokenHash") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserGuid") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DefaultBillingAddressId"); + + b.HasIndex("DefaultShippingAddressId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("VendorId"); + + b.ToTable("Core_User", (string)null); + + b.HasData( + new + { + Id = 2L, + AccessFailedCount = 0, + ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "system@simplcommerce.com", + EmailConfirmed = false, + FullName = "System User", + IsDeleted = true, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", + NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", + TwoFactorEnabled = false, + UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), + UserName = "system@simplcommerce.com" + }, + new + { + Id = 10L, + AccessFailedCount = 0, + ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "admin@simplcommerce.com", + EmailConfirmed = false, + FullName = "Shop Admin", + IsDeleted = false, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", + NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", + TwoFactorEnabled = false, + UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), + UserName = "admin@simplcommerce.com" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AddressType") + .HasColumnType("int"); + + b.Property("LastUsedOn") + .HasColumnType("datetimeoffset"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_UserRole", (string)null); + + b.HasData( + new + { + UserId = 10L, + RoleId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Vendor", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("CreateUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EditUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Widget", (string)null); + + b.HasData( + new + { + Id = "CategoryWidget", + CreateUrl = "widget-category-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-category-edit", + IsPublished = false, + Name = "Category Widget", + ViewComponentName = "CategoryWidget" + }, + new + { + Id = "ProductWidget", + CreateUrl = "widget-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-product-edit", + IsPublished = false, + Name = "Product Widget", + ViewComponentName = "ProductWidget" + }, + new + { + Id = "SimpleProductWidget", + CreateUrl = "widget-simple-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-simple-product-edit", + IsPublished = false, + Name = "Simple Product Widget", + ViewComponentName = "SimpleProductWidget" + }, + new + { + Id = "HtmlWidget", + CreateUrl = "widget-html-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-html-edit", + IsPublished = false, + Name = "Html Widget", + ViewComponentName = "HtmlWidget" + }, + new + { + Id = "CarouselWidget", + CreateUrl = "widget-carousel-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-carousel-edit", + IsPublished = false, + Name = "Carousel Widget", + ViewComponentName = "CarouselWidget" + }, + new + { + Id = "SpaceBarWidget", + CreateUrl = "widget-spacebar-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-spacebar-edit", + IsPublished = false, + Name = "SpaceBar Widget", + ViewComponentName = "SpaceBarWidget" + }, + new + { + Id = "RecentlyViewedWidget", + CreateUrl = "widget-recently-viewed-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-recently-viewed-edit", + IsPublished = false, + Name = "Recently Viewed Widget", + ViewComponentName = "RecentlyViewedWidget" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Data") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("HtmlData") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishEnd") + .HasColumnType("datetimeoffset"); + + b.Property("PublishStart") + .HasColumnType("datetimeoffset"); + + b.Property("WidgetId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("WidgetZoneId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WidgetId"); + + b.HasIndex("WidgetZoneId"); + + b.ToTable("Core_WidgetInstance", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_WidgetZone", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Home Featured" + }, + new + { + Id = 2L, + Name = "Home Main Content" + }, + new + { + Id = 3L, + Name = "Home After Main Content" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ReservedQuantity") + .HasColumnType("int"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_Stock", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdjustedQuantity") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_StockHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("VendorId"); + + b.ToTable("Inventory_Warehouse", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressId = 1L, + Name = "Default warehouse" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("News_NewsCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FullContent") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ShortContent") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("News_NewsItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("NewsItemId") + .HasColumnType("bigint"); + + b.HasKey("CategoryId", "NewsItemId"); + + b.HasIndex("NewsItemId"); + + b.ToTable("News_NewsItemCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("IsMasterOrder") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("OrderTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PaymentFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ShippingAddressId") + .HasColumnType("bigint"); + + b.Property("ShippingFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SubTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("SubTotalWithDiscount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BillingAddressId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ParentId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Orders_Order", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Orders_OrderAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("NewStatus") + .HasColumnType("int"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OldStatus") + .HasColumnType("int"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("OrderSnapshot") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.ToTable("Orders_OrderHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("ProductPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxPercent") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("Orders_OrderItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FailureMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("GatewayTransactionId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("PaymentFee") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("Payments_Payment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LandingViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Payments_PaymentProvider", (string)null); + + b.HasData( + new + { + Id = "Braintree", + AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", + ConfigureUrl = "payments-braintree-config", + IsEnabled = true, + LandingViewComponentName = "BraintreeLanding", + Name = "Braintree" + }, + new + { + Id = "CoD", + ConfigureUrl = "payments-cod-config", + IsEnabled = true, + LandingViewComponentName = "CoDLanding", + Name = "Cash On Delivery" + }, + new + { + Id = "PaypalExpress", + AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", + ConfigureUrl = "payments-paypalExpress-config", + IsEnabled = true, + LandingViewComponentName = "PaypalExpressLanding", + Name = "Paypal Express" + }, + new + { + Id = "Stripe", + AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", + ConfigureUrl = "payments-stripe-config", + IsEnabled = true, + LandingViewComponentName = "StripeLanding", + Name = "Stripe" + }, + new + { + Id = "MomoPayment", + AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", + ConfigureUrl = "payments-momo-config", + IsEnabled = true, + LandingViewComponentName = "MomoLanding", + Name = "Momo Payment" + }, + new + { + Id = "NganLuong", + AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", + ConfigureUrl = "payments-nganluong-config", + IsEnabled = true, + LandingViewComponentName = "NganLuongLanding", + Name = "Ngan Luong Payment" + }, + new + { + Id = "Cashfree", + AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", + ConfigureUrl = "payments-cashfree-config", + IsEnabled = true, + LandingViewComponentName = "CashfreeLanding", + Name = "Cashfree Payment Gateway" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiscountStep") + .HasColumnType("int"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsCouponRequired") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.Property("UsageLimitPerCoupon") + .HasColumnType("int"); + + b.Property("UsageLimitPerCustomer") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CartRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CategoryId"); + + b.HasIndex("CategoryId"); + + b.ToTable("Pricing_CartRuleCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Pricing_CartRuleProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CouponId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.HasIndex("CouponId"); + + b.HasIndex("UserId"); + + b.ToTable("Pricing_CartRuleUsage", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CatalogRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.Property("CatalogRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CatalogRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.ToTable("Pricing_Coupon", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("UserId"); + + b.ToTable("ProductComparison_ComparingProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LatestViewedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ReplierName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ReviewId"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Reply", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rating") + .HasColumnType("int"); + + b.Property("ReviewerName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Review", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("QueryText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ResultsCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Search_Query", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("TrackingNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Shipments_Shipment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("OrderItemId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ShipmentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("ShipmentId"); + + b.ToTable("Shipments_ShipmentItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OnlyCountryIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OnlyStateOrProvinceIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingPriceServiceTypeName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ToAllShippingEnabledCountries") + .HasColumnType("bit"); + + b.Property("ToAllShippingEnabledStatesOrProvinces") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("Shipping_ShippingProvider", (string)null); + + b.HasData( + new + { + Id = "FreeShip", + AdditionalSettings = "{MinimumOrderAmount : 1}", + ConfigureUrl = "", + IsEnabled = true, + Name = "Free Ship", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }, + new + { + Id = "TableRate", + ConfigureUrl = "shipping-table-rate-config", + IsEnabled = true, + Name = "Table Rate", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("MinOrderSubtotal") + .HasColumnType("decimal(18,2)"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsProductPriceIncludeTax") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LockedOnCheckout") + .HasColumnType("bit"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingData") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.ToTable("ShoppingCart_Cart", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CartId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CartId"); + + b.HasIndex("ProductId"); + + b.ToTable("ShoppingCart_CartItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Tax_TaxClass", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Standard VAT" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("StateOrProvinceId"); + + b.HasIndex("TaxClassId"); + + b.ToTable("Tax_TaxRate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("SharingCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("WishList_WishList", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("WishListId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WishListId"); + + b.ToTable("WishList_WishListItem", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany("Resources") + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") + .WithMany() + .HasForeignKey("ActivityTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ActivityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") + .WithMany() + .HasForeignKey("BrandId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Brand"); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("TaxClass"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") + .WithMany("Attributes") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") + .WithMany() + .HasForeignKey("AttributeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("AttributeValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Attribute"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Categories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") + .WithMany("LinkedProductLinks") + .HasForeignKey("LinkedProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("ProductLinks") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("LinkedProduct"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") + .WithMany() + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Medias") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionCombinations") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("PriceHistories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") + .WithMany("ProductTemplates") + .HasForeignKey("ProductAttributeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") + .WithMany("ProductAttributes") + .HasForeignKey("ProductTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProductAttribute"); + + b.Navigation("ProductTemplate"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") + .WithMany("MenuItems") + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Entity"); + + b.Navigation("Menu"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") + .WithMany("Replies") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Parent"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") + .WithMany() + .HasForeignKey("ContactAreaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContactArea"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany("Users") + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("CustomerGroups") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomerGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("EntityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany("StatesOrProvinces") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") + .WithMany() + .HasForeignKey("DefaultBillingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") + .WithMany() + .HasForeignKey("DefaultShippingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) + .WithMany("Users") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("DefaultBillingAddress"); + + b.Navigation("DefaultShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany("UserAddresses") + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("UserAddresses") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") + .WithMany() + .HasForeignKey("WidgetId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") + .WithMany() + .HasForeignKey("WidgetZoneId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Widget"); + + b.Navigation("WidgetZone"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") + .WithMany() + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Address"); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") + .WithMany("NewsItems") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") + .WithMany("Categories") + .HasForeignKey("NewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("NewsItem"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") + .WithMany() + .HasForeignKey("BillingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BillingAddress"); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("Parent"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Categories") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("CustomerGroups") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Products") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany() + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") + .WithMany() + .HasForeignKey("CouponId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Coupon"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") + .WithMany("CustomerGroups") + .HasForeignKey("CatalogRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CatalogRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Coupons") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CartRule"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") + .WithMany("Replies") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") + .WithMany("Items") + .HasForeignKey("ShipmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Shipment"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.HasOne("SimplCommerce.Module.ShoppingCart.Models.Cart", "Cart") + .WithMany("Items") + .HasForeignKey("CartId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Cart"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("StateOrProvince"); + + b.Navigation("TaxClass"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") + .WithMany("Items") + .HasForeignKey("WishListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("WishList"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Navigation("Resources"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Navigation("AttributeValues"); + + b.Navigation("Categories"); + + b.Navigation("LinkedProductLinks"); + + b.Navigation("Medias"); + + b.Navigation("OptionCombinations"); + + b.Navigation("OptionValues"); + + b.Navigation("PriceHistories"); + + b.Navigation("ProductLinks"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Navigation("ProductTemplates"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Navigation("ProductAttributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Navigation("MenuItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Navigation("StatesOrProvinces"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Navigation("CustomerGroups"); + + b.Navigation("Roles"); + + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Navigation("NewsItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Navigation("Categories"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Navigation("Children"); + + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Navigation("Categories"); + + b.Navigation("Coupons"); + + b.Navigation("CustomerGroups"); + + b.Navigation("Products"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Navigation("CustomerGroups"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs new file mode 100644 index 0000000000..9eaead786e --- /dev/null +++ b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs @@ -0,0 +1,3200 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SimplCommerce.WebHost.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ActivityLog_ActivityType", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityLog_ActivityType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Brand", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + IsPublished = table.Column(type: "bit", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Brand", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttributeGroup", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttributeGroup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOption", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOption", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductTemplate", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductTemplate", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Cms_Menu", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + IsPublished = table.Column(type: "bit", nullable: false), + IsSystem = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_Menu", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Contacts_ContactArea", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Contacts_ContactArea", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_AppSetting", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Module = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + IsVisibleInCommonSettingPage = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_AppSetting", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Country", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Code3 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + IsBillingEnabled = table.Column(type: "bit", nullable: false), + IsShippingEnabled = table.Column(type: "bit", nullable: false), + IsCityEnabled = table.Column(type: "bit", nullable: false), + IsZipCodeEnabled = table.Column(type: "bit", nullable: false), + IsDistrictEnabled = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Country", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_CustomerGroup", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_CustomerGroup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_EntityType", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + IsMenuable = table.Column(type: "bit", nullable: false), + AreaName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + RoutingController = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + RoutingAction = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_EntityType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Media", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Caption = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + FileSize = table.Column(type: "int", nullable: false), + FileName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MediaType = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Media", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Role", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + 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_Core_Role", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Vendor", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Email = table.Column(type: "nvarchar(max)", nullable: true), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + IsActive = table.Column(type: "bit", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Vendor", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_Widget", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + ViewComponentName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CreateUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + EditUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + IsPublished = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Widget", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Core_WidgetZone", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_WidgetZone", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Localization_Culture", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_Culture", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "News_NewsCategory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + DisplayOrder = table.Column(type: "int", nullable: false), + IsPublished = table.Column(type: "bit", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Payments_PaymentProvider", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + ConfigureUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + LandingViewComponentName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + AdditionalSettings = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payments_PaymentProvider", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRule", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + StartOn = table.Column(type: "datetimeoffset", nullable: true), + EndOn = table.Column(type: "datetimeoffset", nullable: true), + IsCouponRequired = table.Column(type: "bit", nullable: false), + RuleToApply = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), + MaxDiscountAmount = table.Column(type: "decimal(18,2)", nullable: true), + DiscountStep = table.Column(type: "int", nullable: true), + UsageLimitPerCoupon = table.Column(type: "int", nullable: true), + UsageLimitPerCustomer = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRule", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CatalogRule", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + StartOn = table.Column(type: "datetimeoffset", nullable: true), + EndOn = table.Column(type: "datetimeoffset", nullable: true), + RuleToApply = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), + MaxDiscountAmount = table.Column(type: "decimal(18,2)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CatalogRule", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ProductRecentlyViewed_RecentlyViewedProduct", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + LatestViewedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProductRecentlyViewed_RecentlyViewedProduct", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Search_Query", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + QueryText = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + ResultsCount = table.Column(type: "int", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Search_Query", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Shipping_ShippingProvider", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + ConfigureUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ToAllShippingEnabledCountries = table.Column(type: "bit", nullable: false), + OnlyCountryIdsString = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + ToAllShippingEnabledStatesOrProvinces = table.Column(type: "bit", nullable: false), + OnlyStateOrProvinceIdsString = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + AdditionalSettings = table.Column(type: "nvarchar(max)", nullable: true), + ShippingPriceServiceTypeName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipping_ShippingProvider", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Tax_TaxClass", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Tax_TaxClass", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ActivityLog_Activity", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ActivityTypeId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + EntityId = table.Column(type: "bigint", nullable: false), + EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityLog_Activity", x => x.Id); + table.ForeignKey( + name: "FK_ActivityLog_Activity_ActivityLog_ActivityType_ActivityTypeId", + column: x => x.ActivityTypeId, + principalTable: "ActivityLog_ActivityType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttribute", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + GroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttribute", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductAttribute_Catalog_ProductAttributeGroup_GroupId", + column: x => x.GroupId, + principalTable: "Catalog_ProductAttributeGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Contacts_Contact", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + FullName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + PhoneNumber = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + EmailAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Address = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Content = table.Column(type: "nvarchar(max)", nullable: true), + ContactAreaId = table.Column(type: "bigint", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Contacts_Contact", x => x.Id); + table.ForeignKey( + name: "FK_Contacts_Contact_Contacts_ContactArea_ContactAreaId", + column: x => x.ContactAreaId, + principalTable: "Contacts_ContactArea", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_StateOrProvince", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Code = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Type = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_StateOrProvince", x => x.Id); + table.ForeignKey( + name: "FK_Core_StateOrProvince_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_Entity", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + EntityId = table.Column(type: "bigint", nullable: false), + EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Entity", x => x.Id); + table.ForeignKey( + name: "FK_Core_Entity_Core_EntityType_EntityTypeId", + column: x => x.EntityTypeId, + principalTable: "Core_EntityType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Category", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + DisplayOrder = table.Column(type: "int", nullable: false), + IsPublished = table.Column(type: "bit", nullable: false), + IncludeInMenu = table.Column(type: "bit", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + ParentId = table.Column(type: "bigint", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Category", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_Category_Catalog_Category_ParentId", + column: x => x.ParentId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Category_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_RoleClaim", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + RoleId = table.Column(type: "bigint", nullable: false), + ClaimType = table.Column(type: "nvarchar(max)", nullable: true), + ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_RoleClaim", x => x.Id); + table.ForeignKey( + name: "FK_Core_RoleClaim_Core_Role_RoleId", + column: x => x.RoleId, + principalTable: "Core_Role", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_WidgetInstance", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + PublishStart = table.Column(type: "datetimeoffset", nullable: true), + PublishEnd = table.Column(type: "datetimeoffset", nullable: true), + WidgetId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + WidgetZoneId = table.Column(type: "bigint", nullable: false), + DisplayOrder = table.Column(type: "int", nullable: false), + Data = table.Column(type: "nvarchar(max)", nullable: true), + HtmlData = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_WidgetInstance", x => x.Id); + table.ForeignKey( + name: "FK_Core_WidgetInstance_Core_Widget_WidgetId", + column: x => x.WidgetId, + principalTable: "Core_Widget", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_WidgetInstance_Core_WidgetZone_WidgetZoneId", + column: x => x.WidgetZoneId, + principalTable: "Core_WidgetZone", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Localization_LocalizedContentProperty", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + EntityId = table.Column(type: "bigint", nullable: false), + EntityType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CultureId = table.Column(type: "nvarchar(450)", nullable: false), + ProperyName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Value = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_LocalizedContentProperty", x => x.Id); + table.ForeignKey( + name: "FK_Localization_LocalizedContentProperty_Localization_Culture_CultureId", + column: x => x.CultureId, + principalTable: "Localization_Culture", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Localization_Resource", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Key = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Value = table.Column(type: "nvarchar(max)", nullable: true), + CultureId = table.Column(type: "nvarchar(450)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Localization_Resource", x => x.Id); + table.ForeignKey( + name: "FK_Localization_Resource_Localization_Culture_CultureId", + column: x => x.CultureId, + principalTable: "Localization_Culture", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleCustomerGroup", + columns: table => new + { + CartRuleId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleCustomerGroup", x => new { x.CartRuleId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleCustomerGroup_Core_CustomerGroup_CustomerGroupId", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleCustomerGroup_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_Coupon", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CartRuleId = table.Column(type: "bigint", nullable: false), + Code = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_Coupon", x => x.Id); + table.ForeignKey( + name: "FK_Pricing_Coupon_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CatalogRuleCustomerGroup", + columns: table => new + { + CatalogRuleId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CatalogRuleCustomerGroup", x => new { x.CatalogRuleId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Pricing_CatalogRuleCustomerGroup_Core_CustomerGroup_CustomerGroupId", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CatalogRuleCustomerGroup_Pricing_CatalogRule_CatalogRuleId", + column: x => x.CatalogRuleId, + principalTable: "Pricing_CatalogRule", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductTemplateProductAttribute", + columns: table => new + { + ProductTemplateId = table.Column(type: "bigint", nullable: false), + ProductAttributeId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductTemplateProductAttribute", x => new { x.ProductTemplateId, x.ProductAttributeId }); + table.ForeignKey( + name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductAttribute_ProductAttributeId", + column: x => x.ProductAttributeId, + principalTable: "Catalog_ProductAttribute", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductTemplate_ProductTemplateId", + column: x => x.ProductTemplateId, + principalTable: "Catalog_ProductTemplate", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_District", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Type = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Location = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_District", x => x.Id); + table.ForeignKey( + name: "FK_Core_District_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Tax_TaxRate", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + TaxClassId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: true), + Rate = table.Column(type: "decimal(18,2)", nullable: false), + ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Tax_TaxRate", x => x.Id); + table.ForeignKey( + name: "FK_Tax_TaxRate_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Tax_TaxRate_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Tax_TaxRate_Tax_TaxClass_TaxClassId", + column: x => x.TaxClassId, + principalTable: "Tax_TaxClass", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Cms_MenuItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ParentId = table.Column(type: "bigint", nullable: true), + MenuId = table.Column(type: "bigint", nullable: false), + EntityId = table.Column(type: "bigint", nullable: true), + CustomLink = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DisplayOrder = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_MenuItem", x => x.Id); + table.ForeignKey( + name: "FK_Cms_MenuItem_Cms_Menu_MenuId", + column: x => x.MenuId, + principalTable: "Cms_Menu", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Cms_MenuItem_Cms_MenuItem_ParentId", + column: x => x.ParentId, + principalTable: "Cms_MenuItem", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Cms_MenuItem_Core_Entity_EntityId", + column: x => x.EntityId, + principalTable: "Core_Entity", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleCategory", + columns: table => new + { + CategoryId = table.Column(type: "bigint", nullable: false), + CartRuleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleCategory", x => new { x.CartRuleId, x.CategoryId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleCategory_Catalog_Category_CategoryId", + column: x => x.CategoryId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleCategory_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_Address", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ContactName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Phone = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + AddressLine1 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + AddressLine2 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + City = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_Address", x => x.Id); + table.ForeignKey( + name: "FK_Core_Address_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_Address_Core_District_DistrictId", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_Address_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderAddress", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ContactName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Phone = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + AddressLine1 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + AddressLine2 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + City = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: false), + CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderAddress", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_District_DistrictId", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderAddress_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShippingTableRate_PriceAndDestination", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + StateOrProvinceId = table.Column(type: "bigint", nullable: true), + DistrictId = table.Column(type: "bigint", nullable: true), + ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Note = table.Column(type: "nvarchar(max)", nullable: true), + MinOrderSubtotal = table.Column(type: "decimal(18,2)", nullable: false), + ShippingPrice = table.Column(type: "decimal(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ShippingTableRate_PriceAndDestination", x => x.Id); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_Country_CountryId", + column: x => x.CountryId, + principalTable: "Core_Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_District_DistrictId", + column: x => x.DistrictId, + principalTable: "Core_District", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShippingTableRate_PriceAndDestination_Core_StateOrProvince_StateOrProvinceId", + column: x => x.StateOrProvinceId, + principalTable: "Core_StateOrProvince", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Inventory_Warehouse", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + AddressId = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_Warehouse", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_Warehouse_Core_Address_AddressId", + column: x => x.AddressId, + principalTable: "Core_Address", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_Warehouse_Core_Vendor_VendorId", + column: x => x.VendorId, + principalTable: "Core_Vendor", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_Product", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ShortDescription = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Specification = table.Column(type: "nvarchar(max)", nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + OldPrice = table.Column(type: "decimal(18,2)", nullable: true), + SpecialPrice = table.Column(type: "decimal(18,2)", nullable: true), + SpecialPriceStart = table.Column(type: "datetimeoffset", nullable: true), + SpecialPriceEnd = table.Column(type: "datetimeoffset", nullable: true), + HasOptions = table.Column(type: "bit", nullable: false), + IsVisibleIndividually = table.Column(type: "bit", nullable: false), + IsFeatured = table.Column(type: "bit", nullable: false), + IsCallForPricing = table.Column(type: "bit", nullable: false), + IsAllowToOrder = table.Column(type: "bit", nullable: false), + StockTrackingIsEnabled = table.Column(type: "bit", nullable: false), + StockQuantity = table.Column(type: "int", nullable: false), + Sku = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Gtin = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + NormalizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DisplayOrder = table.Column(type: "int", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true), + ReviewsCount = table.Column(type: "int", nullable: false), + RatingAverage = table.Column(type: "float", nullable: true), + BrandId = table.Column(type: "bigint", nullable: true), + TaxClassId = table.Column(type: "bigint", nullable: true), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), + IsPublished = table.Column(type: "bit", nullable: false), + PublishedOn = table.Column(type: "datetimeoffset", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_Product", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_Product_Catalog_Brand_BrandId", + column: x => x.BrandId, + principalTable: "Catalog_Brand", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Product_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_Product_Tax_TaxClass_TaxClassId", + column: x => x.TaxClassId, + principalTable: "Tax_TaxClass", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductAttributeValue", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + AttributeId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductAttributeValue", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductAttributeValue_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductAttributeValue_Catalog_ProductAttribute_AttributeId", + column: x => x.AttributeId, + principalTable: "Catalog_ProductAttribute", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductCategory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + IsFeaturedProduct = table.Column(type: "bit", nullable: false), + DisplayOrder = table.Column(type: "int", nullable: false), + CategoryId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductCategory", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductCategory_Catalog_Category_CategoryId", + column: x => x.CategoryId, + principalTable: "Catalog_Category", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductCategory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductLink", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: false), + LinkedProductId = table.Column(type: "bigint", nullable: false), + LinkType = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductLink", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductLink_Catalog_Product_LinkedProductId", + column: x => x.LinkedProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductLink_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductMedia", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: false), + MediaId = table.Column(type: "bigint", nullable: false), + DisplayOrder = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductMedia", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductMedia_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductMedia_Core_Media_MediaId", + column: x => x.MediaId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOptionCombination", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: false), + OptionId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + SortIndex = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOptionCombination", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductOptionCombination_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductOptionCombination_Catalog_ProductOption_OptionId", + column: x => x.OptionId, + principalTable: "Catalog_ProductOption", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductOptionValue", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + OptionId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DisplayType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + SortIndex = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductOptionValue", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductOptionValue_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Catalog_ProductOptionValue_Catalog_ProductOption_OptionId", + column: x => x.OptionId, + principalTable: "Catalog_ProductOption", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Inventory_Stock", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: false), + WarehouseId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "int", nullable: false), + ReservedQuantity = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_Stock", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_Stock_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_Stock_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleProduct", + columns: table => new + { + ProductId = table.Column(type: "bigint", nullable: false), + CartRuleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleProduct", x => new { x.CartRuleId, x.ProductId }); + table.ForeignKey( + name: "FK_Pricing_CartRuleProduct_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleProduct_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Catalog_ProductPriceHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: true), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + Price = table.Column(type: "decimal(18,2)", nullable: true), + OldPrice = table.Column(type: "decimal(18,2)", nullable: true), + SpecialPrice = table.Column(type: "decimal(18,2)", nullable: true), + SpecialPriceStart = table.Column(type: "datetimeoffset", nullable: true), + SpecialPriceEnd = table.Column(type: "datetimeoffset", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Catalog_ProductPriceHistory", x => x.Id); + table.ForeignKey( + name: "FK_Catalog_ProductPriceHistory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Cms_Page", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Body = table.Column(type: "nvarchar(max)", nullable: true), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), + IsPublished = table.Column(type: "bit", nullable: false), + PublishedOn = table.Column(type: "datetimeoffset", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cms_Page", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Comments_Comment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + CommentText = table.Column(type: "nvarchar(max)", nullable: true), + CommenterName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "int", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + EntityId = table.Column(type: "bigint", nullable: false), + ParentId = table.Column(type: "bigint", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Comments_Comment", x => x.Id); + table.ForeignKey( + name: "FK_Comments_Comment_Comments_Comment_ParentId", + column: x => x.ParentId, + principalTable: "Comments_Comment", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_CustomerGroupUser", + columns: table => new + { + UserId = table.Column(type: "bigint", nullable: false), + CustomerGroupId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_CustomerGroupUser", x => new { x.UserId, x.CustomerGroupId }); + table.ForeignKey( + name: "FK_Core_CustomerGroupUser_Core_CustomerGroup_CustomerGroupId", + column: x => x.CustomerGroupId, + principalTable: "Core_CustomerGroup", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_User", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserGuid = table.Column(type: "uniqueidentifier", nullable: false), + FullName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + DefaultShippingAddressId = table.Column(type: "bigint", nullable: true), + DefaultBillingAddressId = table.Column(type: "bigint", nullable: true), + RefreshTokenHash = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Culture = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ExtensionData = table.Column(type: "nvarchar(max)", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, 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_Core_User", x => x.Id); + table.ForeignKey( + name: "FK_Core_User_Core_Vendor_VendorId", + column: x => x.VendorId, + principalTable: "Core_Vendor", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserAddress", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + AddressId = table.Column(type: "bigint", nullable: false), + AddressType = table.Column(type: "int", nullable: false), + LastUsedOn = table.Column(type: "datetimeoffset", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserAddress", x => x.Id); + table.ForeignKey( + name: "FK_Core_UserAddress_Core_Address_AddressId", + column: x => x.AddressId, + principalTable: "Core_Address", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_UserAddress_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserClaim", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + ClaimType = table.Column(type: "nvarchar(max)", nullable: true), + ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserClaim", x => x.Id); + table.ForeignKey( + name: "FK_Core_UserClaim_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_UserLogin", + 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: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserLogin", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_Core_UserLogin_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Core_UserRole", + columns: table => new + { + UserId = table.Column(type: "bigint", nullable: false), + RoleId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Core_UserRole", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_Core_UserRole_Core_Role_RoleId", + column: x => x.RoleId, + principalTable: "Core_Role", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Core_UserRole_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Core_UserToken", + columns: table => new + { + UserId = table.Column(type: "bigint", 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_Core_UserToken", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_Core_UserToken_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Inventory_StockHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ProductId = table.Column(type: "bigint", nullable: false), + WarehouseId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + AdjustedQuantity = table.Column(type: "bigint", nullable: false), + Note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Inventory_StockHistory", x => x.Id); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Inventory_StockHistory_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "News_NewsItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ShortContent = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + FullContent = table.Column(type: "nvarchar(max)", nullable: true), + ThumbnailImageId = table.Column(type: "bigint", nullable: true), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), + IsPublished = table.Column(type: "bit", nullable: false), + PublishedOn = table.Column(type: "datetimeoffset", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsItem", x => x.Id); + table.ForeignKey( + name: "FK_News_NewsItem_Core_Media_ThumbnailImageId", + column: x => x.ThumbnailImageId, + principalTable: "Core_Media", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_News_NewsItem_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_News_NewsItem_Core_User_LatestUpdatedById", + column: x => x.LatestUpdatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_Order", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CustomerId = table.Column(type: "bigint", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + CouponCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CouponRuleName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), + SubTotal = table.Column(type: "decimal(18,2)", nullable: false), + SubTotalWithDiscount = table.Column(type: "decimal(18,2)", nullable: false), + ShippingAddressId = table.Column(type: "bigint", nullable: false), + BillingAddressId = table.Column(type: "bigint", nullable: false), + OrderStatus = table.Column(type: "int", nullable: false), + OrderNote = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + ParentId = table.Column(type: "bigint", nullable: true), + IsMasterOrder = table.Column(type: "bit", nullable: false), + ShippingMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ShippingFeeAmount = table.Column(type: "decimal(18,2)", nullable: false), + TaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + OrderTotal = table.Column(type: "decimal(18,2)", nullable: false), + PaymentMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + PaymentFeeAmount = table.Column(type: "decimal(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_Order", x => x.Id); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_CustomerId", + column: x => x.CustomerId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Core_User_LatestUpdatedById", + column: x => x.LatestUpdatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_Order_ParentId", + column: x => x.ParentId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_OrderAddress_BillingAddressId", + column: x => x.BillingAddressId, + principalTable: "Orders_OrderAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Order_Orders_OrderAddress_ShippingAddressId", + column: x => x.ShippingAddressId, + principalTable: "Orders_OrderAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Pricing_CartRuleUsage", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CartRuleId = table.Column(type: "bigint", nullable: false), + CouponId = table.Column(type: "bigint", nullable: true), + UserId = table.Column(type: "bigint", nullable: false), + OrderId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pricing_CartRuleUsage", x => x.Id); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Pricing_CartRule_CartRuleId", + column: x => x.CartRuleId, + principalTable: "Pricing_CartRule", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Pricing_CartRuleUsage_Pricing_Coupon_CouponId", + column: x => x.CouponId, + principalTable: "Pricing_Coupon", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ProductComparison_ComparingProduct", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProductComparison_ComparingProduct", x => x.Id); + table.ForeignKey( + name: "FK_ProductComparison_ComparingProduct_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ProductComparison_ComparingProduct_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Reviews_Review", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + Title = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Comment = table.Column(type: "nvarchar(max)", nullable: true), + Rating = table.Column(type: "int", nullable: false), + ReviewerName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "int", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + EntityId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Reviews_Review", x => x.Id); + table.ForeignKey( + name: "FK_Reviews_Review_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShoppingCart_Cart", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CustomerId = table.Column(type: "bigint", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + IsActive = table.Column(type: "bit", nullable: false), + LockedOnCheckout = table.Column(type: "bit", nullable: false), + CouponCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CouponRuleName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ShippingMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + IsProductPriceIncludeTax = table.Column(type: "bit", nullable: false), + ShippingAmount = table.Column(type: "decimal(18,2)", nullable: true), + TaxAmount = table.Column(type: "decimal(18,2)", nullable: true), + ShippingData = table.Column(type: "nvarchar(max)", nullable: true), + OrderNote = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ShoppingCart_Cart", x => x.Id); + table.ForeignKey( + name: "FK_ShoppingCart_Cart_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShoppingCart_Cart_Core_User_CustomerId", + column: x => x.CustomerId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "WishList_WishList", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column(type: "bigint", nullable: false), + SharingCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WishList_WishList", x => x.Id); + table.ForeignKey( + name: "FK_WishList_WishList_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "News_NewsItemCategory", + columns: table => new + { + CategoryId = table.Column(type: "bigint", nullable: false), + NewsItemId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News_NewsItemCategory", x => new { x.CategoryId, x.NewsItemId }); + table.ForeignKey( + name: "FK_News_NewsItemCategory_News_NewsCategory_CategoryId", + column: x => x.CategoryId, + principalTable: "News_NewsCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_News_NewsItemCategory_News_NewsItem_NewsItemId", + column: x => x.NewsItemId, + principalTable: "News_NewsItem", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderHistory", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + OrderId = table.Column(type: "bigint", nullable: false), + OldStatus = table.Column(type: "int", nullable: true), + NewStatus = table.Column(type: "int", nullable: false), + OrderSnapshot = table.Column(type: "nvarchar(max)", nullable: true), + Note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + CreatedById = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderHistory", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderHistory_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderHistory_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Orders_OrderItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + OrderId = table.Column(type: "bigint", nullable: true), + ProductId = table.Column(type: "bigint", nullable: false), + ProductPrice = table.Column(type: "decimal(18,2)", nullable: false), + Quantity = table.Column(type: "int", nullable: false), + DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), + TaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + TaxPercent = table.Column(type: "decimal(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders_OrderItem", x => x.Id); + table.ForeignKey( + name: "FK_Orders_OrderItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_OrderItem_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Payments_Payment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + OrderId = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), + Amount = table.Column(type: "decimal(18,2)", nullable: false), + PaymentFee = table.Column(type: "decimal(18,2)", nullable: false), + PaymentMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + GatewayTransactionId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "int", nullable: false), + FailureMessage = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payments_Payment", x => x.Id); + table.ForeignKey( + name: "FK_Payments_Payment_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Shipments_Shipment", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + OrderId = table.Column(type: "bigint", nullable: false), + TrackingNumber = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + WarehouseId = table.Column(type: "bigint", nullable: false), + VendorId = table.Column(type: "bigint", nullable: true), + CreatedById = table.Column(type: "bigint", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipments_Shipment", x => x.Id); + table.ForeignKey( + name: "FK_Shipments_Shipment_Core_User_CreatedById", + column: x => x.CreatedById, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_Shipment_Inventory_Warehouse_WarehouseId", + column: x => x.WarehouseId, + principalTable: "Inventory_Warehouse", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_Shipment_Orders_Order_OrderId", + column: x => x.OrderId, + principalTable: "Orders_Order", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Reviews_Reply", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ReviewId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + Comment = table.Column(type: "nvarchar(max)", nullable: true), + ReplierName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Status = table.Column(type: "int", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Reviews_Reply", x => x.Id); + table.ForeignKey( + name: "FK_Reviews_Reply_Core_User_UserId", + column: x => x.UserId, + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Reviews_Reply_Reviews_Review_ReviewId", + column: x => x.ReviewId, + principalTable: "Reviews_Review", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ShoppingCart_CartItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "int", nullable: false), + CartId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ShoppingCart_CartItem", x => x.Id); + table.ForeignKey( + name: "FK_ShoppingCart_CartItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ShoppingCart_CartItem_ShoppingCart_Cart_CartId", + column: x => x.CartId, + principalTable: "ShoppingCart_Cart", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "WishList_WishListItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + WishListId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Quantity = table.Column(type: "int", nullable: false), + CreatedOn = table.Column(type: "datetimeoffset", nullable: false), + LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WishList_WishListItem", x => x.Id); + table.ForeignKey( + name: "FK_WishList_WishListItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_WishList_WishListItem_WishList_WishList_WishListId", + column: x => x.WishListId, + principalTable: "WishList_WishList", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Shipments_ShipmentItem", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ShipmentId = table.Column(type: "bigint", nullable: false), + OrderItemId = table.Column(type: "bigint", nullable: false), + ProductId = table.Column(type: "bigint", nullable: false), + Quantity = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Shipments_ShipmentItem", x => x.Id); + table.ForeignKey( + name: "FK_Shipments_ShipmentItem_Catalog_Product_ProductId", + column: x => x.ProductId, + principalTable: "Catalog_Product", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Shipments_ShipmentItem_Shipments_Shipment_ShipmentId", + column: x => x.ShipmentId, + principalTable: "Shipments_Shipment", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.InsertData( + table: "ActivityLog_ActivityType", + columns: new[] { "Id", "Name" }, + values: new object[] { 1L, "EntityView" }); + + migrationBuilder.InsertData( + table: "Catalog_ProductOption", + columns: new[] { "Id", "Name" }, + values: new object[,] + { + { 1L, "Color" }, + { 2L, "Size" } + }); + + migrationBuilder.InsertData( + table: "Cms_Menu", + columns: new[] { "Id", "IsPublished", "IsSystem", "Name" }, + values: new object[,] + { + { 1L, true, true, "Customer Services" }, + { 2L, true, true, "Information" } + }); + + migrationBuilder.InsertData( + table: "Core_AppSetting", + columns: new[] { "Id", "IsVisibleInCommonSettingPage", "Module", "Value" }, + values: new object[,] + { + { "Catalog.IsCommentsRequireApproval", true, "Catalog", "true" }, + { "Catalog.IsProductPriceIncludeTax", true, "Catalog", "true" }, + { "Catalog.ProductPageSize", true, "Catalog", "10" }, + { "Global.AssetBundling", true, "Core", "false" }, + { "Global.AssetVersion", true, "Core", "1.0" }, + { "Global.CurrencyCulture", true, "Core", "en-US" }, + { "Global.CurrencyDecimalPlace", true, "Core", "2" }, + { "Global.DefaultCultureAdminUI", true, "Core", "en-US" }, + { "Global.DefaultCultureUI", true, "Core", "en-US" }, + { "GoogleAppKey", false, "Contact", "" }, + { "Localization.LocalizedConentEnable", true, "Localization", "true" }, + { "News.PageSize", true, "News", "10" }, + { "SmtpPassword", false, "EmailSenderSmpt", "" }, + { "SmtpPort", false, "EmailSenderSmpt", "587" }, + { "SmtpServer", false, "EmailSenderSmpt", "smtp.gmail.com" }, + { "SmtpUsername", false, "EmailSenderSmpt", "" }, + { "Tax.DefaultTaxClassId", true, "Tax", "1" }, + { "Theme", false, "Core", "Generic" } + }); + + migrationBuilder.InsertData( + table: "Core_Country", + columns: new[] { "Id", "Code3", "IsBillingEnabled", "IsCityEnabled", "IsDistrictEnabled", "IsShippingEnabled", "IsZipCodeEnabled", "Name" }, + values: new object[,] + { + { "US", "USA", true, true, false, true, true, "United States" }, + { "VN", "VNM", true, false, true, true, false, "Việt Nam" } + }); + + migrationBuilder.InsertData( + table: "Core_EntityType", + columns: new[] { "Id", "AreaName", "IsMenuable", "RoutingAction", "RoutingController" }, + values: new object[,] + { + { "Brand", "Catalog", true, "BrandDetail", "Brand" }, + { "Category", "Catalog", true, "CategoryDetail", "Category" }, + { "NewsCategory", "News", true, "NewsCategoryDetail", "NewsCategory" }, + { "NewsItem", "News", false, "NewsItemDetail", "NewsItem" }, + { "Page", "Cms", true, "PageDetail", "Page" }, + { "Product", "Catalog", false, "ProductDetail", "Product" }, + { "Vendor", "Core", false, "VendorDetail", "Vendor" } + }); + + migrationBuilder.InsertData( + table: "Core_Role", + columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, + values: new object[,] + { + { 1L, "4776a1b2-dbe4-4056-82ec-8bed211d1454", "admin", "ADMIN" }, + { 2L, "00d172be-03a0-4856-8b12-26d63fcf4374", "customer", "CUSTOMER" }, + { 3L, "d4754388-8355-4018-b728-218018836817", "guest", "GUEST" }, + { 4L, "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", "vendor", "VENDOR" } + }); + + migrationBuilder.InsertData( + table: "Core_User", + columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "CreatedOn", "Culture", "DefaultBillingAddressId", "DefaultShippingAddressId", "Email", "EmailConfirmed", "ExtensionData", "FullName", "IsDeleted", "LatestUpdatedOn", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "RefreshTokenHash", "SecurityStamp", "TwoFactorEnabled", "UserGuid", "UserName", "VendorId" }, + values: new object[,] + { + { 2L, 0, "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "system@simplcommerce.com", false, null, "System User", true, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "SYSTEM@SIMPLCOMMERCE.COM", "SYSTEM@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "a9565acb-cee6-425f-9833-419a793f5fba", false, new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), "system@simplcommerce.com", null }, + { 10L, 0, "c83afcbc-312c-4589-bad7-8686bd4754c0", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "admin@simplcommerce.com", false, null, "Shop Admin", false, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "ADMIN@SIMPLCOMMERCE.COM", "ADMIN@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "d6847450-47f0-4c7a-9fed-0c66234bf61f", false, new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), "admin@simplcommerce.com", null } + }); + + migrationBuilder.InsertData( + table: "Core_Widget", + columns: new[] { "Id", "CreateUrl", "CreatedOn", "EditUrl", "IsPublished", "Name", "ViewComponentName" }, + values: new object[,] + { + { "CarouselWidget", "widget-carousel-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-carousel-edit", false, "Carousel Widget", "CarouselWidget" }, + { "CategoryWidget", "widget-category-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-category-edit", false, "Category Widget", "CategoryWidget" }, + { "HtmlWidget", "widget-html-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-html-edit", false, "Html Widget", "HtmlWidget" }, + { "ProductWidget", "widget-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-product-edit", false, "Product Widget", "ProductWidget" } + }); + + migrationBuilder.InsertData( + table: "Core_Widget", + columns: new[] { "Id", "CreateUrl", "CreatedOn", "EditUrl", "IsPublished", "Name", "ViewComponentName" }, + values: new object[,] + { + { "RecentlyViewedWidget", "widget-recently-viewed-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-recently-viewed-edit", false, "Recently Viewed Widget", "RecentlyViewedWidget" }, + { "SimpleProductWidget", "widget-simple-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-simple-product-edit", false, "Simple Product Widget", "SimpleProductWidget" }, + { "SpaceBarWidget", "widget-spacebar-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-spacebar-edit", false, "SpaceBar Widget", "SpaceBarWidget" } + }); + + migrationBuilder.InsertData( + table: "Core_WidgetZone", + columns: new[] { "Id", "Description", "Name" }, + values: new object[,] + { + { 1L, null, "Home Featured" }, + { 2L, null, "Home Main Content" }, + { 3L, null, "Home After Main Content" } + }); + + migrationBuilder.InsertData( + table: "Localization_Culture", + columns: new[] { "Id", "Name" }, + values: new object[] { "en-US", "English (US)" }); + + migrationBuilder.InsertData( + table: "Payments_PaymentProvider", + columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "LandingViewComponentName", "Name" }, + values: new object[,] + { + { "Braintree", "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", "payments-braintree-config", true, "BraintreeLanding", "Braintree" }, + { "Cashfree", "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", "payments-cashfree-config", true, "CashfreeLanding", "Cashfree Payment Gateway" }, + { "CoD", null, "payments-cod-config", true, "CoDLanding", "Cash On Delivery" }, + { "MomoPayment", "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", "payments-momo-config", true, "MomoLanding", "Momo Payment" }, + { "NganLuong", "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", "payments-nganluong-config", true, "NganLuongLanding", "Ngan Luong Payment" }, + { "PaypalExpress", "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", "payments-paypalExpress-config", true, "PaypalExpressLanding", "Paypal Express" }, + { "Stripe", "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", "payments-stripe-config", true, "StripeLanding", "Stripe" } + }); + + migrationBuilder.InsertData( + table: "Shipping_ShippingProvider", + columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "Name", "OnlyCountryIdsString", "OnlyStateOrProvinceIdsString", "ShippingPriceServiceTypeName", "ToAllShippingEnabledCountries", "ToAllShippingEnabledStatesOrProvinces" }, + values: new object[,] + { + { "FreeShip", "{MinimumOrderAmount : 1}", "", true, "Free Ship", null, null, "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", true, true }, + { "TableRate", null, "shipping-table-rate-config", true, "Table Rate", null, null, "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", true, true } + }); + + migrationBuilder.InsertData( + table: "Tax_TaxClass", + columns: new[] { "Id", "Name" }, + values: new object[] { 1L, "Standard VAT" }); + + migrationBuilder.InsertData( + table: "Core_StateOrProvince", + columns: new[] { "Id", "Code", "CountryId", "Name", "Type" }, + values: new object[] { 1L, null, "VN", "Hồ Chí Minh", "Thành Phố" }); + + migrationBuilder.InsertData( + table: "Core_StateOrProvince", + columns: new[] { "Id", "Code", "CountryId", "Name", "Type" }, + values: new object[] { 2L, "WA", "US", "Washington", null }); + + migrationBuilder.InsertData( + table: "Core_UserRole", + columns: new[] { "RoleId", "UserId" }, + values: new object[] { 1L, 10L }); + + migrationBuilder.InsertData( + table: "Core_Address", + columns: new[] { "Id", "AddressLine1", "AddressLine2", "City", "ContactName", "CountryId", "DistrictId", "Phone", "StateOrProvinceId", "ZipCode" }, + values: new object[] { 1L, "364 Cong Hoa", null, null, "Thien Nguyen", "VN", null, null, 1L, null }); + + migrationBuilder.InsertData( + table: "Core_District", + columns: new[] { "Id", "Location", "Name", "StateOrProvinceId", "Type" }, + values: new object[] { 1L, null, "Quận 1", 1L, "Quận" }); + + migrationBuilder.InsertData( + table: "Core_District", + columns: new[] { "Id", "Location", "Name", "StateOrProvinceId", "Type" }, + values: new object[] { 2L, null, "Quận 2", 1L, "Quận" }); + + migrationBuilder.InsertData( + table: "Inventory_Warehouse", + columns: new[] { "Id", "AddressId", "Name", "VendorId" }, + values: new object[] { 1L, 1L, "Default warehouse", null }); + + migrationBuilder.CreateIndex( + name: "IX_ActivityLog_Activity_ActivityTypeId", + table: "ActivityLog_Activity", + column: "ActivityTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Category_ParentId", + table: "Catalog_Category", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Category_ThumbnailImageId", + table: "Catalog_Category", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_BrandId", + table: "Catalog_Product", + column: "BrandId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_CreatedById", + table: "Catalog_Product", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_LatestUpdatedById", + table: "Catalog_Product", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_TaxClassId", + table: "Catalog_Product", + column: "TaxClassId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_Product_ThumbnailImageId", + table: "Catalog_Product", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttribute_GroupId", + table: "Catalog_ProductAttribute", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttributeValue_AttributeId", + table: "Catalog_ProductAttributeValue", + column: "AttributeId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductAttributeValue_ProductId", + table: "Catalog_ProductAttributeValue", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductCategory_CategoryId", + table: "Catalog_ProductCategory", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductCategory_ProductId", + table: "Catalog_ProductCategory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductLink_LinkedProductId", + table: "Catalog_ProductLink", + column: "LinkedProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductLink_ProductId", + table: "Catalog_ProductLink", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductMedia_MediaId", + table: "Catalog_ProductMedia", + column: "MediaId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductMedia_ProductId", + table: "Catalog_ProductMedia", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionCombination_OptionId", + table: "Catalog_ProductOptionCombination", + column: "OptionId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionCombination_ProductId", + table: "Catalog_ProductOptionCombination", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionValue_OptionId", + table: "Catalog_ProductOptionValue", + column: "OptionId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductOptionValue_ProductId", + table: "Catalog_ProductOptionValue", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductPriceHistory_CreatedById", + table: "Catalog_ProductPriceHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductPriceHistory_ProductId", + table: "Catalog_ProductPriceHistory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Catalog_ProductTemplateProductAttribute_ProductAttributeId", + table: "Catalog_ProductTemplateProductAttribute", + column: "ProductAttributeId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_EntityId", + table: "Cms_MenuItem", + column: "EntityId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_MenuId", + table: "Cms_MenuItem", + column: "MenuId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_MenuItem_ParentId", + table: "Cms_MenuItem", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_Page_CreatedById", + table: "Cms_Page", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Cms_Page_LatestUpdatedById", + table: "Cms_Page", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Comments_Comment_ParentId", + table: "Comments_Comment", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Comments_Comment_UserId", + table: "Comments_Comment", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Contacts_Contact_ContactAreaId", + table: "Contacts_Contact", + column: "ContactAreaId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_CountryId", + table: "Core_Address", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_DistrictId", + table: "Core_Address", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Address_StateOrProvinceId", + table: "Core_Address", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_CustomerGroup_Name", + table: "Core_CustomerGroup", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Core_CustomerGroupUser_CustomerGroupId", + table: "Core_CustomerGroupUser", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_District_StateOrProvinceId", + table: "Core_District", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_Entity_EntityTypeId", + table: "Core_Entity", + column: "EntityTypeId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "Core_Role", + column: "NormalizedName", + unique: true, + filter: "[NormalizedName] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Core_RoleClaim_RoleId", + table: "Core_RoleClaim", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_StateOrProvince_CountryId", + table: "Core_StateOrProvince", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "Core_User", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_DefaultBillingAddressId", + table: "Core_User", + column: "DefaultBillingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_DefaultShippingAddressId", + table: "Core_User", + column: "DefaultShippingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_User_VendorId", + table: "Core_User", + column: "VendorId"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "Core_User", + column: "NormalizedUserName", + unique: true, + filter: "[NormalizedUserName] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserAddress_AddressId", + table: "Core_UserAddress", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserAddress_UserId", + table: "Core_UserAddress", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserClaim_UserId", + table: "Core_UserClaim", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserLogin_UserId", + table: "Core_UserLogin", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_UserRole_RoleId", + table: "Core_UserRole", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_WidgetInstance_WidgetId", + table: "Core_WidgetInstance", + column: "WidgetId"); + + migrationBuilder.CreateIndex( + name: "IX_Core_WidgetInstance_WidgetZoneId", + table: "Core_WidgetInstance", + column: "WidgetZoneId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Stock_ProductId", + table: "Inventory_Stock", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Stock_WarehouseId", + table: "Inventory_Stock", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_CreatedById", + table: "Inventory_StockHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_ProductId", + table: "Inventory_StockHistory", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_StockHistory_WarehouseId", + table: "Inventory_StockHistory", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Warehouse_AddressId", + table: "Inventory_Warehouse", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Inventory_Warehouse_VendorId", + table: "Inventory_Warehouse", + column: "VendorId"); + + migrationBuilder.CreateIndex( + name: "IX_Localization_LocalizedContentProperty_CultureId", + table: "Localization_LocalizedContentProperty", + column: "CultureId"); + + migrationBuilder.CreateIndex( + name: "IX_Localization_Resource_CultureId", + table: "Localization_Resource", + column: "CultureId"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_CreatedById", + table: "News_NewsItem", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_LatestUpdatedById", + table: "News_NewsItem", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItem_ThumbnailImageId", + table: "News_NewsItem", + column: "ThumbnailImageId"); + + migrationBuilder.CreateIndex( + name: "IX_News_NewsItemCategory_NewsItemId", + table: "News_NewsItemCategory", + column: "NewsItemId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_BillingAddressId", + table: "Orders_Order", + column: "BillingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_CreatedById", + table: "Orders_Order", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_CustomerId", + table: "Orders_Order", + column: "CustomerId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_LatestUpdatedById", + table: "Orders_Order", + column: "LatestUpdatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_ParentId", + table: "Orders_Order", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_Order_ShippingAddressId", + table: "Orders_Order", + column: "ShippingAddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_CountryId", + table: "Orders_OrderAddress", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_DistrictId", + table: "Orders_OrderAddress", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderAddress_StateOrProvinceId", + table: "Orders_OrderAddress", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderHistory_CreatedById", + table: "Orders_OrderHistory", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderHistory_OrderId", + table: "Orders_OrderHistory", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderItem_OrderId", + table: "Orders_OrderItem", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_OrderItem_ProductId", + table: "Orders_OrderItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Payments_Payment_OrderId", + table: "Payments_Payment", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleCategory_CategoryId", + table: "Pricing_CartRuleCategory", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleCustomerGroup_CustomerGroupId", + table: "Pricing_CartRuleCustomerGroup", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleProduct_ProductId", + table: "Pricing_CartRuleProduct", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_CartRuleId", + table: "Pricing_CartRuleUsage", + column: "CartRuleId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_CouponId", + table: "Pricing_CartRuleUsage", + column: "CouponId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CartRuleUsage_UserId", + table: "Pricing_CartRuleUsage", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_CatalogRuleCustomerGroup_CustomerGroupId", + table: "Pricing_CatalogRuleCustomerGroup", + column: "CustomerGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Pricing_Coupon_CartRuleId", + table: "Pricing_Coupon", + column: "CartRuleId"); + + migrationBuilder.CreateIndex( + name: "IX_ProductComparison_ComparingProduct_ProductId", + table: "ProductComparison_ComparingProduct", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_ProductComparison_ComparingProduct_UserId", + table: "ProductComparison_ComparingProduct", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Reply_ReviewId", + table: "Reviews_Reply", + column: "ReviewId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Reply_UserId", + table: "Reviews_Reply", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Reviews_Review_UserId", + table: "Reviews_Review", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_CreatedById", + table: "Shipments_Shipment", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_OrderId", + table: "Shipments_Shipment", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_Shipment_WarehouseId", + table: "Shipments_Shipment", + column: "WarehouseId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_ShipmentItem_ProductId", + table: "Shipments_ShipmentItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Shipments_ShipmentItem_ShipmentId", + table: "Shipments_ShipmentItem", + column: "ShipmentId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_CountryId", + table: "ShippingTableRate_PriceAndDestination", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_DistrictId", + table: "ShippingTableRate_PriceAndDestination", + column: "DistrictId"); + + migrationBuilder.CreateIndex( + name: "IX_ShippingTableRate_PriceAndDestination_StateOrProvinceId", + table: "ShippingTableRate_PriceAndDestination", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_Cart_CreatedById", + table: "ShoppingCart_Cart", + column: "CreatedById"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_Cart_CustomerId", + table: "ShoppingCart_Cart", + column: "CustomerId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_CartItem_CartId", + table: "ShoppingCart_CartItem", + column: "CartId"); + + migrationBuilder.CreateIndex( + name: "IX_ShoppingCart_CartItem_ProductId", + table: "ShoppingCart_CartItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_CountryId", + table: "Tax_TaxRate", + column: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_StateOrProvinceId", + table: "Tax_TaxRate", + column: "StateOrProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Tax_TaxRate_TaxClassId", + table: "Tax_TaxRate", + column: "TaxClassId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishList_UserId", + table: "WishList_WishList", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishListItem_ProductId", + table: "WishList_WishListItem", + column: "ProductId"); + + migrationBuilder.CreateIndex( + name: "IX_WishList_WishListItem_WishListId", + table: "WishList_WishListItem", + column: "WishListId"); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_Product_Core_User_CreatedById", + table: "Catalog_Product", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_Product_Core_User_LatestUpdatedById", + table: "Catalog_Product", + column: "LatestUpdatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Catalog_ProductPriceHistory_Core_User_CreatedById", + table: "Catalog_ProductPriceHistory", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Cms_Page_Core_User_CreatedById", + table: "Cms_Page", + column: "CreatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Cms_Page_Core_User_LatestUpdatedById", + table: "Cms_Page", + column: "LatestUpdatedById", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Comments_Comment_Core_User_UserId", + table: "Comments_Comment", + column: "UserId", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Core_CustomerGroupUser_Core_User_UserId", + table: "Core_CustomerGroupUser", + column: "UserId", + principalTable: "Core_User", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Core_User_Core_UserAddress_DefaultBillingAddressId", + table: "Core_User", + column: "DefaultBillingAddressId", + principalTable: "Core_UserAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Core_User_Core_UserAddress_DefaultShippingAddressId", + table: "Core_User", + column: "DefaultShippingAddressId", + principalTable: "Core_UserAddress", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Core_UserAddress_Core_User_UserId", + table: "Core_UserAddress"); + + migrationBuilder.DropTable( + name: "ActivityLog_Activity"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttributeValue"); + + migrationBuilder.DropTable( + name: "Catalog_ProductCategory"); + + migrationBuilder.DropTable( + name: "Catalog_ProductLink"); + + migrationBuilder.DropTable( + name: "Catalog_ProductMedia"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOptionCombination"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOptionValue"); + + migrationBuilder.DropTable( + name: "Catalog_ProductPriceHistory"); + + migrationBuilder.DropTable( + name: "Catalog_ProductTemplateProductAttribute"); + + migrationBuilder.DropTable( + name: "Cms_MenuItem"); + + migrationBuilder.DropTable( + name: "Cms_Page"); + + migrationBuilder.DropTable( + name: "Comments_Comment"); + + migrationBuilder.DropTable( + name: "Contacts_Contact"); + + migrationBuilder.DropTable( + name: "Core_AppSetting"); + + migrationBuilder.DropTable( + name: "Core_CustomerGroupUser"); + + migrationBuilder.DropTable( + name: "Core_RoleClaim"); + + migrationBuilder.DropTable( + name: "Core_UserClaim"); + + migrationBuilder.DropTable( + name: "Core_UserLogin"); + + migrationBuilder.DropTable( + name: "Core_UserRole"); + + migrationBuilder.DropTable( + name: "Core_UserToken"); + + migrationBuilder.DropTable( + name: "Core_WidgetInstance"); + + migrationBuilder.DropTable( + name: "Inventory_Stock"); + + migrationBuilder.DropTable( + name: "Inventory_StockHistory"); + + migrationBuilder.DropTable( + name: "Localization_LocalizedContentProperty"); + + migrationBuilder.DropTable( + name: "Localization_Resource"); + + migrationBuilder.DropTable( + name: "News_NewsItemCategory"); + + migrationBuilder.DropTable( + name: "Orders_OrderHistory"); + + migrationBuilder.DropTable( + name: "Orders_OrderItem"); + + migrationBuilder.DropTable( + name: "Payments_Payment"); + + migrationBuilder.DropTable( + name: "Payments_PaymentProvider"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleCategory"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleCustomerGroup"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleProduct"); + + migrationBuilder.DropTable( + name: "Pricing_CartRuleUsage"); + + migrationBuilder.DropTable( + name: "Pricing_CatalogRuleCustomerGroup"); + + migrationBuilder.DropTable( + name: "ProductComparison_ComparingProduct"); + + migrationBuilder.DropTable( + name: "ProductRecentlyViewed_RecentlyViewedProduct"); + + migrationBuilder.DropTable( + name: "Reviews_Reply"); + + migrationBuilder.DropTable( + name: "Search_Query"); + + migrationBuilder.DropTable( + name: "Shipments_ShipmentItem"); + + migrationBuilder.DropTable( + name: "Shipping_ShippingProvider"); + + migrationBuilder.DropTable( + name: "ShippingTableRate_PriceAndDestination"); + + migrationBuilder.DropTable( + name: "ShoppingCart_CartItem"); + + migrationBuilder.DropTable( + name: "Tax_TaxRate"); + + migrationBuilder.DropTable( + name: "WishList_WishListItem"); + + migrationBuilder.DropTable( + name: "ActivityLog_ActivityType"); + + migrationBuilder.DropTable( + name: "Catalog_ProductOption"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttribute"); + + migrationBuilder.DropTable( + name: "Catalog_ProductTemplate"); + + migrationBuilder.DropTable( + name: "Cms_Menu"); + + migrationBuilder.DropTable( + name: "Core_Entity"); + + migrationBuilder.DropTable( + name: "Contacts_ContactArea"); + + migrationBuilder.DropTable( + name: "Core_Role"); + + migrationBuilder.DropTable( + name: "Core_Widget"); + + migrationBuilder.DropTable( + name: "Core_WidgetZone"); + + migrationBuilder.DropTable( + name: "Localization_Culture"); + + migrationBuilder.DropTable( + name: "News_NewsCategory"); + + migrationBuilder.DropTable( + name: "News_NewsItem"); + + migrationBuilder.DropTable( + name: "Catalog_Category"); + + migrationBuilder.DropTable( + name: "Pricing_Coupon"); + + migrationBuilder.DropTable( + name: "Core_CustomerGroup"); + + migrationBuilder.DropTable( + name: "Pricing_CatalogRule"); + + migrationBuilder.DropTable( + name: "Reviews_Review"); + + migrationBuilder.DropTable( + name: "Shipments_Shipment"); + + migrationBuilder.DropTable( + name: "ShoppingCart_Cart"); + + migrationBuilder.DropTable( + name: "Catalog_Product"); + + migrationBuilder.DropTable( + name: "WishList_WishList"); + + migrationBuilder.DropTable( + name: "Catalog_ProductAttributeGroup"); + + migrationBuilder.DropTable( + name: "Core_EntityType"); + + migrationBuilder.DropTable( + name: "Pricing_CartRule"); + + migrationBuilder.DropTable( + name: "Inventory_Warehouse"); + + migrationBuilder.DropTable( + name: "Orders_Order"); + + migrationBuilder.DropTable( + name: "Catalog_Brand"); + + migrationBuilder.DropTable( + name: "Core_Media"); + + migrationBuilder.DropTable( + name: "Tax_TaxClass"); + + migrationBuilder.DropTable( + name: "Orders_OrderAddress"); + + migrationBuilder.DropTable( + name: "Core_User"); + + migrationBuilder.DropTable( + name: "Core_UserAddress"); + + migrationBuilder.DropTable( + name: "Core_Vendor"); + + migrationBuilder.DropTable( + name: "Core_Address"); + + migrationBuilder.DropTable( + name: "Core_District"); + + migrationBuilder.DropTable( + name: "Core_StateOrProvince"); + + migrationBuilder.DropTable( + name: "Core_Country"); + } + } +} From b3d0dad186b9e9dff38e70e416646584d3eac580 Mon Sep 17 00:00:00 2001 From: Cihan T Date: Tue, 10 May 2022 00:47:10 +0300 Subject: [PATCH 2/3] docker-compose support added --- .dockerignore | 25 +++++++ .gitignore | 5 +- SimplCommerce.sln | 16 ++++- docker/.env | 8 +++ docker/create_docker_folders.bat | 3 + docker/create_docker_folders.sh | 3 + docker/docker-compose.dcproj | 55 +++++++++++++++ docker/docker-compose.override.yml | 1 + docker/docker-compose.yml | 29 ++++++++ src/Database/StaticData-TR.sql | 4 +- src/SimplCommerce.WebHost/Dockerfile | 68 +++++++++++++++++++ .../Properties/launchSettings.json | 11 ++- src/SimplCommerce.WebHost/appsettings.json | 8 ++- 13 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 .dockerignore create mode 100644 docker/.env create mode 100644 docker/create_docker_folders.bat create mode 100644 docker/create_docker_folders.sh create mode 100644 docker/docker-compose.dcproj create mode 100644 docker/docker-compose.override.yml create mode 100644 docker/docker-compose.yml create mode 100644 src/SimplCommerce.WebHost/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..3729ff0cd1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index efe3e71127..f9cff86f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -162,4 +162,7 @@ src/Modules/**/launchSettings.json PublishProfiles/ logs/ src/Modules/**/wwwroot/admin/*.min.js -.vscode \ No newline at end of file +.vscode + +**/data/* +**/logs/* \ No newline at end of file diff --git a/SimplCommerce.sln b/SimplCommerce.sln index f8d3e78d6d..fbbda79f4f 100644 --- a/SimplCommerce.sln +++ b/SimplCommerce.sln @@ -136,7 +136,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Module.Paymen EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Db.MsSql", "src\SimplCommerce.Db.MsSql\SimplCommerce.Db.MsSql.csproj", "{2FD1634B-E0ED-4E68-A993-57AAEF2B9474}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimplCommerce.Db.PgSql", "src\SimplCommerce.Db.PgSql\SimplCommerce.Db.PgSql.csproj", "{61985132-75C9-4601-9030-6E2B76781E0F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Db.PgSql", "src\SimplCommerce.Db.PgSql\SimplCommerce.Db.PgSql.csproj", "{61985132-75C9-4601-9030-6E2B76781E0F}" +EndProject +Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker\docker-compose.dcproj", "{59ACBE78-9B5D-4386-8291-253898925E48}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -724,6 +726,18 @@ Global {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x64.Build.0 = Release|Any CPU {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.ActiveCfg = Release|Any CPU {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.Build.0 = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x64.ActiveCfg = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x64.Build.0 = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x86.ActiveCfg = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x86.Build.0 = Debug|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|Any CPU.Build.0 = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x64.ActiveCfg = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x64.Build.0 = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x86.ActiveCfg = Release|Any CPU + {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/docker/.env b/docker/.env new file mode 100644 index 0000000000..0cd43d0fb2 --- /dev/null +++ b/docker/.env @@ -0,0 +1,8 @@ +ASPNETCORE_ENVIRONMENT=Development + +VOLUMES_BASEPATH=./storage + +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=postgres + diff --git a/docker/create_docker_folders.bat b/docker/create_docker_folders.bat new file mode 100644 index 0000000000..3c2110d321 --- /dev/null +++ b/docker/create_docker_folders.bat @@ -0,0 +1,3 @@ +md docker\storage +md docker\storage\postgres +md docker\storage\postgres\data \ No newline at end of file diff --git a/docker/create_docker_folders.sh b/docker/create_docker_folders.sh new file mode 100644 index 0000000000..bc056c0e04 --- /dev/null +++ b/docker/create_docker_folders.sh @@ -0,0 +1,3 @@ +mkdir -p ./docker/storage/postgres/data + +chmod -R 777 ./docker/storage diff --git a/docker/docker-compose.dcproj b/docker/docker-compose.dcproj new file mode 100644 index 0000000000..0694d9ee68 --- /dev/null +++ b/docker/docker-compose.dcproj @@ -0,0 +1,55 @@ + + + + 2.1 + Linux + 59acbe78-9b5d-4386-8291-253898925e48 + LaunchBrowser + {Scheme}://localhost:{ServicePort}/swagger + SimplCommerce + SimplCommerce + + + + + + + + + + + + + + + + + + + + + + + docker-compose.yml + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docker/docker-compose.override.yml b/docker/docker-compose.override.yml new file mode 100644 index 0000000000..8e89b0713c --- /dev/null +++ b/docker/docker-compose.override.yml @@ -0,0 +1 @@ +version: '3.4' diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000000..3ece5e1a9c --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + simplcommerce: + build: + context: ../ + dockerfile: src/SimplCommerce.WebHost/Dockerfile + environment: + ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT} + ASPNETCORE_URLS: ${ASPNETCORE_URLS:-http://+:80;https://+:443} + ConnectionStrings__DefaultConnection: Host=postgres;Database=${POSTGRES_DB};Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}; + volumes: + - ${VOLUMES_BASEPATH}/logs:/app/logs + ports: + - "5000:80" + - "5001:443" + + postgres: + image: postgres:latest + restart: always + environment: + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + ports: + - "15432:5432" + - "8085:8080" + volumes: + - ${VOLUMES_BASEPATH}/postgres/data:/var/lib/postgresql/data diff --git a/src/Database/StaticData-TR.sql b/src/Database/StaticData-TR.sql index cb68c5abf8..6b57f1787a 100644 --- a/src/Database/StaticData-TR.sql +++ b/src/Database/StaticData-TR.sql @@ -1,7 +1,7 @@ INSERT [dbo].[Localization_Culture] ([Id], [Name]) VALUES ('tr-TR', N'Turkish') GO -INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Register', N'Kayıt olmak') +INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Register', N'Kayıt olun') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Hello {0}!', N'Merhaba {0}!') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Log in', N'Oturum aç') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Log off', N'Oturumu Kapat') @@ -197,7 +197,7 @@ INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-T INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Account Information', N'Hesap Bilgileri') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Edit', N'Düzenle') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Security', N'Güvenlik') -INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Create', N'yaratmak') +INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Create', N'Oluştur') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'External Logins', N'Harici Girişler') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Manage', N'Yönet') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Default shipping address', N'Varsayılan kargo adresi') diff --git a/src/SimplCommerce.WebHost/Dockerfile b/src/SimplCommerce.WebHost/Dockerfile new file mode 100644 index 0000000000..765a76ca59 --- /dev/null +++ b/src/SimplCommerce.WebHost/Dockerfile @@ -0,0 +1,68 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj", "src/SimplCommerce.WebHost/"] +COPY ["src/Modules/SimplCommerce.Module.DinkToPdf/SimplCommerce.Module.DinkToPdf.csproj", "src/Modules/SimplCommerce.Module.DinkToPdf/"] +COPY ["src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj", "src/SimplCommerce.Infrastructure/"] +COPY ["src/Modules/SimplCommerce.Module.Core/SimplCommerce.Module.Core.csproj", "src/Modules/SimplCommerce.Module.Core/"] +COPY ["src/Modules/SimplCommerce.Module.Reviews/SimplCommerce.Module.Reviews.csproj", "src/Modules/SimplCommerce.Module.Reviews/"] +COPY ["src/Modules/SimplCommerce.Module.Orders/SimplCommerce.Module.Orders.csproj", "src/Modules/SimplCommerce.Module.Orders/"] +COPY ["src/Modules/SimplCommerce.Module.ShippingPrices/SimplCommerce.Module.ShippingPrices.csproj", "src/Modules/SimplCommerce.Module.ShippingPrices/"] +COPY ["src/Modules/SimplCommerce.Module.Catalog/SimplCommerce.Module.Catalog.csproj", "src/Modules/SimplCommerce.Module.Catalog/"] +COPY ["src/Modules/SimplCommerce.Module.Tax/SimplCommerce.Module.Tax.csproj", "src/Modules/SimplCommerce.Module.Tax/"] +COPY ["src/Modules/SimplCommerce.Module.Shipping/SimplCommerce.Module.Shipping.csproj", "src/Modules/SimplCommerce.Module.Shipping/"] +COPY ["src/Modules/SimplCommerce.Module.ShoppingCart/SimplCommerce.Module.ShoppingCart.csproj", "src/Modules/SimplCommerce.Module.ShoppingCart/"] +COPY ["src/Modules/SimplCommerce.Module.Pricing/SimplCommerce.Module.Pricing.csproj", "src/Modules/SimplCommerce.Module.Pricing/"] +COPY ["src/Modules/SimplCommerce.Module.ProductRecentlyViewed/SimplCommerce.Module.ProductRecentlyViewed.csproj", "src/Modules/SimplCommerce.Module.ProductRecentlyViewed/"] +COPY ["src/Modules/SimplCommerce.Module.Search/SimplCommerce.Module.Search.csproj", "src/Modules/SimplCommerce.Module.Search/"] +COPY ["src/Modules/SimplCommerce.Module.ShippingTableRate/SimplCommerce.Module.ShippingTableRate.csproj", "src/Modules/SimplCommerce.Module.ShippingTableRate/"] +COPY ["src/Modules/SimplCommerce.Module.Payments/SimplCommerce.Module.Payments.csproj", "src/Modules/SimplCommerce.Module.Payments/"] +COPY ["src/Modules/SimplCommerce.Module.Comments/SimplCommerce.Module.Comments.csproj", "src/Modules/SimplCommerce.Module.Comments/"] +COPY ["src/Modules/SimplCommerce.Module.ShippingFree/SimplCommerce.Module.ShippingFree.csproj", "src/Modules/SimplCommerce.Module.ShippingFree/"] +COPY ["src/Modules/SimplCommerce.Module.News/SimplCommerce.Module.News.csproj", "src/Modules/SimplCommerce.Module.News/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentCashfree/SimplCommerce.Module.PaymentCashfree.csproj", "src/Modules/SimplCommerce.Module.PaymentCashfree/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentNganLuong/SimplCommerce.Module.PaymentNganLuong.csproj", "src/Modules/SimplCommerce.Module.PaymentNganLuong/"] +COPY ["src/Modules/SimplCommerce.Module.EmailSenderSmtp/SimplCommerce.Module.EmailSenderSmtp.csproj", "src/Modules/SimplCommerce.Module.EmailSenderSmtp/"] +COPY ["src/Modules/SimplCommerce.Module.SampleData/SimplCommerce.Module.SampleData.csproj", "src/Modules/SimplCommerce.Module.SampleData/"] +COPY ["src/Modules/SimplCommerce.Module.WishList/SimplCommerce.Module.WishList.csproj", "src/Modules/SimplCommerce.Module.WishList/"] +COPY ["src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj", "src/SimplCommerce.Db.MsSql/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentBraintree/SimplCommerce.Module.PaymentBraintree.csproj", "src/Modules/SimplCommerce.Module.PaymentBraintree/"] +COPY ["src/Modules/SimplCommerce.Module.Cms/SimplCommerce.Module.Cms.csproj", "src/Modules/SimplCommerce.Module.Cms/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentStripe/SimplCommerce.Module.PaymentStripe.csproj", "src/Modules/SimplCommerce.Module.PaymentStripe/"] +COPY ["src/Modules/SimplCommerce.Module.ProductComparison/SimplCommerce.Module.ProductComparison.csproj", "src/Modules/SimplCommerce.Module.ProductComparison/"] +COPY ["src/Modules/SimplCommerce.Module.StorageLocal/SimplCommerce.Module.StorageLocal.csproj", "src/Modules/SimplCommerce.Module.StorageLocal/"] +COPY ["src/Modules/SimplCommerce.Module.Vendors/SimplCommerce.Module.Vendors.csproj", "src/Modules/SimplCommerce.Module.Vendors/"] +COPY ["src/Modules/SimplCommerce.Module.Contacts/SimplCommerce.Module.Contacts.csproj", "src/Modules/SimplCommerce.Module.Contacts/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentMomo/SimplCommerce.Module.PaymentMomo.csproj", "src/Modules/SimplCommerce.Module.PaymentMomo/"] +COPY ["src/SimplCommerce.Db.PgSql/SimplCommerce.Db.PgSql.csproj", "src/SimplCommerce.Db.PgSql/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentPaypalExpress/SimplCommerce.Module.PaymentPaypalExpress.csproj", "src/Modules/SimplCommerce.Module.PaymentPaypalExpress/"] +COPY ["src/Modules/SimplCommerce.Module.Inventory/SimplCommerce.Module.Inventory.csproj", "src/Modules/SimplCommerce.Module.Inventory/"] +COPY ["src/Modules/SimplCommerce.Module.PaymentCoD/SimplCommerce.Module.PaymentCoD.csproj", "src/Modules/SimplCommerce.Module.PaymentCoD/"] +COPY ["src/Modules/SimplCommerce.Module.Shipments/SimplCommerce.Module.Shipments.csproj", "src/Modules/SimplCommerce.Module.Shipments/"] +COPY ["src/Modules/SimplCommerce.Module.ActivityLog/SimplCommerce.Module.ActivityLog.csproj", "src/Modules/SimplCommerce.Module.ActivityLog/"] +COPY ["src/Modules/SimplCommerce.Module.Localization/SimplCommerce.Module.Localization.csproj", "src/Modules/SimplCommerce.Module.Localization/"] +RUN dotnet restore "src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj" +COPY . . +WORKDIR "/src/src/SimplCommerce.WebHost" +RUN dotnet build "SimplCommerce.WebHost.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "SimplCommerce.WebHost.csproj" -c Release -o /app/publish + + +FROM base AS final + +RUN curl -SL "https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so" --output /app/libwkhtmltox.so + +RUN apt-get update \ + && apt-get install libgdiplus -y \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "SimplCommerce.WebHost.dll"] \ No newline at end of file diff --git a/src/SimplCommerce.WebHost/Properties/launchSettings.json b/src/SimplCommerce.WebHost/Properties/launchSettings.json index a890723e2a..3d980c22dc 100644 --- a/src/SimplCommerce.WebHost/Properties/launchSettings.json +++ b/src/SimplCommerce.WebHost/Properties/launchSettings.json @@ -18,10 +18,17 @@ "SimplCommerce.WebHost": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:49206;http://localhost:49208", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:49206;http://localhost:49208" + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "publishAllPorts": true, + "useSSL": true } } } \ No newline at end of file diff --git a/src/SimplCommerce.WebHost/appsettings.json b/src/SimplCommerce.WebHost/appsettings.json index 0cd638663b..771fb6403a 100644 --- a/src/SimplCommerce.WebHost/appsettings.json +++ b/src/SimplCommerce.WebHost/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=.;Database=SimplCommerce;Trusted_Connection=True;MultipleActiveResultSets=true" + "DefaultConnection": "Host=localhost:15432;Database=postgres;Username=postgres;Password=postgres" }, "Authentication" : { "Facebook" : { @@ -19,7 +19,11 @@ }, "Serilog": { "MinimumLevel": { - "Default": "Warning" + "Default": "Warning", + "Override": { + "Microsoft": "Warning", + "System": "Warning" + } }, "WriteTo": [ { From 33cb98e6b35d2c0035105b322512d407687f5c52 Mon Sep 17 00:00:00 2001 From: Cihan T Date: Tue, 10 May 2022 00:48:08 +0300 Subject: [PATCH 3/3] Now changed as UtcNow for db --- .../Events/EntityViewedHandler.cs | 2 +- .../Controllers/ProductApiController.cs | 2 +- .../Controllers/ProductCloneApiController.cs | 4 +- .../Models/ProductPriceHistory.cs | 2 +- .../Services/ProductPricingService.cs | 2 +- .../Cms/Controllers/PageApiController.cs | 2 +- .../Models/Comment.cs | 2 +- .../Models/Contact.cs | 2 +- .../Controllers/CustomerGroupApiController.cs | 2 +- .../Models/Content.cs | 4 +- .../Models/CustomerGroup.cs | 4 +- .../SimplCommerce.Module.Core/Models/User.cs | 4 +- .../Models/Vendor.cs | 2 +- .../Models/Widget.cs | 2 +- .../Models/WidgetInstance.cs | 6 +- .../Services/CurrencyService.cs | 4 +- .../Services/WidgetInstanceService.cs | 2 +- .../Services/StockService.cs | 2 +- .../News/Controllers/NewsItemApiController.cs | 2 +- .../OrderChangedCreateOrderHistoryHandler.cs | 2 +- .../OrderCreatedCreateOrderHistoryHandler.cs | 2 +- .../Models/Order.cs | 4 +- .../OrderCancellationBackgroundService.cs | 2 +- .../Services/OrderService.cs | 10 +- .../Models/Payment.cs | 4 +- .../Models/CartRuleUsage.cs | 2 +- .../Models/Coupon.cs | 2 +- .../Services/CouponService.cs | 4 +- .../Services/ComparingProductService.cs | 2 +- .../Events/EntityViewedHandler.cs | 4 +- .../Models/Reply.cs | 2 +- .../Models/Review.cs | 2 +- .../Search/Controllers/SearchController.cs | 2 +- .../Controllers/ShipmentApiController.cs | 4 +- .../Models/Shipment.cs | 4 +- .../Models/Cart.cs | 4 +- .../Services/CartService.cs | 4 +- .../Controllers/VendorApiController.cs | 2 +- .../Controllers/WishListController.cs | 8 +- .../Models/WishList.cs | 4 +- .../Models/WishListItem.cs | 4 +- src/SimplCommerce.WebHost/Program.cs | 13 +- .../SimplCommerce.WebHost.csproj | 4 +- .../20220508110554_Initial.Designer.cs | 4691 ----------------- .../Migrations/20220508110554_Initial.cs | 3200 ----------- 45 files changed, 80 insertions(+), 7958 deletions(-) delete mode 100644 src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs delete mode 100644 src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs diff --git a/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs b/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs index 02015111a7..1c011a6c54 100644 --- a/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs +++ b/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs @@ -30,7 +30,7 @@ public async Task Handle(EntityViewed notification, CancellationToken cancellati EntityId = notification.EntityId, EntityTypeId = notification.EntityTypeId, UserId = user.Id, - CreatedOn = DateTimeOffset.Now + CreatedOn = DateTimeOffset.UtcNow }; _activityRepository.Add(activity); diff --git a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs index 78fe38db63..8c39b42a84 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs +++ b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs @@ -754,7 +754,7 @@ private async Task AddOrDeleteProductVariation(User loginUser, ProductForm mode } productLink.LinkedProduct.LatestUpdatedById = loginUser.Id; - productLink.LinkedProduct.LatestUpdatedOn = DateTimeOffset.Now; + productLink.LinkedProduct.LatestUpdatedOn = DateTimeOffset.UtcNow; productLink.LinkedProduct.Sku = productVariationVm.Sku; productLink.LinkedProduct.Gtin = productVariationVm.Gtin; productLink.LinkedProduct.Price = productVariationVm.Price; diff --git a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs index 746c6df985..27f7082ef6 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs +++ b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs @@ -66,8 +66,8 @@ public async Task Post([FromBody] ProductCloneFormVm model) newProduct.Slug = model.Slug; newProduct.CreatedById = currentUser.Id; newProduct.LatestUpdatedById = currentUser.Id; - newProduct.CreatedOn = DateTimeOffset.Now; - newProduct.LatestUpdatedOn = DateTimeOffset.Now; + newProduct.CreatedOn = DateTimeOffset.UtcNow; + newProduct.LatestUpdatedOn = DateTimeOffset.UtcNow; var productPriceHistory = CreatePriceHistory(currentUser, newProduct); newProduct.PriceHistories.Add(productPriceHistory); diff --git a/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs b/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs index 720ab0253c..c4f8b1c740 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs +++ b/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs @@ -9,7 +9,7 @@ public class ProductPriceHistory : EntityBase { public ProductPriceHistory() { - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public Product Product { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs b/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs index c4ca725914..8f1a212be2 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs +++ b/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs @@ -29,7 +29,7 @@ public CalculatedProductPrice CalculateProductPrice(decimal price, decimal? oldP var percentOfSaving = 0; var calculatedPrice = price; - if (specialPrice.HasValue && specialPriceStart < DateTimeOffset.Now && DateTimeOffset.Now < specialPriceEnd) + if (specialPrice.HasValue && specialPriceStart < DateTimeOffset.UtcNow && DateTimeOffset.UtcNow < specialPriceEnd) { calculatedPrice = specialPrice.Value; diff --git a/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs b/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs index 9a201e2122..5d2164f0f6 100644 --- a/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs +++ b/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs @@ -110,7 +110,7 @@ public async Task Put(long id, [FromBody] PageForm model) page.MetaDescription = model.MetaDescription; page.Body = model.Body; page.IsPublished = model.IsPublished; - page.LatestUpdatedOn = DateTimeOffset.Now; + page.LatestUpdatedOn = DateTimeOffset.UtcNow; page.LatestUpdatedBy = currentUser; await _pageService.Update(page); diff --git a/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs b/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs index 6876cceba7..4d0f55ab44 100644 --- a/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs +++ b/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs @@ -11,7 +11,7 @@ public class Comment : EntityBase public Comment() { Status = CommentStatus.Approved; - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public long UserId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs b/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs index 66d1b525f6..dfdc600099 100644 --- a/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs +++ b/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs @@ -8,7 +8,7 @@ public class Contact : EntityBase { public Contact() { - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } [StringLength(450)] diff --git a/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs b/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs index 1cfb0908ce..73d9bf5d7f 100644 --- a/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs +++ b/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs @@ -135,7 +135,7 @@ public async Task Put(long id, [FromBody] CustomerGroupForm model customerGroup.Name = model.Name; customerGroup.Description = model.Description; customerGroup.IsActive = model.IsActive; - customerGroup.LatestUpdatedOn = DateTimeOffset.Now; + customerGroup.LatestUpdatedOn = DateTimeOffset.UtcNow; await _customerGroupRepository.SaveChangesAsync(); return Accepted(); diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Content.cs b/src/Modules/SimplCommerce.Module.Core/Models/Content.cs index 8ed1760dcc..97072898c3 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/Content.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/Content.cs @@ -10,8 +10,8 @@ public abstract class Content : EntityBase protected Content() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } [Required(ErrorMessage = "The {0} field is required.")] diff --git a/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs b/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs index 304b3e89c4..9451ea17af 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs @@ -9,8 +9,8 @@ public class CustomerGroup : EntityBase { public CustomerGroup() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } [Required(ErrorMessage = "The {0} field is required.")] diff --git a/src/Modules/SimplCommerce.Module.Core/Models/User.cs b/src/Modules/SimplCommerce.Module.Core/Models/User.cs index 5e6e8bd3fc..96c50c23bf 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/User.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/User.cs @@ -10,8 +10,8 @@ public class User : IdentityUser, IEntityWithTypedId, IExtendableObj { public User() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } public const string SettingsDataKey = "Settings"; diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs b/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs index 46b21c807f..3ad925b066 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs @@ -9,7 +9,7 @@ public class Vendor : EntityBase { public Vendor() { - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } [Required(ErrorMessage = "The {0} field is required.")] diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs b/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs index 6c0f0b7c14..63676ec3c2 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs @@ -9,7 +9,7 @@ public class Widget : EntityBaseWithTypedId public Widget(string id) { Id = id; - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public string Code diff --git a/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs b/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs index 9ff86cd88b..5b8c5ad02a 100644 --- a/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs +++ b/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs @@ -8,8 +8,8 @@ public class WidgetInstance : EntityBase { public WidgetInstance() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } [StringLength(450)] @@ -45,7 +45,7 @@ public bool IsPublished { get { - return PublishStart.HasValue && PublishStart.Value < DateTimeOffset.Now && (!PublishEnd.HasValue || PublishEnd.Value > DateTimeOffset.Now); + return PublishStart.HasValue && PublishStart.Value < DateTimeOffset.UtcNow && (!PublishEnd.HasValue || PublishEnd.Value > DateTimeOffset.UtcNow); } } } diff --git a/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs b/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs index 4e49bbd69c..6b7999426c 100644 --- a/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs +++ b/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs @@ -10,7 +10,7 @@ public class CurrencyService : ICurrencyService public CurrencyService(IConfiguration config) { _config = config; - var currencyCulture = _config.GetValue("Global.CurrencyCulture"); + var currencyCulture = "tr-TR";// _config.GetValue("Global.CurrencyCulture"); CurrencyCulture = new CultureInfo(currencyCulture); } @@ -18,7 +18,7 @@ public CurrencyService(IConfiguration config) public string FormatCurrency(decimal value) { - var decimalPlace = _config.GetValue("Global.CurrencyDecimalPlace"); + var decimalPlace = 2;// _config.GetValue("Global.CurrencyDecimalPlace"); return value.ToString($"C{decimalPlace}", CurrencyCulture); } } diff --git a/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs b/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs index 360767f11c..2f5bb5362c 100644 --- a/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs +++ b/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs @@ -16,7 +16,7 @@ public WidgetInstanceService(IRepository widgetInstanceRepositor public IQueryable GetPublished() { - var now = DateTimeOffset.Now; + var now = DateTimeOffset.UtcNow; return _widgetInstanceRepository.Query().Where(x => x.PublishStart.HasValue && x.PublishStart < now && (!x.PublishEnd.HasValue || x.PublishEnd > now)); diff --git a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs index 100a7a7b15..469d67c9c1 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs @@ -53,7 +53,7 @@ public async Task UpdateStock(StockUpdateRequest stockUpdateRequest) AdjustedQuantity = stockUpdateRequest.AdjustedQuantity, Note = stockUpdateRequest.Note, CreatedById = stockUpdateRequest.UserId, - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, }; _stockHistoryRepository.Add(stockHistory); diff --git a/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs b/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs index 73ff74ca50..c2bc4c589f 100644 --- a/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs +++ b/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs @@ -175,7 +175,7 @@ public async Task Put(long id, NewsItemForm model) newsItem.ShortContent = model.ShortContent; newsItem.FullContent = model.FullContent; newsItem.IsPublished = model.IsPublished; - newsItem.LatestUpdatedOn = DateTimeOffset.Now; + newsItem.LatestUpdatedOn = DateTimeOffset.UtcNow; newsItem.LatestUpdatedBy = currentUser; AddOrDeleteCategories(model, newsItem); diff --git a/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs b/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs index 2bdad81d5f..2130d01c27 100644 --- a/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs +++ b/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs @@ -22,7 +22,7 @@ public async Task Handle(OrderChanged notification, CancellationToken cancellati var orderHistory = new OrderHistory { OrderId = notification.OrderId, - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, CreatedById = notification.UserId, OldStatus = notification.OldStatus, NewStatus = notification.NewStatus, diff --git a/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs b/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs index b9fcbfbb61..9a5144a9dd 100644 --- a/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs +++ b/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs @@ -22,7 +22,7 @@ public async Task Handle(OrderCreated notification, CancellationToken cancellati var orderHistory = new OrderHistory { OrderId = notification.Order.Id, - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, CreatedById = notification.Order.CreatedById, NewStatus = OrderStatus.New, Note = notification.Order.OrderNote, diff --git a/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs b/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs index 355a10d340..8ec6ca33c2 100644 --- a/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs +++ b/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs @@ -11,8 +11,8 @@ public class Order : EntityBase { public Order() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; OrderStatus = OrderStatus.New; IsMasterOrder = false; } diff --git a/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs b/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs index 335a731ac6..ebf20015cd 100644 --- a/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs +++ b/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs @@ -45,7 +45,7 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken) private async Task CancelFailedPaymentOrders(IRepository orderRepository, IOrderService orderService, IMediator mediator, CancellationToken stoppingToken) { - var durationToCancel = DateTimeOffset.Now.AddMinutes(-5); + var durationToCancel = DateTimeOffset.UtcNow.AddMinutes(-5); var failedPaymentOrders = await orderRepository.Query().Where(x => (x.OrderStatus == OrderStatus.PendingPayment || x.OrderStatus == OrderStatus.PaymentFailed) && x.LatestUpdatedOn < durationToCancel).ToListAsync(); diff --git a/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs b/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs index 7ed4429f15..5452ba8604 100644 --- a/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs +++ b/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs @@ -196,9 +196,9 @@ public async Task> CreateOrder(long cartId, string paymentMethod, var order = new Order { Customer = cart.Customer, - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, CreatedBy = cart.CreatedBy, - LatestUpdatedOn = DateTimeOffset.Now, + LatestUpdatedOn = DateTimeOffset.UtcNow, LatestUpdatedById = cart.CreatedById, BillingAddress = orderBillingAddress, ShippingAddress = orderShippingAddress, @@ -274,9 +274,9 @@ public async Task> CreateOrder(long cartId, string paymentMethod, var subOrder = new Order { CustomerId = cart.CustomerId, - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, CreatedById = cart.CreatedById, - LatestUpdatedOn = DateTimeOffset.Now, + LatestUpdatedOn = DateTimeOffset.UtcNow, LatestUpdatedById = cart.CreatedById, BillingAddress = orderBillingAddress, ShippingAddress = orderShippingAddress, @@ -339,7 +339,7 @@ public async Task> CreateOrder(long cartId, string paymentMethod, public void CancelOrder(Order order) { order.OrderStatus = OrderStatus.Canceled; - order.LatestUpdatedOn = DateTimeOffset.Now; + order.LatestUpdatedOn = DateTimeOffset.UtcNow; var orderItems = _orderItemRepository.Query().Include(x => x.Product).Where(x => x.Order.Id == order.Id); foreach (var item in orderItems) diff --git a/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs b/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs index 9e96af7530..fa6b1e8f94 100644 --- a/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs +++ b/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs @@ -9,8 +9,8 @@ public class Payment : EntityBase { public Payment() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } public long OrderId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs b/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs index 2afd5a3347..b7532ec22d 100644 --- a/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs +++ b/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs @@ -8,7 +8,7 @@ public class CartRuleUsage : EntityBase { public CartRuleUsage() { - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public long CartRuleId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs b/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs index 88d52b64c3..15e89a3c7f 100644 --- a/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs +++ b/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs @@ -8,7 +8,7 @@ public class Coupon : EntityBase { public Coupon () { - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public long CartRuleId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs b/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs index e0a0e7b91f..c5dcf7ba60 100644 --- a/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs +++ b/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs @@ -37,13 +37,13 @@ public async Task Validate(long customerId, string coupo return validationResult; } - if (coupon.CartRule.StartOn.HasValue && coupon.CartRule.StartOn > DateTimeOffset.Now) + if (coupon.CartRule.StartOn.HasValue && coupon.CartRule.StartOn > DateTimeOffset.UtcNow) { validationResult.ErrorMessage = $"The coupon {couponCode} should be used after {coupon.CartRule.StartOn}."; return validationResult; } - if (coupon.CartRule.EndOn.HasValue && coupon.CartRule.EndOn <= DateTimeOffset.Now) + if (coupon.CartRule.EndOn.HasValue && coupon.CartRule.EndOn <= DateTimeOffset.UtcNow) { validationResult.ErrorMessage = $"The coupon {couponCode} is expired."; return validationResult; diff --git a/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs b/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs index bfd95a82d2..d5191d5919 100644 --- a/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs +++ b/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs @@ -30,7 +30,7 @@ public void AddToComparison(long userId, long productId) { UserId = userId, ProductId = productId, - CreatedOn = DateTimeOffset.Now + CreatedOn = DateTimeOffset.UtcNow }; _comparingProductRepository.Add(comparingProduct); diff --git a/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs b/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs index 0d408af6f7..e0891b82ba 100644 --- a/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs +++ b/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs @@ -37,13 +37,13 @@ public async Task Handle(EntityViewed notification, CancellationToken cancellati { UserId = user.Id, ProductId = notification.EntityId, - LatestViewedOn = DateTimeOffset.Now + LatestViewedOn = DateTimeOffset.UtcNow }; _recentlyViewedProductRepository.Add(recentlyViewedProduct); } - recentlyViewedProduct.LatestViewedOn = DateTimeOffset.Now; + recentlyViewedProduct.LatestViewedOn = DateTimeOffset.UtcNow; _recentlyViewedProductRepository.SaveChanges(); } } diff --git a/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs b/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs index ae2c62db38..76e59fd507 100644 --- a/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs +++ b/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs @@ -10,7 +10,7 @@ public class Reply : EntityBase public Reply() { Status = ReplyStatus.Pending; - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public long ReviewId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs b/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs index 2bc1d9991a..55a84ff15c 100644 --- a/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs +++ b/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs @@ -11,7 +11,7 @@ public class Review : EntityBase public Review() { Status = ReviewStatus.Pending; - CreatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; } public long UserId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs b/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs index cdcd54d672..3bea4e6d40 100644 --- a/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs +++ b/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs @@ -198,7 +198,7 @@ private void SaveSearchQuery(SearchOption searchOption, SearchResult model) { var query = new Query { - CreatedOn = DateTimeOffset.Now, + CreatedOn = DateTimeOffset.UtcNow, QueryText = searchOption.Query, ResultsCount = model.TotalProduct }; diff --git a/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs b/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs index f853eaeffe..2c68a42616 100644 --- a/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs +++ b/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs @@ -209,8 +209,8 @@ public async Task Post([FromBody] ShipmentForm model) WarehouseId = model.WarehouseId, CreatedById = currentUser.Id, TrackingNumber = model.TrackingNumber, - CreatedOn = DateTimeOffset.Now, - LatestUpdatedOn = DateTimeOffset.Now + CreatedOn = DateTimeOffset.UtcNow, + LatestUpdatedOn = DateTimeOffset.UtcNow }; if (!User.IsInRole("admin")) diff --git a/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs b/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs index 21b4995da3..4537a5a96d 100644 --- a/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs +++ b/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs @@ -12,8 +12,8 @@ public class Shipment : EntityBase { public Shipment() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } public long OrderId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs b/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs index 35f8d2a1a7..c2bc7a020a 100644 --- a/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs +++ b/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs @@ -10,8 +10,8 @@ public class Cart : EntityBase { public Cart() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; IsActive = true; } diff --git a/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs b/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs index 988fd1d5c9..b4043fe868 100644 --- a/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs +++ b/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs @@ -99,7 +99,7 @@ public async Task AddToCart(long customerId, long createdById, Cart = cart, ProductId = productId, Quantity = quantity, - CreatedOn = DateTimeOffset.Now + CreatedOn = DateTimeOffset.UtcNow }; cart.Items.Add(cartItem); @@ -227,7 +227,7 @@ public async Task MigrateCart(long fromUserId, long toUserId) Cart = cartTo, ProductId = fromItem.ProductId, Quantity = fromItem.Quantity, - CreatedOn = DateTimeOffset.Now + CreatedOn = DateTimeOffset.UtcNow }; cartTo.Items.Add(toItem); } diff --git a/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs b/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs index 5f73a68feb..e978376b8e 100644 --- a/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs +++ b/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs @@ -140,7 +140,7 @@ public async Task Put(long id, [FromBody] VendorForm model) vendor.Email = model.Email; vendor.Description = model.Description; vendor.IsActive = model.IsActive; - vendor.LatestUpdatedOn = DateTimeOffset.Now; + vendor.LatestUpdatedOn = DateTimeOffset.UtcNow; await _vendorService.Update(vendor); return Accepted(); diff --git a/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs b/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs index acab43bc1e..ad119ba1fb 100644 --- a/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs +++ b/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs @@ -235,7 +235,7 @@ public async Task AddItem([FromBody] AddToWishList model) _wishListItemRepository.Add(wishListItem); - wishList.LatestUpdatedOn = DateTimeOffset.Now; + wishList.LatestUpdatedOn = DateTimeOffset.UtcNow; await _wishListRepository.SaveChangesAsync(); resultModel.Message = "The product has been added to your wish list"; @@ -282,7 +282,7 @@ public async Task RemoveItem(long id) _wishListItemRepository.Remove(wishListItem); - wishList.LatestUpdatedOn = DateTimeOffset.Now; + wishList.LatestUpdatedOn = DateTimeOffset.UtcNow; await _wishListRepository.SaveChangesAsync(); return Ok(); @@ -317,9 +317,9 @@ public async Task UpdateItem([FromBody] UpdateWishListItem model) wishListItem.Description = String.IsNullOrWhiteSpace(model.Description) ? null : model.Description; wishListItem.Quantity = model.Quantity; - wishListItem.LatestUpdatedOn = DateTimeOffset.Now; + wishListItem.LatestUpdatedOn = DateTimeOffset.UtcNow; - wishList.LatestUpdatedOn = DateTimeOffset.Now; + wishList.LatestUpdatedOn = DateTimeOffset.UtcNow; await _wishListRepository.SaveChangesAsync(); return PartialView("UpdateItemResult"); diff --git a/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs b/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs index beca10e360..25ca5ba763 100644 --- a/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs +++ b/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs @@ -10,8 +10,8 @@ public class WishList : EntityBase { public WishList() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } public long UserId { get; set; } diff --git a/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs b/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs index ae844ac301..a3124c7cf4 100644 --- a/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs +++ b/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs @@ -8,8 +8,8 @@ public class WishListItem : EntityBase { public WishListItem() { - CreatedOn = DateTimeOffset.Now; - LatestUpdatedOn = DateTimeOffset.Now; + CreatedOn = DateTimeOffset.UtcNow; + LatestUpdatedOn = DateTimeOffset.UtcNow; } public long WishListId { get; set; } diff --git a/src/SimplCommerce.WebHost/Program.cs b/src/SimplCommerce.WebHost/Program.cs index 1a2c24bdd7..760fb9b127 100644 --- a/src/SimplCommerce.WebHost/Program.cs +++ b/src/SimplCommerce.WebHost/Program.cs @@ -21,12 +21,14 @@ using SimplCommerce.Module.Localization.Extensions; using SimplCommerce.Module.Localization.TagHelpers; using SimplCommerce.WebHost.Extensions; -using SimplCommerce.Db.MsSql; // Select namespace for db configuration +using SimplCommerce.Db.PgSql; // Select namespace for db configuration var builder = WebApplication.CreateBuilder(args); ConfigureService(); var app = builder.Build(); +MigrateDb(); Configure(); + app.Run(); void ConfigureService() @@ -128,3 +130,12 @@ void Configure() moduleInitializer.Configure(app, builder.Environment); } } + +void MigrateDb() +{ + using (var scope = app.Services.CreateScope()) + { + var db = scope.ServiceProvider.GetRequiredService(); + db.Database.Migrate(); + } +} diff --git a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj index ee167d6724..9e180e78da 100644 --- a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj +++ b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj @@ -4,6 +4,8 @@ aspnet-Modular.WebHost-dca604fa-ee10-4a6c-8e7d-8cc79dca8c8f false false + Linux + ..\.. @@ -61,13 +63,13 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs deleted file mode 100644 index dde3d04d17..0000000000 --- a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.Designer.cs +++ /dev/null @@ -1,4691 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using SimplCommerce.Module.Core.Data; - -#nullable disable - -namespace SimplCommerce.WebHost.Migrations -{ - [DbContext(typeof(SimplDbContext))] - [Migration("20220508110554_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("Core_RoleClaim", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Core_UserClaim", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("Core_UserLogin", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("Core_UserToken", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Localization_Culture", (string)null); - - b.HasData( - new - { - Id = "en-US", - Name = "English (US)" - }); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CultureId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ProperyName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CultureId"); - - b.ToTable("Localization_LocalizedContentProperty", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CultureId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CultureId"); - - b.ToTable("Localization_Resource", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ActivityTypeId") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityTypeId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ActivityTypeId"); - - b.ToTable("ActivityLog_Activity", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("ActivityLog_ActivityType", (string)null); - - b.HasData( - new - { - Id = 1L, - Name = "EntityView" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Catalog_Brand", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("IncludeInMenu") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("MetaDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("MetaKeywords") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MetaTitle") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ParentId") - .HasColumnType("bigint"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ThumbnailImageId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("ThumbnailImageId"); - - b.ToTable("Catalog_Category", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BrandId") - .HasColumnType("bigint"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("Gtin") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HasOptions") - .HasColumnType("bit"); - - b.Property("IsAllowToOrder") - .HasColumnType("bit"); - - b.Property("IsCallForPricing") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsFeatured") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsVisibleIndividually") - .HasColumnType("bit"); - - b.Property("LatestUpdatedById") - .HasColumnType("bigint"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("MetaDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("MetaKeywords") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MetaTitle") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("NormalizedName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("OldPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("PublishedOn") - .HasColumnType("datetimeoffset"); - - b.Property("RatingAverage") - .HasColumnType("float"); - - b.Property("ReviewsCount") - .HasColumnType("int"); - - b.Property("ShortDescription") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Sku") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SpecialPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("SpecialPriceEnd") - .HasColumnType("datetimeoffset"); - - b.Property("SpecialPriceStart") - .HasColumnType("datetimeoffset"); - - b.Property("Specification") - .HasColumnType("nvarchar(max)"); - - b.Property("StockQuantity") - .HasColumnType("int"); - - b.Property("StockTrackingIsEnabled") - .HasColumnType("bit"); - - b.Property("TaxClassId") - .HasColumnType("bigint"); - - b.Property("ThumbnailImageId") - .HasColumnType("bigint"); - - b.Property("VendorId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("BrandId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("LatestUpdatedById"); - - b.HasIndex("TaxClassId"); - - b.HasIndex("ThumbnailImageId"); - - b.ToTable("Catalog_Product", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("GroupId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("GroupId"); - - b.ToTable("Catalog_ProductAttribute", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Catalog_ProductAttributeGroup", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AttributeId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("AttributeId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductAttributeValue", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("IsFeaturedProduct") - .HasColumnType("bit"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductCategory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LinkType") - .HasColumnType("int"); - - b.Property("LinkedProductId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("LinkedProductId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductLink", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("MediaId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("MediaId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductMedia", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Catalog_ProductOption", (string)null); - - b.HasData( - new - { - Id = 1L, - Name = "Color" - }, - new - { - Id = 2L, - Name = "Size" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("OptionId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("SortIndex") - .HasColumnType("int"); - - b.Property("Value") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("OptionId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductOptionCombination", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("DisplayType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("OptionId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("SortIndex") - .HasColumnType("int"); - - b.Property("Value") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("OptionId"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductOptionValue", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("OldPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("SpecialPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("SpecialPriceEnd") - .HasColumnType("datetimeoffset"); - - b.Property("SpecialPriceStart") - .HasColumnType("datetimeoffset"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProductId"); - - b.ToTable("Catalog_ProductPriceHistory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Catalog_ProductTemplate", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => - { - b.Property("ProductTemplateId") - .HasColumnType("bigint"); - - b.Property("ProductAttributeId") - .HasColumnType("bigint"); - - b.HasKey("ProductTemplateId", "ProductAttributeId"); - - b.HasIndex("ProductAttributeId"); - - b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Cms_Menu", (string)null); - - b.HasData( - new - { - Id = 1L, - IsPublished = true, - IsSystem = true, - Name = "Customer Services" - }, - new - { - Id = 2L, - IsPublished = true, - IsSystem = true, - Name = "Information" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CustomLink") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("MenuId") - .HasColumnType("bigint"); - - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ParentId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EntityId"); - - b.HasIndex("MenuId"); - - b.HasIndex("ParentId"); - - b.ToTable("Cms_MenuItem", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("LatestUpdatedById") - .HasColumnType("bigint"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("MetaDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("MetaKeywords") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MetaTitle") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("PublishedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("LatestUpdatedById"); - - b.ToTable("Cms_Page", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CommentText") - .HasColumnType("nvarchar(max)"); - - b.Property("CommenterName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityTypeId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ParentId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("UserId"); - - b.ToTable("Comments_Comment", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ContactAreaId") - .HasColumnType("bigint"); - - b.Property("Content") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("EmailAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FullName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ContactAreaId"); - - b.ToTable("Contacts_Contact", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Contacts_ContactArea", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressLine1") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("AddressLine2") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("City") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ContactName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CountryId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("DistrictId") - .HasColumnType("bigint"); - - b.Property("Phone") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StateOrProvinceId") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CountryId"); - - b.HasIndex("DistrictId"); - - b.HasIndex("StateOrProvinceId"); - - b.ToTable("Core_Address", (string)null); - - b.HasData( - new - { - Id = 1L, - AddressLine1 = "364 Cong Hoa", - ContactName = "Thien Nguyen", - CountryId = "VN", - StateOrProvinceId = 1L - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("IsVisibleInCommonSettingPage") - .HasColumnType("bit"); - - b.Property("Module") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_AppSetting", (string)null); - - b.HasData( - new - { - Id = "Catalog.ProductPageSize", - IsVisibleInCommonSettingPage = true, - Module = "Catalog", - Value = "10" - }, - new - { - Id = "Catalog.IsProductPriceIncludeTax", - IsVisibleInCommonSettingPage = true, - Module = "Catalog", - Value = "true" - }, - new - { - Id = "Catalog.IsCommentsRequireApproval", - IsVisibleInCommonSettingPage = true, - Module = "Catalog", - Value = "true" - }, - new - { - Id = "GoogleAppKey", - IsVisibleInCommonSettingPage = false, - Module = "Contact", - Value = "" - }, - new - { - Id = "Global.AssetVersion", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "1.0" - }, - new - { - Id = "Global.AssetBundling", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "false" - }, - new - { - Id = "Theme", - IsVisibleInCommonSettingPage = false, - Module = "Core", - Value = "Generic" - }, - new - { - Id = "Global.DefaultCultureUI", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "en-US" - }, - new - { - Id = "Global.DefaultCultureAdminUI", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "en-US" - }, - new - { - Id = "Global.CurrencyCulture", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "en-US" - }, - new - { - Id = "Global.CurrencyDecimalPlace", - IsVisibleInCommonSettingPage = true, - Module = "Core", - Value = "2" - }, - new - { - Id = "SmtpServer", - IsVisibleInCommonSettingPage = false, - Module = "EmailSenderSmpt", - Value = "smtp.gmail.com" - }, - new - { - Id = "SmtpPort", - IsVisibleInCommonSettingPage = false, - Module = "EmailSenderSmpt", - Value = "587" - }, - new - { - Id = "SmtpUsername", - IsVisibleInCommonSettingPage = false, - Module = "EmailSenderSmpt", - Value = "" - }, - new - { - Id = "SmtpPassword", - IsVisibleInCommonSettingPage = false, - Module = "EmailSenderSmpt", - Value = "" - }, - new - { - Id = "Localization.LocalizedConentEnable", - IsVisibleInCommonSettingPage = true, - Module = "Localization", - Value = "true" - }, - new - { - Id = "News.PageSize", - IsVisibleInCommonSettingPage = true, - Module = "News", - Value = "10" - }, - new - { - Id = "Tax.DefaultTaxClassId", - IsVisibleInCommonSettingPage = true, - Module = "Tax", - Value = "1" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Code3") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsBillingEnabled") - .HasColumnType("bit"); - - b.Property("IsCityEnabled") - .HasColumnType("bit"); - - b.Property("IsDistrictEnabled") - .HasColumnType("bit"); - - b.Property("IsShippingEnabled") - .HasColumnType("bit"); - - b.Property("IsZipCodeEnabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_Country", (string)null); - - b.HasData( - new - { - Id = "VN", - Code3 = "VNM", - IsBillingEnabled = true, - IsCityEnabled = false, - IsDistrictEnabled = true, - IsShippingEnabled = true, - IsZipCodeEnabled = false, - Name = "Việt Nam" - }, - new - { - Id = "US", - Code3 = "USA", - IsBillingEnabled = true, - IsCityEnabled = true, - IsDistrictEnabled = false, - IsShippingEnabled = true, - IsZipCodeEnabled = true, - Name = "United States" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("Core_CustomerGroup", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => - { - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("CustomerGroupId") - .HasColumnType("bigint"); - - b.HasKey("UserId", "CustomerGroupId"); - - b.HasIndex("CustomerGroupId"); - - b.ToTable("Core_CustomerGroupUser", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Location") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StateOrProvinceId") - .HasColumnType("bigint"); - - b.Property("Type") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("StateOrProvinceId"); - - b.ToTable("Core_District", (string)null); - - b.HasData( - new - { - Id = 1L, - Name = "Quận 1", - StateOrProvinceId = 1L, - Type = "Quận" - }, - new - { - Id = 2L, - Name = "Quận 2", - StateOrProvinceId = 1L, - Type = "Quận" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityTypeId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("EntityTypeId"); - - b.ToTable("Core_Entity", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AreaName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsMenuable") - .HasColumnType("bit"); - - b.Property("RoutingAction") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RoutingController") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_EntityType", (string)null); - - b.HasData( - new - { - Id = "Category", - AreaName = "Catalog", - IsMenuable = true, - RoutingAction = "CategoryDetail", - RoutingController = "Category" - }, - new - { - Id = "Brand", - AreaName = "Catalog", - IsMenuable = true, - RoutingAction = "BrandDetail", - RoutingController = "Brand" - }, - new - { - Id = "Product", - AreaName = "Catalog", - IsMenuable = false, - RoutingAction = "ProductDetail", - RoutingController = "Product" - }, - new - { - Id = "Page", - AreaName = "Cms", - IsMenuable = true, - RoutingAction = "PageDetail", - RoutingController = "Page" - }, - new - { - Id = "Vendor", - AreaName = "Core", - IsMenuable = false, - RoutingAction = "VendorDetail", - RoutingController = "Vendor" - }, - new - { - Id = "NewsCategory", - AreaName = "News", - IsMenuable = true, - RoutingAction = "NewsCategoryDetail", - RoutingController = "NewsCategory" - }, - new - { - Id = "NewsItem", - AreaName = "News", - IsMenuable = false, - RoutingAction = "NewsItemDetail", - RoutingController = "NewsItem" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Caption") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FileName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FileSize") - .HasColumnType("int"); - - b.Property("MediaType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Core_Media", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("Core_Role", (string)null); - - b.HasData( - new - { - Id = 1L, - ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", - Name = "admin", - NormalizedName = "ADMIN" - }, - new - { - Id = 2L, - ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", - Name = "customer", - NormalizedName = "CUSTOMER" - }, - new - { - Id = 3L, - ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", - Name = "guest", - NormalizedName = "GUEST" - }, - new - { - Id = 4L, - ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", - Name = "vendor", - NormalizedName = "VENDOR" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CountryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Type") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CountryId"); - - b.ToTable("Core_StateOrProvince", (string)null); - - b.HasData( - new - { - Id = 1L, - CountryId = "VN", - Name = "Hồ Chí Minh", - Type = "Thành Phố" - }, - new - { - Id = 2L, - Code = "WA", - CountryId = "US", - Name = "Washington" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Culture") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("DefaultBillingAddressId") - .HasColumnType("bigint"); - - b.Property("DefaultShippingAddressId") - .HasColumnType("bigint"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("ExtensionData") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RefreshTokenHash") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserGuid") - .HasColumnType("uniqueidentifier"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("VendorId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DefaultBillingAddressId"); - - b.HasIndex("DefaultShippingAddressId"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("VendorId"); - - b.ToTable("Core_User", (string)null); - - b.HasData( - new - { - Id = 2L, - AccessFailedCount = 0, - ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - Email = "system@simplcommerce.com", - EmailConfirmed = false, - FullName = "System User", - IsDeleted = true, - LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - LockoutEnabled = false, - NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", - NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", - PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", - PhoneNumberConfirmed = false, - SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", - TwoFactorEnabled = false, - UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), - UserName = "system@simplcommerce.com" - }, - new - { - Id = 10L, - AccessFailedCount = 0, - ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - Email = "admin@simplcommerce.com", - EmailConfirmed = false, - FullName = "Shop Admin", - IsDeleted = false, - LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - LockoutEnabled = false, - NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", - NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", - PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", - PhoneNumberConfirmed = false, - SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", - TwoFactorEnabled = false, - UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), - UserName = "admin@simplcommerce.com" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("AddressType") - .HasColumnType("int"); - - b.Property("LastUsedOn") - .HasColumnType("datetimeoffset"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId"); - - b.ToTable("Core_UserAddress", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => - { - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("RoleId") - .HasColumnType("bigint"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("Core_UserRole", (string)null); - - b.HasData( - new - { - UserId = 10L, - RoleId = 1L - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(max)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_Vendor", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CreateUrl") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("EditUrl") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ViewComponentName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_Widget", (string)null); - - b.HasData( - new - { - Id = "CategoryWidget", - CreateUrl = "widget-category-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-category-edit", - IsPublished = false, - Name = "Category Widget", - ViewComponentName = "CategoryWidget" - }, - new - { - Id = "ProductWidget", - CreateUrl = "widget-product-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-product-edit", - IsPublished = false, - Name = "Product Widget", - ViewComponentName = "ProductWidget" - }, - new - { - Id = "SimpleProductWidget", - CreateUrl = "widget-simple-product-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-simple-product-edit", - IsPublished = false, - Name = "Simple Product Widget", - ViewComponentName = "SimpleProductWidget" - }, - new - { - Id = "HtmlWidget", - CreateUrl = "widget-html-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-html-edit", - IsPublished = false, - Name = "Html Widget", - ViewComponentName = "HtmlWidget" - }, - new - { - Id = "CarouselWidget", - CreateUrl = "widget-carousel-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-carousel-edit", - IsPublished = false, - Name = "Carousel Widget", - ViewComponentName = "CarouselWidget" - }, - new - { - Id = "SpaceBarWidget", - CreateUrl = "widget-spacebar-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-spacebar-edit", - IsPublished = false, - Name = "SpaceBar Widget", - ViewComponentName = "SpaceBarWidget" - }, - new - { - Id = "RecentlyViewedWidget", - CreateUrl = "widget-recently-viewed-create", - CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), - EditUrl = "widget-recently-viewed-edit", - IsPublished = false, - Name = "Recently Viewed Widget", - ViewComponentName = "RecentlyViewedWidget" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("HtmlData") - .HasColumnType("nvarchar(max)"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("PublishEnd") - .HasColumnType("datetimeoffset"); - - b.Property("PublishStart") - .HasColumnType("datetimeoffset"); - - b.Property("WidgetId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("WidgetZoneId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("WidgetId"); - - b.HasIndex("WidgetZoneId"); - - b.ToTable("Core_WidgetInstance", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Core_WidgetZone", (string)null); - - b.HasData( - new - { - Id = 1L, - Name = "Home Featured" - }, - new - { - Id = 2L, - Name = "Home Main Content" - }, - new - { - Id = 3L, - Name = "Home After Main Content" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("ReservedQuantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Inventory_Stock", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AdjustedQuantity") - .HasColumnType("bigint"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("WarehouseId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProductId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Inventory_StockHistory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("VendorId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("VendorId"); - - b.ToTable("Inventory_Warehouse", (string)null); - - b.HasData( - new - { - Id = 1L, - AddressId = 1L, - Name = "Default warehouse" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayOrder") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("MetaDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("MetaKeywords") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MetaTitle") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("News_NewsCategory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("FullContent") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("LatestUpdatedById") - .HasColumnType("bigint"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("MetaDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("MetaKeywords") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MetaTitle") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("PublishedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ShortContent") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ThumbnailImageId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("LatestUpdatedById"); - - b.HasIndex("ThumbnailImageId"); - - b.ToTable("News_NewsItem", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => - { - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("NewsItemId") - .HasColumnType("bigint"); - - b.HasKey("CategoryId", "NewsItemId"); - - b.HasIndex("NewsItemId"); - - b.ToTable("News_NewsItemCategory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BillingAddressId") - .HasColumnType("bigint"); - - b.Property("CouponCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CouponRuleName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("DiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("IsMasterOrder") - .HasColumnType("bit"); - - b.Property("LatestUpdatedById") - .HasColumnType("bigint"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("OrderNote") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("OrderStatus") - .HasColumnType("int"); - - b.Property("OrderTotal") - .HasColumnType("decimal(18,2)"); - - b.Property("ParentId") - .HasColumnType("bigint"); - - b.Property("PaymentFeeAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("PaymentMethod") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ShippingAddressId") - .HasColumnType("bigint"); - - b.Property("ShippingFeeAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("ShippingMethod") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SubTotal") - .HasColumnType("decimal(18,2)"); - - b.Property("SubTotalWithDiscount") - .HasColumnType("decimal(18,2)"); - - b.Property("TaxAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("VendorId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("BillingAddressId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("CustomerId"); - - b.HasIndex("LatestUpdatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("ShippingAddressId"); - - b.ToTable("Orders_Order", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressLine1") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("AddressLine2") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("City") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ContactName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CountryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("DistrictId") - .HasColumnType("bigint"); - - b.Property("Phone") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StateOrProvinceId") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CountryId"); - - b.HasIndex("DistrictId"); - - b.HasIndex("StateOrProvinceId"); - - b.ToTable("Orders_OrderAddress", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("NewStatus") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("OldStatus") - .HasColumnType("int"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("OrderSnapshot") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("OrderId"); - - b.ToTable("Orders_OrderHistory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("DiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("ProductPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("TaxAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("TaxPercent") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ProductId"); - - b.ToTable("Orders_OrderItem", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Amount") - .HasColumnType("decimal(18,2)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("FailureMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("GatewayTransactionId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("PaymentFee") - .HasColumnType("decimal(18,2)"); - - b.Property("PaymentMethod") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("Payments_Payment", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AdditionalSettings") - .HasColumnType("nvarchar(max)"); - - b.Property("ConfigureUrl") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsEnabled") - .HasColumnType("bit"); - - b.Property("LandingViewComponentName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Payments_PaymentProvider", (string)null); - - b.HasData( - new - { - Id = "Braintree", - AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", - ConfigureUrl = "payments-braintree-config", - IsEnabled = true, - LandingViewComponentName = "BraintreeLanding", - Name = "Braintree" - }, - new - { - Id = "CoD", - ConfigureUrl = "payments-cod-config", - IsEnabled = true, - LandingViewComponentName = "CoDLanding", - Name = "Cash On Delivery" - }, - new - { - Id = "PaypalExpress", - AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", - ConfigureUrl = "payments-paypalExpress-config", - IsEnabled = true, - LandingViewComponentName = "PaypalExpressLanding", - Name = "Paypal Express" - }, - new - { - Id = "Stripe", - AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", - ConfigureUrl = "payments-stripe-config", - IsEnabled = true, - LandingViewComponentName = "StripeLanding", - Name = "Stripe" - }, - new - { - Id = "MomoPayment", - AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", - ConfigureUrl = "payments-momo-config", - IsEnabled = true, - LandingViewComponentName = "MomoLanding", - Name = "Momo Payment" - }, - new - { - Id = "NganLuong", - AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", - ConfigureUrl = "payments-nganluong-config", - IsEnabled = true, - LandingViewComponentName = "NganLuongLanding", - Name = "Ngan Luong Payment" - }, - new - { - Id = "Cashfree", - AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", - ConfigureUrl = "payments-cashfree-config", - IsEnabled = true, - LandingViewComponentName = "CashfreeLanding", - Name = "Cashfree Payment Gateway" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("DiscountStep") - .HasColumnType("int"); - - b.Property("EndOn") - .HasColumnType("datetimeoffset"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsCouponRequired") - .HasColumnType("bit"); - - b.Property("MaxDiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RuleToApply") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartOn") - .HasColumnType("datetimeoffset"); - - b.Property("UsageLimitPerCoupon") - .HasColumnType("int"); - - b.Property("UsageLimitPerCustomer") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Pricing_CartRule", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => - { - b.Property("CartRuleId") - .HasColumnType("bigint"); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.HasKey("CartRuleId", "CategoryId"); - - b.HasIndex("CategoryId"); - - b.ToTable("Pricing_CartRuleCategory", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => - { - b.Property("CartRuleId") - .HasColumnType("bigint"); - - b.Property("CustomerGroupId") - .HasColumnType("bigint"); - - b.HasKey("CartRuleId", "CustomerGroupId"); - - b.HasIndex("CustomerGroupId"); - - b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => - { - b.Property("CartRuleId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.HasKey("CartRuleId", "ProductId"); - - b.HasIndex("ProductId"); - - b.ToTable("Pricing_CartRuleProduct", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CartRuleId") - .HasColumnType("bigint"); - - b.Property("CouponId") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CartRuleId"); - - b.HasIndex("CouponId"); - - b.HasIndex("UserId"); - - b.ToTable("Pricing_CartRuleUsage", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("EndOn") - .HasColumnType("datetimeoffset"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("MaxDiscountAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RuleToApply") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartOn") - .HasColumnType("datetimeoffset"); - - b.HasKey("Id"); - - b.ToTable("Pricing_CatalogRule", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => - { - b.Property("CatalogRuleId") - .HasColumnType("bigint"); - - b.Property("CustomerGroupId") - .HasColumnType("bigint"); - - b.HasKey("CatalogRuleId", "CustomerGroupId"); - - b.HasIndex("CustomerGroupId"); - - b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CartRuleId") - .HasColumnType("bigint"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.HasKey("Id"); - - b.HasIndex("CartRuleId"); - - b.ToTable("Pricing_Coupon", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("UserId"); - - b.ToTable("ProductComparison_ComparingProduct", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LatestViewedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ReplierName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReviewId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ReviewId"); - - b.HasIndex("UserId"); - - b.ToTable("Reviews_Reply", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityTypeId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Rating") - .HasColumnType("int"); - - b.Property("ReviewerName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Reviews_Review", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("QueryText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ResultsCount") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Search_Query", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("TrackingNumber") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("VendorId") - .HasColumnType("bigint"); - - b.Property("WarehouseId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("OrderId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Shipments_Shipment", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("OrderItemId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("ShipmentId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("ShipmentId"); - - b.ToTable("Shipments_ShipmentItem", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AdditionalSettings") - .HasColumnType("nvarchar(max)"); - - b.Property("ConfigureUrl") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("IsEnabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("OnlyCountryIdsString") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("OnlyStateOrProvinceIdsString") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ShippingPriceServiceTypeName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ToAllShippingEnabledCountries") - .HasColumnType("bit"); - - b.Property("ToAllShippingEnabledStatesOrProvinces") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("Shipping_ShippingProvider", (string)null); - - b.HasData( - new - { - Id = "FreeShip", - AdditionalSettings = "{MinimumOrderAmount : 1}", - ConfigureUrl = "", - IsEnabled = true, - Name = "Free Ship", - ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", - ToAllShippingEnabledCountries = true, - ToAllShippingEnabledStatesOrProvinces = true - }, - new - { - Id = "TableRate", - ConfigureUrl = "shipping-table-rate-config", - IsEnabled = true, - Name = "Table Rate", - ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", - ToAllShippingEnabledCountries = true, - ToAllShippingEnabledStatesOrProvinces = true - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CountryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("DistrictId") - .HasColumnType("bigint"); - - b.Property("MinOrderSubtotal") - .HasColumnType("decimal(18,2)"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("ShippingPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("StateOrProvinceId") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CountryId"); - - b.HasIndex("DistrictId"); - - b.HasIndex("StateOrProvinceId"); - - b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CouponCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CouponRuleName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsProductPriceIncludeTax") - .HasColumnType("bit"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("LockedOnCheckout") - .HasColumnType("bit"); - - b.Property("OrderNote") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ShippingAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("ShippingData") - .HasColumnType("nvarchar(max)"); - - b.Property("ShippingMethod") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TaxAmount") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("CustomerId"); - - b.ToTable("ShoppingCart_Cart", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CartId") - .HasColumnType("bigint"); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CartId"); - - b.HasIndex("ProductId"); - - b.ToTable("ShoppingCart_CartItem", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("Tax_TaxClass", (string)null); - - b.HasData( - new - { - Id = 1L, - Name = "Standard VAT" - }); - }); - - modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CountryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Rate") - .HasColumnType("decimal(18,2)"); - - b.Property("StateOrProvinceId") - .HasColumnType("bigint"); - - b.Property("TaxClassId") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CountryId"); - - b.HasIndex("StateOrProvinceId"); - - b.HasIndex("TaxClassId"); - - b.ToTable("Tax_TaxRate", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("SharingCode") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("WishList_WishList", (string)null); - }); - - modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("LatestUpdatedOn") - .HasColumnType("datetimeoffset"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WishListId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("WishListId"); - - b.ToTable("WishList_WishListItem", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => - { - b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") - .WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Culture"); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => - { - b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") - .WithMany("Resources") - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Culture"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => - { - b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") - .WithMany() - .HasForeignKey("ActivityTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ActivityType"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") - .WithMany() - .HasForeignKey("ThumbnailImageId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Parent"); - - b.Navigation("ThumbnailImage"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") - .WithMany() - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") - .WithMany() - .HasForeignKey("LatestUpdatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") - .WithMany() - .HasForeignKey("TaxClassId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") - .WithMany() - .HasForeignKey("ThumbnailImageId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Brand"); - - b.Navigation("CreatedBy"); - - b.Navigation("LatestUpdatedBy"); - - b.Navigation("TaxClass"); - - b.Navigation("ThumbnailImage"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") - .WithMany("Attributes") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") - .WithMany() - .HasForeignKey("AttributeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("AttributeValues") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Attribute"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") - .WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("Categories") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") - .WithMany("LinkedProductLinks") - .HasForeignKey("LinkedProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("ProductLinks") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LinkedProduct"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") - .WithMany() - .HasForeignKey("MediaId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("Medias") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Media"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") - .WithMany() - .HasForeignKey("OptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("OptionCombinations") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Option"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") - .WithMany() - .HasForeignKey("OptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("OptionValues") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Option"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany("PriceHistories") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedBy"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") - .WithMany("ProductTemplates") - .HasForeignKey("ProductAttributeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") - .WithMany("ProductAttributes") - .HasForeignKey("ProductTemplateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProductAttribute"); - - b.Navigation("ProductTemplate"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") - .WithMany() - .HasForeignKey("EntityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") - .WithMany("MenuItems") - .HasForeignKey("MenuId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Entity"); - - b.Navigation("Menu"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") - .WithMany() - .HasForeignKey("LatestUpdatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("LatestUpdatedBy"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => - { - b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") - .WithMany("Replies") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Parent"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => - { - b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") - .WithMany() - .HasForeignKey("ContactAreaId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ContactArea"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.District", "District") - .WithMany() - .HasForeignKey("DistrictId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") - .WithMany() - .HasForeignKey("StateOrProvinceId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Country"); - - b.Navigation("District"); - - b.Navigation("StateOrProvince"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") - .WithMany("Users") - .HasForeignKey("CustomerGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany("CustomerGroups") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerGroup"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") - .WithMany() - .HasForeignKey("StateOrProvinceId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("StateOrProvince"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") - .WithMany() - .HasForeignKey("EntityTypeId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("EntityType"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") - .WithMany("StatesOrProvinces") - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") - .WithMany() - .HasForeignKey("DefaultBillingAddressId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") - .WithMany() - .HasForeignKey("DefaultShippingAddressId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) - .WithMany("Users") - .HasForeignKey("VendorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DefaultBillingAddress"); - - b.Navigation("DefaultShippingAddress"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") - .WithMany("UserAddresses") - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany("UserAddresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") - .WithMany() - .HasForeignKey("WidgetId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") - .WithMany() - .HasForeignKey("WidgetZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Widget"); - - b.Navigation("WidgetZone"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") - .WithMany() - .HasForeignKey("VendorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Address"); - - b.Navigation("Vendor"); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") - .WithMany() - .HasForeignKey("LatestUpdatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") - .WithMany() - .HasForeignKey("ThumbnailImageId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedBy"); - - b.Navigation("LatestUpdatedBy"); - - b.Navigation("ThumbnailImage"); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => - { - b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") - .WithMany("NewsItems") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") - .WithMany("Categories") - .HasForeignKey("NewsItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Category"); - - b.Navigation("NewsItem"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => - { - b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") - .WithMany() - .HasForeignKey("BillingAddressId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") - .WithMany() - .HasForeignKey("LatestUpdatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") - .WithMany() - .HasForeignKey("ShippingAddressId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("BillingAddress"); - - b.Navigation("CreatedBy"); - - b.Navigation("Customer"); - - b.Navigation("LatestUpdatedBy"); - - b.Navigation("Parent"); - - b.Navigation("ShippingAddress"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.District", "District") - .WithMany() - .HasForeignKey("DistrictId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") - .WithMany() - .HasForeignKey("StateOrProvinceId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Country"); - - b.Navigation("District"); - - b.Navigation("StateOrProvince"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => - { - b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") - .WithMany("OrderItems") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => - { - b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") - .WithMany("Categories") - .HasForeignKey("CartRuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") - .WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CartRule"); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") - .WithMany("CustomerGroups") - .HasForeignKey("CartRuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") - .WithMany() - .HasForeignKey("CustomerGroupId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CartRule"); - - b.Navigation("CustomerGroup"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") - .WithMany("Products") - .HasForeignKey("CartRuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CartRule"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") - .WithMany() - .HasForeignKey("CartRuleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") - .WithMany() - .HasForeignKey("CouponId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CartRule"); - - b.Navigation("Coupon"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") - .WithMany("CustomerGroups") - .HasForeignKey("CatalogRuleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") - .WithMany() - .HasForeignKey("CustomerGroupId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CatalogRule"); - - b.Navigation("CustomerGroup"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => - { - b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") - .WithMany("Coupons") - .HasForeignKey("CartRuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CartRule"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => - { - b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") - .WithMany("Replies") - .HasForeignKey("ReviewId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Review"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Order"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") - .WithMany("Items") - .HasForeignKey("ShipmentId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Shipment"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.District", "District") - .WithMany() - .HasForeignKey("DistrictId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") - .WithMany() - .HasForeignKey("StateOrProvinceId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Country"); - - b.Navigation("District"); - - b.Navigation("StateOrProvince"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => - { - b.HasOne("SimplCommerce.Module.ShoppingCart.Models.Cart", "Cart") - .WithMany("Items") - .HasForeignKey("CartId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cart"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") - .WithMany() - .HasForeignKey("StateOrProvinceId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") - .WithMany() - .HasForeignKey("TaxClassId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Country"); - - b.Navigation("StateOrProvince"); - - b.Navigation("TaxClass"); - }); - - modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => - { - b.HasOne("SimplCommerce.Module.Core.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => - { - b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") - .WithMany("Items") - .HasForeignKey("WishListId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("WishList"); - }); - - modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => - { - b.Navigation("Resources"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => - { - b.Navigation("AttributeValues"); - - b.Navigation("Categories"); - - b.Navigation("LinkedProductLinks"); - - b.Navigation("Medias"); - - b.Navigation("OptionCombinations"); - - b.Navigation("OptionValues"); - - b.Navigation("PriceHistories"); - - b.Navigation("ProductLinks"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => - { - b.Navigation("ProductTemplates"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => - { - b.Navigation("Attributes"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => - { - b.Navigation("ProductAttributes"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => - { - b.Navigation("MenuItems"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => - { - b.Navigation("Replies"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => - { - b.Navigation("UserAddresses"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => - { - b.Navigation("StatesOrProvinces"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => - { - b.Navigation("CustomerGroups"); - - b.Navigation("Roles"); - - b.Navigation("UserAddresses"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => - { - b.Navigation("NewsItems"); - }); - - modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => - { - b.Navigation("Categories"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => - { - b.Navigation("Children"); - - b.Navigation("OrderItems"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => - { - b.Navigation("Categories"); - - b.Navigation("Coupons"); - - b.Navigation("CustomerGroups"); - - b.Navigation("Products"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => - { - b.Navigation("CustomerGroups"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => - { - b.Navigation("Replies"); - }); - - modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.Cart", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => - { - b.Navigation("Items"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs b/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs deleted file mode 100644 index 9eaead786e..0000000000 --- a/src/src/SimplCommerce.Db.PgSql/Migrations/20220508110554_Initial.cs +++ /dev/null @@ -1,3200 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SimplCommerce.WebHost.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ActivityLog_ActivityType", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityLog_ActivityType", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Catalog_Brand", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - IsPublished = table.Column(type: "bit", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_Brand", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductAttributeGroup", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductAttributeGroup", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductOption", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductOption", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductTemplate", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductTemplate", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Cms_Menu", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - IsPublished = table.Column(type: "bit", nullable: false), - IsSystem = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Cms_Menu", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Contacts_ContactArea", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Contacts_ContactArea", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_AppSetting", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Module = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - IsVisibleInCommonSettingPage = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_AppSetting", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_Country", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Code3 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - IsBillingEnabled = table.Column(type: "bit", nullable: false), - IsShippingEnabled = table.Column(type: "bit", nullable: false), - IsCityEnabled = table.Column(type: "bit", nullable: false), - IsZipCodeEnabled = table.Column(type: "bit", nullable: false), - IsDistrictEnabled = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Country", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_CustomerGroup", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_CustomerGroup", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_EntityType", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - IsMenuable = table.Column(type: "bit", nullable: false), - AreaName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - RoutingController = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - RoutingAction = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_EntityType", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_Media", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Caption = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - FileSize = table.Column(type: "int", nullable: false), - FileName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MediaType = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Media", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_Role", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - 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_Core_Role", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_Vendor", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Email = table.Column(type: "nvarchar(max)", nullable: true), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - IsActive = table.Column(type: "bit", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Vendor", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_Widget", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - ViewComponentName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CreateUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - EditUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - IsPublished = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Widget", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Core_WidgetZone", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_WidgetZone", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Localization_Culture", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Localization_Culture", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "News_NewsCategory", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - DisplayOrder = table.Column(type: "int", nullable: false), - IsPublished = table.Column(type: "bit", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_News_NewsCategory", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Payments_PaymentProvider", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - IsEnabled = table.Column(type: "bit", nullable: false), - ConfigureUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - LandingViewComponentName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - AdditionalSettings = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Payments_PaymentProvider", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CartRule", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - StartOn = table.Column(type: "datetimeoffset", nullable: true), - EndOn = table.Column(type: "datetimeoffset", nullable: true), - IsCouponRequired = table.Column(type: "bit", nullable: false), - RuleToApply = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), - MaxDiscountAmount = table.Column(type: "decimal(18,2)", nullable: true), - DiscountStep = table.Column(type: "int", nullable: true), - UsageLimitPerCoupon = table.Column(type: "int", nullable: true), - UsageLimitPerCustomer = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CartRule", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CatalogRule", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - StartOn = table.Column(type: "datetimeoffset", nullable: true), - EndOn = table.Column(type: "datetimeoffset", nullable: true), - RuleToApply = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), - MaxDiscountAmount = table.Column(type: "decimal(18,2)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CatalogRule", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ProductRecentlyViewed_RecentlyViewedProduct", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - LatestViewedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProductRecentlyViewed_RecentlyViewedProduct", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Search_Query", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - QueryText = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), - ResultsCount = table.Column(type: "int", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Search_Query", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Shipping_ShippingProvider", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - IsEnabled = table.Column(type: "bit", nullable: false), - ConfigureUrl = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ToAllShippingEnabledCountries = table.Column(type: "bit", nullable: false), - OnlyCountryIdsString = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - ToAllShippingEnabledStatesOrProvinces = table.Column(type: "bit", nullable: false), - OnlyStateOrProvinceIdsString = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - AdditionalSettings = table.Column(type: "nvarchar(max)", nullable: true), - ShippingPriceServiceTypeName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Shipping_ShippingProvider", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Tax_TaxClass", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Tax_TaxClass", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ActivityLog_Activity", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ActivityTypeId = table.Column(type: "bigint", nullable: false), - UserId = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - EntityId = table.Column(type: "bigint", nullable: false), - EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityLog_Activity", x => x.Id); - table.ForeignKey( - name: "FK_ActivityLog_Activity_ActivityLog_ActivityType_ActivityTypeId", - column: x => x.ActivityTypeId, - principalTable: "ActivityLog_ActivityType", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductAttribute", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - GroupId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductAttribute", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductAttribute_Catalog_ProductAttributeGroup_GroupId", - column: x => x.GroupId, - principalTable: "Catalog_ProductAttributeGroup", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Contacts_Contact", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FullName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - PhoneNumber = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - EmailAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Address = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Content = table.Column(type: "nvarchar(max)", nullable: true), - ContactAreaId = table.Column(type: "bigint", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Contacts_Contact", x => x.Id); - table.ForeignKey( - name: "FK_Contacts_Contact_Contacts_ContactArea_ContactAreaId", - column: x => x.ContactAreaId, - principalTable: "Contacts_ContactArea", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_StateOrProvince", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Code = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Type = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_StateOrProvince", x => x.Id); - table.ForeignKey( - name: "FK_Core_StateOrProvince_Core_Country_CountryId", - column: x => x.CountryId, - principalTable: "Core_Country", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_Entity", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - EntityId = table.Column(type: "bigint", nullable: false), - EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Entity", x => x.Id); - table.ForeignKey( - name: "FK_Core_Entity_Core_EntityType_EntityTypeId", - column: x => x.EntityTypeId, - principalTable: "Core_EntityType", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_Category", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - DisplayOrder = table.Column(type: "int", nullable: false), - IsPublished = table.Column(type: "bit", nullable: false), - IncludeInMenu = table.Column(type: "bit", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false), - ParentId = table.Column(type: "bigint", nullable: true), - ThumbnailImageId = table.Column(type: "bigint", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_Category", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_Category_Catalog_Category_ParentId", - column: x => x.ParentId, - principalTable: "Catalog_Category", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_Category_Core_Media_ThumbnailImageId", - column: x => x.ThumbnailImageId, - principalTable: "Core_Media", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_RoleClaim", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RoleId = table.Column(type: "bigint", nullable: false), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_RoleClaim", x => x.Id); - table.ForeignKey( - name: "FK_Core_RoleClaim_Core_Role_RoleId", - column: x => x.RoleId, - principalTable: "Core_Role", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_WidgetInstance", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - PublishStart = table.Column(type: "datetimeoffset", nullable: true), - PublishEnd = table.Column(type: "datetimeoffset", nullable: true), - WidgetId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - WidgetZoneId = table.Column(type: "bigint", nullable: false), - DisplayOrder = table.Column(type: "int", nullable: false), - Data = table.Column(type: "nvarchar(max)", nullable: true), - HtmlData = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_WidgetInstance", x => x.Id); - table.ForeignKey( - name: "FK_Core_WidgetInstance_Core_Widget_WidgetId", - column: x => x.WidgetId, - principalTable: "Core_Widget", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Core_WidgetInstance_Core_WidgetZone_WidgetZoneId", - column: x => x.WidgetZoneId, - principalTable: "Core_WidgetZone", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Localization_LocalizedContentProperty", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - EntityId = table.Column(type: "bigint", nullable: false), - EntityType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CultureId = table.Column(type: "nvarchar(450)", nullable: false), - ProperyName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Localization_LocalizedContentProperty", x => x.Id); - table.ForeignKey( - name: "FK_Localization_LocalizedContentProperty_Localization_Culture_CultureId", - column: x => x.CultureId, - principalTable: "Localization_Culture", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Localization_Resource", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Key = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: true), - CultureId = table.Column(type: "nvarchar(450)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Localization_Resource", x => x.Id); - table.ForeignKey( - name: "FK_Localization_Resource_Localization_Culture_CultureId", - column: x => x.CultureId, - principalTable: "Localization_Culture", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CartRuleCustomerGroup", - columns: table => new - { - CartRuleId = table.Column(type: "bigint", nullable: false), - CustomerGroupId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CartRuleCustomerGroup", x => new { x.CartRuleId, x.CustomerGroupId }); - table.ForeignKey( - name: "FK_Pricing_CartRuleCustomerGroup_Core_CustomerGroup_CustomerGroupId", - column: x => x.CustomerGroupId, - principalTable: "Core_CustomerGroup", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CartRuleCustomerGroup_Pricing_CartRule_CartRuleId", - column: x => x.CartRuleId, - principalTable: "Pricing_CartRule", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Pricing_Coupon", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CartRuleId = table.Column(type: "bigint", nullable: false), - Code = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_Coupon", x => x.Id); - table.ForeignKey( - name: "FK_Pricing_Coupon_Pricing_CartRule_CartRuleId", - column: x => x.CartRuleId, - principalTable: "Pricing_CartRule", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CatalogRuleCustomerGroup", - columns: table => new - { - CatalogRuleId = table.Column(type: "bigint", nullable: false), - CustomerGroupId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CatalogRuleCustomerGroup", x => new { x.CatalogRuleId, x.CustomerGroupId }); - table.ForeignKey( - name: "FK_Pricing_CatalogRuleCustomerGroup_Core_CustomerGroup_CustomerGroupId", - column: x => x.CustomerGroupId, - principalTable: "Core_CustomerGroup", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CatalogRuleCustomerGroup_Pricing_CatalogRule_CatalogRuleId", - column: x => x.CatalogRuleId, - principalTable: "Pricing_CatalogRule", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductTemplateProductAttribute", - columns: table => new - { - ProductTemplateId = table.Column(type: "bigint", nullable: false), - ProductAttributeId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductTemplateProductAttribute", x => new { x.ProductTemplateId, x.ProductAttributeId }); - table.ForeignKey( - name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductAttribute_ProductAttributeId", - column: x => x.ProductAttributeId, - principalTable: "Catalog_ProductAttribute", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Catalog_ProductTemplateProductAttribute_Catalog_ProductTemplate_ProductTemplateId", - column: x => x.ProductTemplateId, - principalTable: "Catalog_ProductTemplate", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_District", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - StateOrProvinceId = table.Column(type: "bigint", nullable: false), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Type = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Location = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_District", x => x.Id); - table.ForeignKey( - name: "FK_Core_District_Core_StateOrProvince_StateOrProvinceId", - column: x => x.StateOrProvinceId, - principalTable: "Core_StateOrProvince", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Tax_TaxRate", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - TaxClassId = table.Column(type: "bigint", nullable: false), - CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - StateOrProvinceId = table.Column(type: "bigint", nullable: true), - Rate = table.Column(type: "decimal(18,2)", nullable: false), - ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tax_TaxRate", x => x.Id); - table.ForeignKey( - name: "FK_Tax_TaxRate_Core_Country_CountryId", - column: x => x.CountryId, - principalTable: "Core_Country", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Tax_TaxRate_Core_StateOrProvince_StateOrProvinceId", - column: x => x.StateOrProvinceId, - principalTable: "Core_StateOrProvince", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Tax_TaxRate_Tax_TaxClass_TaxClassId", - column: x => x.TaxClassId, - principalTable: "Tax_TaxClass", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Cms_MenuItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ParentId = table.Column(type: "bigint", nullable: true), - MenuId = table.Column(type: "bigint", nullable: false), - EntityId = table.Column(type: "bigint", nullable: true), - CustomLink = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DisplayOrder = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Cms_MenuItem", x => x.Id); - table.ForeignKey( - name: "FK_Cms_MenuItem_Cms_Menu_MenuId", - column: x => x.MenuId, - principalTable: "Cms_Menu", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Cms_MenuItem_Cms_MenuItem_ParentId", - column: x => x.ParentId, - principalTable: "Cms_MenuItem", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Cms_MenuItem_Core_Entity_EntityId", - column: x => x.EntityId, - principalTable: "Core_Entity", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CartRuleCategory", - columns: table => new - { - CategoryId = table.Column(type: "bigint", nullable: false), - CartRuleId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CartRuleCategory", x => new { x.CartRuleId, x.CategoryId }); - table.ForeignKey( - name: "FK_Pricing_CartRuleCategory_Catalog_Category_CategoryId", - column: x => x.CategoryId, - principalTable: "Catalog_Category", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CartRuleCategory_Pricing_CartRule_CartRuleId", - column: x => x.CartRuleId, - principalTable: "Pricing_CartRule", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_Address", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ContactName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Phone = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - AddressLine1 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - AddressLine2 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - City = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DistrictId = table.Column(type: "bigint", nullable: true), - StateOrProvinceId = table.Column(type: "bigint", nullable: false), - CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_Address", x => x.Id); - table.ForeignKey( - name: "FK_Core_Address_Core_Country_CountryId", - column: x => x.CountryId, - principalTable: "Core_Country", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Core_Address_Core_District_DistrictId", - column: x => x.DistrictId, - principalTable: "Core_District", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Core_Address_Core_StateOrProvince_StateOrProvinceId", - column: x => x.StateOrProvinceId, - principalTable: "Core_StateOrProvince", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Orders_OrderAddress", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ContactName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Phone = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - AddressLine1 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - AddressLine2 = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - City = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DistrictId = table.Column(type: "bigint", nullable: true), - StateOrProvinceId = table.Column(type: "bigint", nullable: false), - CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders_OrderAddress", x => x.Id); - table.ForeignKey( - name: "FK_Orders_OrderAddress_Core_Country_CountryId", - column: x => x.CountryId, - principalTable: "Core_Country", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_OrderAddress_Core_District_DistrictId", - column: x => x.DistrictId, - principalTable: "Core_District", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_OrderAddress_Core_StateOrProvince_StateOrProvinceId", - column: x => x.StateOrProvinceId, - principalTable: "Core_StateOrProvince", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ShippingTableRate_PriceAndDestination", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CountryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - StateOrProvinceId = table.Column(type: "bigint", nullable: true), - DistrictId = table.Column(type: "bigint", nullable: true), - ZipCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Note = table.Column(type: "nvarchar(max)", nullable: true), - MinOrderSubtotal = table.Column(type: "decimal(18,2)", nullable: false), - ShippingPrice = table.Column(type: "decimal(18,2)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ShippingTableRate_PriceAndDestination", x => x.Id); - table.ForeignKey( - name: "FK_ShippingTableRate_PriceAndDestination_Core_Country_CountryId", - column: x => x.CountryId, - principalTable: "Core_Country", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ShippingTableRate_PriceAndDestination_Core_District_DistrictId", - column: x => x.DistrictId, - principalTable: "Core_District", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ShippingTableRate_PriceAndDestination_Core_StateOrProvince_StateOrProvinceId", - column: x => x.StateOrProvinceId, - principalTable: "Core_StateOrProvince", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Inventory_Warehouse", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - AddressId = table.Column(type: "bigint", nullable: false), - VendorId = table.Column(type: "bigint", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Inventory_Warehouse", x => x.Id); - table.ForeignKey( - name: "FK_Inventory_Warehouse_Core_Address_AddressId", - column: x => x.AddressId, - principalTable: "Core_Address", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Inventory_Warehouse_Core_Vendor_VendorId", - column: x => x.VendorId, - principalTable: "Core_Vendor", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_Product", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ShortDescription = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Specification = table.Column(type: "nvarchar(max)", nullable: true), - Price = table.Column(type: "decimal(18,2)", nullable: false), - OldPrice = table.Column(type: "decimal(18,2)", nullable: true), - SpecialPrice = table.Column(type: "decimal(18,2)", nullable: true), - SpecialPriceStart = table.Column(type: "datetimeoffset", nullable: true), - SpecialPriceEnd = table.Column(type: "datetimeoffset", nullable: true), - HasOptions = table.Column(type: "bit", nullable: false), - IsVisibleIndividually = table.Column(type: "bit", nullable: false), - IsFeatured = table.Column(type: "bit", nullable: false), - IsCallForPricing = table.Column(type: "bit", nullable: false), - IsAllowToOrder = table.Column(type: "bit", nullable: false), - StockTrackingIsEnabled = table.Column(type: "bit", nullable: false), - StockQuantity = table.Column(type: "int", nullable: false), - Sku = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Gtin = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - NormalizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DisplayOrder = table.Column(type: "int", nullable: false), - VendorId = table.Column(type: "bigint", nullable: true), - ThumbnailImageId = table.Column(type: "bigint", nullable: true), - ReviewsCount = table.Column(type: "int", nullable: false), - RatingAverage = table.Column(type: "float", nullable: true), - BrandId = table.Column(type: "bigint", nullable: true), - TaxClassId = table.Column(type: "bigint", nullable: true), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), - IsPublished = table.Column(type: "bit", nullable: false), - PublishedOn = table.Column(type: "datetimeoffset", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedById = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_Product", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_Product_Catalog_Brand_BrandId", - column: x => x.BrandId, - principalTable: "Catalog_Brand", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_Product_Core_Media_ThumbnailImageId", - column: x => x.ThumbnailImageId, - principalTable: "Core_Media", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_Product_Tax_TaxClass_TaxClassId", - column: x => x.TaxClassId, - principalTable: "Tax_TaxClass", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductAttributeValue", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - AttributeId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductAttributeValue", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductAttributeValue_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductAttributeValue_Catalog_ProductAttribute_AttributeId", - column: x => x.AttributeId, - principalTable: "Catalog_ProductAttribute", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductCategory", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - IsFeaturedProduct = table.Column(type: "bit", nullable: false), - DisplayOrder = table.Column(type: "int", nullable: false), - CategoryId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductCategory", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductCategory_Catalog_Category_CategoryId", - column: x => x.CategoryId, - principalTable: "Catalog_Category", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductCategory_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductLink", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: false), - LinkedProductId = table.Column(type: "bigint", nullable: false), - LinkType = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductLink", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductLink_Catalog_Product_LinkedProductId", - column: x => x.LinkedProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductLink_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductMedia", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: false), - MediaId = table.Column(type: "bigint", nullable: false), - DisplayOrder = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductMedia", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductMedia_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductMedia_Core_Media_MediaId", - column: x => x.MediaId, - principalTable: "Core_Media", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductOptionCombination", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: false), - OptionId = table.Column(type: "bigint", nullable: false), - Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - SortIndex = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductOptionCombination", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductOptionCombination_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductOptionCombination_Catalog_ProductOption_OptionId", - column: x => x.OptionId, - principalTable: "Catalog_ProductOption", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductOptionValue", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OptionId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Value = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DisplayType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - SortIndex = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductOptionValue", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductOptionValue_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Catalog_ProductOptionValue_Catalog_ProductOption_OptionId", - column: x => x.OptionId, - principalTable: "Catalog_ProductOption", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Inventory_Stock", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: false), - WarehouseId = table.Column(type: "bigint", nullable: false), - Quantity = table.Column(type: "int", nullable: false), - ReservedQuantity = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Inventory_Stock", x => x.Id); - table.ForeignKey( - name: "FK_Inventory_Stock_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Inventory_Stock_Inventory_Warehouse_WarehouseId", - column: x => x.WarehouseId, - principalTable: "Inventory_Warehouse", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CartRuleProduct", - columns: table => new - { - ProductId = table.Column(type: "bigint", nullable: false), - CartRuleId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CartRuleProduct", x => new { x.CartRuleId, x.ProductId }); - table.ForeignKey( - name: "FK_Pricing_CartRuleProduct_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CartRuleProduct_Pricing_CartRule_CartRuleId", - column: x => x.CartRuleId, - principalTable: "Pricing_CartRule", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Catalog_ProductPriceHistory", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: true), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - Price = table.Column(type: "decimal(18,2)", nullable: true), - OldPrice = table.Column(type: "decimal(18,2)", nullable: true), - SpecialPrice = table.Column(type: "decimal(18,2)", nullable: true), - SpecialPriceStart = table.Column(type: "datetimeoffset", nullable: true), - SpecialPriceEnd = table.Column(type: "datetimeoffset", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Catalog_ProductPriceHistory", x => x.Id); - table.ForeignKey( - name: "FK_Catalog_ProductPriceHistory_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Cms_Page", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Body = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), - IsPublished = table.Column(type: "bit", nullable: false), - PublishedOn = table.Column(type: "datetimeoffset", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedById = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Cms_Page", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Comments_Comment", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - CommentText = table.Column(type: "nvarchar(max)", nullable: true), - CommenterName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Status = table.Column(type: "int", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - EntityId = table.Column(type: "bigint", nullable: false), - ParentId = table.Column(type: "bigint", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Comments_Comment", x => x.Id); - table.ForeignKey( - name: "FK_Comments_Comment_Comments_Comment_ParentId", - column: x => x.ParentId, - principalTable: "Comments_Comment", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_CustomerGroupUser", - columns: table => new - { - UserId = table.Column(type: "bigint", nullable: false), - CustomerGroupId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_CustomerGroupUser", x => new { x.UserId, x.CustomerGroupId }); - table.ForeignKey( - name: "FK_Core_CustomerGroupUser_Core_CustomerGroup_CustomerGroupId", - column: x => x.CustomerGroupId, - principalTable: "Core_CustomerGroup", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_User", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserGuid = table.Column(type: "uniqueidentifier", nullable: false), - FullName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - VendorId = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - DefaultShippingAddressId = table.Column(type: "bigint", nullable: true), - DefaultBillingAddressId = table.Column(type: "bigint", nullable: true), - RefreshTokenHash = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Culture = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ExtensionData = table.Column(type: "nvarchar(max)", nullable: true), - UserName = table.Column(type: "nvarchar(256)", maxLength: 256, 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_Core_User", x => x.Id); - table.ForeignKey( - name: "FK_Core_User_Core_Vendor_VendorId", - column: x => x.VendorId, - principalTable: "Core_Vendor", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_UserAddress", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - AddressId = table.Column(type: "bigint", nullable: false), - AddressType = table.Column(type: "int", nullable: false), - LastUsedOn = table.Column(type: "datetimeoffset", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_UserAddress", x => x.Id); - table.ForeignKey( - name: "FK_Core_UserAddress_Core_Address_AddressId", - column: x => x.AddressId, - principalTable: "Core_Address", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Core_UserAddress_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_UserClaim", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_UserClaim", x => x.Id); - table.ForeignKey( - name: "FK_Core_UserClaim_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_UserLogin", - 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: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_UserLogin", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_Core_UserLogin_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Core_UserRole", - columns: table => new - { - UserId = table.Column(type: "bigint", nullable: false), - RoleId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Core_UserRole", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_Core_UserRole_Core_Role_RoleId", - column: x => x.RoleId, - principalTable: "Core_Role", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Core_UserRole_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Core_UserToken", - columns: table => new - { - UserId = table.Column(type: "bigint", 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_Core_UserToken", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_Core_UserToken_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Inventory_StockHistory", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ProductId = table.Column(type: "bigint", nullable: false), - WarehouseId = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - AdjustedQuantity = table.Column(type: "bigint", nullable: false), - Note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Inventory_StockHistory", x => x.Id); - table.ForeignKey( - name: "FK_Inventory_StockHistory_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Inventory_StockHistory_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Inventory_StockHistory_Inventory_Warehouse_WarehouseId", - column: x => x.WarehouseId, - principalTable: "Inventory_Warehouse", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "News_NewsItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ShortContent = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - FullContent = table.Column(type: "nvarchar(max)", nullable: true), - ThumbnailImageId = table.Column(type: "bigint", nullable: true), - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Slug = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - MetaTitle = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaKeywords = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MetaDescription = table.Column(type: "nvarchar(max)", nullable: true), - IsPublished = table.Column(type: "bit", nullable: false), - PublishedOn = table.Column(type: "datetimeoffset", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedById = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_News_NewsItem", x => x.Id); - table.ForeignKey( - name: "FK_News_NewsItem_Core_Media_ThumbnailImageId", - column: x => x.ThumbnailImageId, - principalTable: "Core_Media", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_News_NewsItem_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_News_NewsItem_Core_User_LatestUpdatedById", - column: x => x.LatestUpdatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Orders_Order", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CustomerId = table.Column(type: "bigint", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - VendorId = table.Column(type: "bigint", nullable: true), - CouponCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CouponRuleName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), - SubTotal = table.Column(type: "decimal(18,2)", nullable: false), - SubTotalWithDiscount = table.Column(type: "decimal(18,2)", nullable: false), - ShippingAddressId = table.Column(type: "bigint", nullable: false), - BillingAddressId = table.Column(type: "bigint", nullable: false), - OrderStatus = table.Column(type: "int", nullable: false), - OrderNote = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - ParentId = table.Column(type: "bigint", nullable: true), - IsMasterOrder = table.Column(type: "bit", nullable: false), - ShippingMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ShippingFeeAmount = table.Column(type: "decimal(18,2)", nullable: false), - TaxAmount = table.Column(type: "decimal(18,2)", nullable: false), - OrderTotal = table.Column(type: "decimal(18,2)", nullable: false), - PaymentMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - PaymentFeeAmount = table.Column(type: "decimal(18,2)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders_Order", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Order_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Order_Core_User_CustomerId", - column: x => x.CustomerId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Order_Core_User_LatestUpdatedById", - column: x => x.LatestUpdatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Order_Orders_Order_ParentId", - column: x => x.ParentId, - principalTable: "Orders_Order", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Order_Orders_OrderAddress_BillingAddressId", - column: x => x.BillingAddressId, - principalTable: "Orders_OrderAddress", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Order_Orders_OrderAddress_ShippingAddressId", - column: x => x.ShippingAddressId, - principalTable: "Orders_OrderAddress", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Pricing_CartRuleUsage", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CartRuleId = table.Column(type: "bigint", nullable: false), - CouponId = table.Column(type: "bigint", nullable: true), - UserId = table.Column(type: "bigint", nullable: false), - OrderId = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pricing_CartRuleUsage", x => x.Id); - table.ForeignKey( - name: "FK_Pricing_CartRuleUsage_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CartRuleUsage_Pricing_CartRule_CartRuleId", - column: x => x.CartRuleId, - principalTable: "Pricing_CartRule", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Pricing_CartRuleUsage_Pricing_Coupon_CouponId", - column: x => x.CouponId, - principalTable: "Pricing_Coupon", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProductComparison_ComparingProduct", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - UserId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProductComparison_ComparingProduct", x => x.Id); - table.ForeignKey( - name: "FK_ProductComparison_ComparingProduct_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProductComparison_ComparingProduct_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Reviews_Review", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - Title = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Comment = table.Column(type: "nvarchar(max)", nullable: true), - Rating = table.Column(type: "int", nullable: false), - ReviewerName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Status = table.Column(type: "int", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - EntityTypeId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - EntityId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Reviews_Review", x => x.Id); - table.ForeignKey( - name: "FK_Reviews_Review_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ShoppingCart_Cart", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CustomerId = table.Column(type: "bigint", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - IsActive = table.Column(type: "bit", nullable: false), - LockedOnCheckout = table.Column(type: "bit", nullable: false), - CouponCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CouponRuleName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ShippingMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - IsProductPriceIncludeTax = table.Column(type: "bit", nullable: false), - ShippingAmount = table.Column(type: "decimal(18,2)", nullable: true), - TaxAmount = table.Column(type: "decimal(18,2)", nullable: true), - ShippingData = table.Column(type: "nvarchar(max)", nullable: true), - OrderNote = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ShoppingCart_Cart", x => x.Id); - table.ForeignKey( - name: "FK_ShoppingCart_Cart_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ShoppingCart_Cart_Core_User_CustomerId", - column: x => x.CustomerId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "WishList_WishList", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "bigint", nullable: false), - SharingCode = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WishList_WishList", x => x.Id); - table.ForeignKey( - name: "FK_WishList_WishList_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "News_NewsItemCategory", - columns: table => new - { - CategoryId = table.Column(type: "bigint", nullable: false), - NewsItemId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_News_NewsItemCategory", x => new { x.CategoryId, x.NewsItemId }); - table.ForeignKey( - name: "FK_News_NewsItemCategory_News_NewsCategory_CategoryId", - column: x => x.CategoryId, - principalTable: "News_NewsCategory", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_News_NewsItemCategory_News_NewsItem_NewsItemId", - column: x => x.NewsItemId, - principalTable: "News_NewsItem", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Orders_OrderHistory", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OrderId = table.Column(type: "bigint", nullable: false), - OldStatus = table.Column(type: "int", nullable: true), - NewStatus = table.Column(type: "int", nullable: false), - OrderSnapshot = table.Column(type: "nvarchar(max)", nullable: true), - Note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - CreatedById = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders_OrderHistory", x => x.Id); - table.ForeignKey( - name: "FK_Orders_OrderHistory_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_OrderHistory_Orders_Order_OrderId", - column: x => x.OrderId, - principalTable: "Orders_Order", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Orders_OrderItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OrderId = table.Column(type: "bigint", nullable: true), - ProductId = table.Column(type: "bigint", nullable: false), - ProductPrice = table.Column(type: "decimal(18,2)", nullable: false), - Quantity = table.Column(type: "int", nullable: false), - DiscountAmount = table.Column(type: "decimal(18,2)", nullable: false), - TaxAmount = table.Column(type: "decimal(18,2)", nullable: false), - TaxPercent = table.Column(type: "decimal(18,2)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders_OrderItem", x => x.Id); - table.ForeignKey( - name: "FK_Orders_OrderItem_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_OrderItem_Orders_Order_OrderId", - column: x => x.OrderId, - principalTable: "Orders_Order", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Payments_Payment", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OrderId = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false), - Amount = table.Column(type: "decimal(18,2)", nullable: false), - PaymentFee = table.Column(type: "decimal(18,2)", nullable: false), - PaymentMethod = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - GatewayTransactionId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Status = table.Column(type: "int", nullable: false), - FailureMessage = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Payments_Payment", x => x.Id); - table.ForeignKey( - name: "FK_Payments_Payment_Orders_Order_OrderId", - column: x => x.OrderId, - principalTable: "Orders_Order", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Shipments_Shipment", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OrderId = table.Column(type: "bigint", nullable: false), - TrackingNumber = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - WarehouseId = table.Column(type: "bigint", nullable: false), - VendorId = table.Column(type: "bigint", nullable: true), - CreatedById = table.Column(type: "bigint", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Shipments_Shipment", x => x.Id); - table.ForeignKey( - name: "FK_Shipments_Shipment_Core_User_CreatedById", - column: x => x.CreatedById, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Shipments_Shipment_Inventory_Warehouse_WarehouseId", - column: x => x.WarehouseId, - principalTable: "Inventory_Warehouse", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Shipments_Shipment_Orders_Order_OrderId", - column: x => x.OrderId, - principalTable: "Orders_Order", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Reviews_Reply", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ReviewId = table.Column(type: "bigint", nullable: false), - UserId = table.Column(type: "bigint", nullable: false), - Comment = table.Column(type: "nvarchar(max)", nullable: true), - ReplierName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Status = table.Column(type: "int", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Reviews_Reply", x => x.Id); - table.ForeignKey( - name: "FK_Reviews_Reply_Core_User_UserId", - column: x => x.UserId, - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Reviews_Reply_Reviews_Review_ReviewId", - column: x => x.ReviewId, - principalTable: "Reviews_Review", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ShoppingCart_CartItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Quantity = table.Column(type: "int", nullable: false), - CartId = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ShoppingCart_CartItem", x => x.Id); - table.ForeignKey( - name: "FK_ShoppingCart_CartItem_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ShoppingCart_CartItem_ShoppingCart_Cart_CartId", - column: x => x.CartId, - principalTable: "ShoppingCart_Cart", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "WishList_WishListItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - WishListId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Quantity = table.Column(type: "int", nullable: false), - CreatedOn = table.Column(type: "datetimeoffset", nullable: false), - LatestUpdatedOn = table.Column(type: "datetimeoffset", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WishList_WishListItem", x => x.Id); - table.ForeignKey( - name: "FK_WishList_WishListItem_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WishList_WishListItem_WishList_WishList_WishListId", - column: x => x.WishListId, - principalTable: "WishList_WishList", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Shipments_ShipmentItem", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ShipmentId = table.Column(type: "bigint", nullable: false), - OrderItemId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Quantity = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Shipments_ShipmentItem", x => x.Id); - table.ForeignKey( - name: "FK_Shipments_ShipmentItem_Catalog_Product_ProductId", - column: x => x.ProductId, - principalTable: "Catalog_Product", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Shipments_ShipmentItem_Shipments_Shipment_ShipmentId", - column: x => x.ShipmentId, - principalTable: "Shipments_Shipment", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.InsertData( - table: "ActivityLog_ActivityType", - columns: new[] { "Id", "Name" }, - values: new object[] { 1L, "EntityView" }); - - migrationBuilder.InsertData( - table: "Catalog_ProductOption", - columns: new[] { "Id", "Name" }, - values: new object[,] - { - { 1L, "Color" }, - { 2L, "Size" } - }); - - migrationBuilder.InsertData( - table: "Cms_Menu", - columns: new[] { "Id", "IsPublished", "IsSystem", "Name" }, - values: new object[,] - { - { 1L, true, true, "Customer Services" }, - { 2L, true, true, "Information" } - }); - - migrationBuilder.InsertData( - table: "Core_AppSetting", - columns: new[] { "Id", "IsVisibleInCommonSettingPage", "Module", "Value" }, - values: new object[,] - { - { "Catalog.IsCommentsRequireApproval", true, "Catalog", "true" }, - { "Catalog.IsProductPriceIncludeTax", true, "Catalog", "true" }, - { "Catalog.ProductPageSize", true, "Catalog", "10" }, - { "Global.AssetBundling", true, "Core", "false" }, - { "Global.AssetVersion", true, "Core", "1.0" }, - { "Global.CurrencyCulture", true, "Core", "en-US" }, - { "Global.CurrencyDecimalPlace", true, "Core", "2" }, - { "Global.DefaultCultureAdminUI", true, "Core", "en-US" }, - { "Global.DefaultCultureUI", true, "Core", "en-US" }, - { "GoogleAppKey", false, "Contact", "" }, - { "Localization.LocalizedConentEnable", true, "Localization", "true" }, - { "News.PageSize", true, "News", "10" }, - { "SmtpPassword", false, "EmailSenderSmpt", "" }, - { "SmtpPort", false, "EmailSenderSmpt", "587" }, - { "SmtpServer", false, "EmailSenderSmpt", "smtp.gmail.com" }, - { "SmtpUsername", false, "EmailSenderSmpt", "" }, - { "Tax.DefaultTaxClassId", true, "Tax", "1" }, - { "Theme", false, "Core", "Generic" } - }); - - migrationBuilder.InsertData( - table: "Core_Country", - columns: new[] { "Id", "Code3", "IsBillingEnabled", "IsCityEnabled", "IsDistrictEnabled", "IsShippingEnabled", "IsZipCodeEnabled", "Name" }, - values: new object[,] - { - { "US", "USA", true, true, false, true, true, "United States" }, - { "VN", "VNM", true, false, true, true, false, "Việt Nam" } - }); - - migrationBuilder.InsertData( - table: "Core_EntityType", - columns: new[] { "Id", "AreaName", "IsMenuable", "RoutingAction", "RoutingController" }, - values: new object[,] - { - { "Brand", "Catalog", true, "BrandDetail", "Brand" }, - { "Category", "Catalog", true, "CategoryDetail", "Category" }, - { "NewsCategory", "News", true, "NewsCategoryDetail", "NewsCategory" }, - { "NewsItem", "News", false, "NewsItemDetail", "NewsItem" }, - { "Page", "Cms", true, "PageDetail", "Page" }, - { "Product", "Catalog", false, "ProductDetail", "Product" }, - { "Vendor", "Core", false, "VendorDetail", "Vendor" } - }); - - migrationBuilder.InsertData( - table: "Core_Role", - columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, - values: new object[,] - { - { 1L, "4776a1b2-dbe4-4056-82ec-8bed211d1454", "admin", "ADMIN" }, - { 2L, "00d172be-03a0-4856-8b12-26d63fcf4374", "customer", "CUSTOMER" }, - { 3L, "d4754388-8355-4018-b728-218018836817", "guest", "GUEST" }, - { 4L, "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", "vendor", "VENDOR" } - }); - - migrationBuilder.InsertData( - table: "Core_User", - columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "CreatedOn", "Culture", "DefaultBillingAddressId", "DefaultShippingAddressId", "Email", "EmailConfirmed", "ExtensionData", "FullName", "IsDeleted", "LatestUpdatedOn", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "RefreshTokenHash", "SecurityStamp", "TwoFactorEnabled", "UserGuid", "UserName", "VendorId" }, - values: new object[,] - { - { 2L, 0, "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "system@simplcommerce.com", false, null, "System User", true, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "SYSTEM@SIMPLCOMMERCE.COM", "SYSTEM@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "a9565acb-cee6-425f-9833-419a793f5fba", false, new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), "system@simplcommerce.com", null }, - { 10L, 0, "c83afcbc-312c-4589-bad7-8686bd4754c0", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), null, null, null, "admin@simplcommerce.com", false, null, "Shop Admin", false, new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), false, null, "ADMIN@SIMPLCOMMERCE.COM", "ADMIN@SIMPLCOMMERCE.COM", "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", null, false, null, "d6847450-47f0-4c7a-9fed-0c66234bf61f", false, new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), "admin@simplcommerce.com", null } - }); - - migrationBuilder.InsertData( - table: "Core_Widget", - columns: new[] { "Id", "CreateUrl", "CreatedOn", "EditUrl", "IsPublished", "Name", "ViewComponentName" }, - values: new object[,] - { - { "CarouselWidget", "widget-carousel-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-carousel-edit", false, "Carousel Widget", "CarouselWidget" }, - { "CategoryWidget", "widget-category-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-category-edit", false, "Category Widget", "CategoryWidget" }, - { "HtmlWidget", "widget-html-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-html-edit", false, "Html Widget", "HtmlWidget" }, - { "ProductWidget", "widget-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-product-edit", false, "Product Widget", "ProductWidget" } - }); - - migrationBuilder.InsertData( - table: "Core_Widget", - columns: new[] { "Id", "CreateUrl", "CreatedOn", "EditUrl", "IsPublished", "Name", "ViewComponentName" }, - values: new object[,] - { - { "RecentlyViewedWidget", "widget-recently-viewed-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-recently-viewed-edit", false, "Recently Viewed Widget", "RecentlyViewedWidget" }, - { "SimpleProductWidget", "widget-simple-product-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-simple-product-edit", false, "Simple Product Widget", "SimpleProductWidget" }, - { "SpaceBarWidget", "widget-spacebar-create", new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), "widget-spacebar-edit", false, "SpaceBar Widget", "SpaceBarWidget" } - }); - - migrationBuilder.InsertData( - table: "Core_WidgetZone", - columns: new[] { "Id", "Description", "Name" }, - values: new object[,] - { - { 1L, null, "Home Featured" }, - { 2L, null, "Home Main Content" }, - { 3L, null, "Home After Main Content" } - }); - - migrationBuilder.InsertData( - table: "Localization_Culture", - columns: new[] { "Id", "Name" }, - values: new object[] { "en-US", "English (US)" }); - - migrationBuilder.InsertData( - table: "Payments_PaymentProvider", - columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "LandingViewComponentName", "Name" }, - values: new object[,] - { - { "Braintree", "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", "payments-braintree-config", true, "BraintreeLanding", "Braintree" }, - { "Cashfree", "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", "payments-cashfree-config", true, "CashfreeLanding", "Cashfree Payment Gateway" }, - { "CoD", null, "payments-cod-config", true, "CoDLanding", "Cash On Delivery" }, - { "MomoPayment", "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", "payments-momo-config", true, "MomoLanding", "Momo Payment" }, - { "NganLuong", "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", "payments-nganluong-config", true, "NganLuongLanding", "Ngan Luong Payment" }, - { "PaypalExpress", "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", "payments-paypalExpress-config", true, "PaypalExpressLanding", "Paypal Express" }, - { "Stripe", "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", "payments-stripe-config", true, "StripeLanding", "Stripe" } - }); - - migrationBuilder.InsertData( - table: "Shipping_ShippingProvider", - columns: new[] { "Id", "AdditionalSettings", "ConfigureUrl", "IsEnabled", "Name", "OnlyCountryIdsString", "OnlyStateOrProvinceIdsString", "ShippingPriceServiceTypeName", "ToAllShippingEnabledCountries", "ToAllShippingEnabledStatesOrProvinces" }, - values: new object[,] - { - { "FreeShip", "{MinimumOrderAmount : 1}", "", true, "Free Ship", null, null, "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", true, true }, - { "TableRate", null, "shipping-table-rate-config", true, "Table Rate", null, null, "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", true, true } - }); - - migrationBuilder.InsertData( - table: "Tax_TaxClass", - columns: new[] { "Id", "Name" }, - values: new object[] { 1L, "Standard VAT" }); - - migrationBuilder.InsertData( - table: "Core_StateOrProvince", - columns: new[] { "Id", "Code", "CountryId", "Name", "Type" }, - values: new object[] { 1L, null, "VN", "Hồ Chí Minh", "Thành Phố" }); - - migrationBuilder.InsertData( - table: "Core_StateOrProvince", - columns: new[] { "Id", "Code", "CountryId", "Name", "Type" }, - values: new object[] { 2L, "WA", "US", "Washington", null }); - - migrationBuilder.InsertData( - table: "Core_UserRole", - columns: new[] { "RoleId", "UserId" }, - values: new object[] { 1L, 10L }); - - migrationBuilder.InsertData( - table: "Core_Address", - columns: new[] { "Id", "AddressLine1", "AddressLine2", "City", "ContactName", "CountryId", "DistrictId", "Phone", "StateOrProvinceId", "ZipCode" }, - values: new object[] { 1L, "364 Cong Hoa", null, null, "Thien Nguyen", "VN", null, null, 1L, null }); - - migrationBuilder.InsertData( - table: "Core_District", - columns: new[] { "Id", "Location", "Name", "StateOrProvinceId", "Type" }, - values: new object[] { 1L, null, "Quận 1", 1L, "Quận" }); - - migrationBuilder.InsertData( - table: "Core_District", - columns: new[] { "Id", "Location", "Name", "StateOrProvinceId", "Type" }, - values: new object[] { 2L, null, "Quận 2", 1L, "Quận" }); - - migrationBuilder.InsertData( - table: "Inventory_Warehouse", - columns: new[] { "Id", "AddressId", "Name", "VendorId" }, - values: new object[] { 1L, 1L, "Default warehouse", null }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityLog_Activity_ActivityTypeId", - table: "ActivityLog_Activity", - column: "ActivityTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Category_ParentId", - table: "Catalog_Category", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Category_ThumbnailImageId", - table: "Catalog_Category", - column: "ThumbnailImageId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Product_BrandId", - table: "Catalog_Product", - column: "BrandId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Product_CreatedById", - table: "Catalog_Product", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Product_LatestUpdatedById", - table: "Catalog_Product", - column: "LatestUpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Product_TaxClassId", - table: "Catalog_Product", - column: "TaxClassId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_Product_ThumbnailImageId", - table: "Catalog_Product", - column: "ThumbnailImageId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductAttribute_GroupId", - table: "Catalog_ProductAttribute", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductAttributeValue_AttributeId", - table: "Catalog_ProductAttributeValue", - column: "AttributeId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductAttributeValue_ProductId", - table: "Catalog_ProductAttributeValue", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductCategory_CategoryId", - table: "Catalog_ProductCategory", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductCategory_ProductId", - table: "Catalog_ProductCategory", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductLink_LinkedProductId", - table: "Catalog_ProductLink", - column: "LinkedProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductLink_ProductId", - table: "Catalog_ProductLink", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductMedia_MediaId", - table: "Catalog_ProductMedia", - column: "MediaId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductMedia_ProductId", - table: "Catalog_ProductMedia", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductOptionCombination_OptionId", - table: "Catalog_ProductOptionCombination", - column: "OptionId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductOptionCombination_ProductId", - table: "Catalog_ProductOptionCombination", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductOptionValue_OptionId", - table: "Catalog_ProductOptionValue", - column: "OptionId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductOptionValue_ProductId", - table: "Catalog_ProductOptionValue", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductPriceHistory_CreatedById", - table: "Catalog_ProductPriceHistory", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductPriceHistory_ProductId", - table: "Catalog_ProductPriceHistory", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Catalog_ProductTemplateProductAttribute_ProductAttributeId", - table: "Catalog_ProductTemplateProductAttribute", - column: "ProductAttributeId"); - - migrationBuilder.CreateIndex( - name: "IX_Cms_MenuItem_EntityId", - table: "Cms_MenuItem", - column: "EntityId"); - - migrationBuilder.CreateIndex( - name: "IX_Cms_MenuItem_MenuId", - table: "Cms_MenuItem", - column: "MenuId"); - - migrationBuilder.CreateIndex( - name: "IX_Cms_MenuItem_ParentId", - table: "Cms_MenuItem", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Cms_Page_CreatedById", - table: "Cms_Page", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Cms_Page_LatestUpdatedById", - table: "Cms_Page", - column: "LatestUpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Comments_Comment_ParentId", - table: "Comments_Comment", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Comments_Comment_UserId", - table: "Comments_Comment", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Contacts_Contact_ContactAreaId", - table: "Contacts_Contact", - column: "ContactAreaId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_Address_CountryId", - table: "Core_Address", - column: "CountryId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_Address_DistrictId", - table: "Core_Address", - column: "DistrictId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_Address_StateOrProvinceId", - table: "Core_Address", - column: "StateOrProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_CustomerGroup_Name", - table: "Core_CustomerGroup", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Core_CustomerGroupUser_CustomerGroupId", - table: "Core_CustomerGroupUser", - column: "CustomerGroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_District_StateOrProvinceId", - table: "Core_District", - column: "StateOrProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_Entity_EntityTypeId", - table: "Core_Entity", - column: "EntityTypeId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "Core_Role", - column: "NormalizedName", - unique: true, - filter: "[NormalizedName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Core_RoleClaim_RoleId", - table: "Core_RoleClaim", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_StateOrProvince_CountryId", - table: "Core_StateOrProvince", - column: "CountryId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "Core_User", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_Core_User_DefaultBillingAddressId", - table: "Core_User", - column: "DefaultBillingAddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_User_DefaultShippingAddressId", - table: "Core_User", - column: "DefaultShippingAddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_User_VendorId", - table: "Core_User", - column: "VendorId"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "Core_User", - column: "NormalizedUserName", - unique: true, - filter: "[NormalizedUserName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Core_UserAddress_AddressId", - table: "Core_UserAddress", - column: "AddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_UserAddress_UserId", - table: "Core_UserAddress", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_UserClaim_UserId", - table: "Core_UserClaim", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_UserLogin_UserId", - table: "Core_UserLogin", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_UserRole_RoleId", - table: "Core_UserRole", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_WidgetInstance_WidgetId", - table: "Core_WidgetInstance", - column: "WidgetId"); - - migrationBuilder.CreateIndex( - name: "IX_Core_WidgetInstance_WidgetZoneId", - table: "Core_WidgetInstance", - column: "WidgetZoneId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_Stock_ProductId", - table: "Inventory_Stock", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_Stock_WarehouseId", - table: "Inventory_Stock", - column: "WarehouseId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_StockHistory_CreatedById", - table: "Inventory_StockHistory", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_StockHistory_ProductId", - table: "Inventory_StockHistory", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_StockHistory_WarehouseId", - table: "Inventory_StockHistory", - column: "WarehouseId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_Warehouse_AddressId", - table: "Inventory_Warehouse", - column: "AddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventory_Warehouse_VendorId", - table: "Inventory_Warehouse", - column: "VendorId"); - - migrationBuilder.CreateIndex( - name: "IX_Localization_LocalizedContentProperty_CultureId", - table: "Localization_LocalizedContentProperty", - column: "CultureId"); - - migrationBuilder.CreateIndex( - name: "IX_Localization_Resource_CultureId", - table: "Localization_Resource", - column: "CultureId"); - - migrationBuilder.CreateIndex( - name: "IX_News_NewsItem_CreatedById", - table: "News_NewsItem", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_News_NewsItem_LatestUpdatedById", - table: "News_NewsItem", - column: "LatestUpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_News_NewsItem_ThumbnailImageId", - table: "News_NewsItem", - column: "ThumbnailImageId"); - - migrationBuilder.CreateIndex( - name: "IX_News_NewsItemCategory_NewsItemId", - table: "News_NewsItemCategory", - column: "NewsItemId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_BillingAddressId", - table: "Orders_Order", - column: "BillingAddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_CreatedById", - table: "Orders_Order", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_CustomerId", - table: "Orders_Order", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_LatestUpdatedById", - table: "Orders_Order", - column: "LatestUpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_ParentId", - table: "Orders_Order", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_Order_ShippingAddressId", - table: "Orders_Order", - column: "ShippingAddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderAddress_CountryId", - table: "Orders_OrderAddress", - column: "CountryId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderAddress_DistrictId", - table: "Orders_OrderAddress", - column: "DistrictId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderAddress_StateOrProvinceId", - table: "Orders_OrderAddress", - column: "StateOrProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderHistory_CreatedById", - table: "Orders_OrderHistory", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderHistory_OrderId", - table: "Orders_OrderHistory", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderItem_OrderId", - table: "Orders_OrderItem", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_OrderItem_ProductId", - table: "Orders_OrderItem", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Payments_Payment_OrderId", - table: "Payments_Payment", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleCategory_CategoryId", - table: "Pricing_CartRuleCategory", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleCustomerGroup_CustomerGroupId", - table: "Pricing_CartRuleCustomerGroup", - column: "CustomerGroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleProduct_ProductId", - table: "Pricing_CartRuleProduct", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleUsage_CartRuleId", - table: "Pricing_CartRuleUsage", - column: "CartRuleId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleUsage_CouponId", - table: "Pricing_CartRuleUsage", - column: "CouponId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CartRuleUsage_UserId", - table: "Pricing_CartRuleUsage", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_CatalogRuleCustomerGroup_CustomerGroupId", - table: "Pricing_CatalogRuleCustomerGroup", - column: "CustomerGroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Pricing_Coupon_CartRuleId", - table: "Pricing_Coupon", - column: "CartRuleId"); - - migrationBuilder.CreateIndex( - name: "IX_ProductComparison_ComparingProduct_ProductId", - table: "ProductComparison_ComparingProduct", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_ProductComparison_ComparingProduct_UserId", - table: "ProductComparison_ComparingProduct", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Reviews_Reply_ReviewId", - table: "Reviews_Reply", - column: "ReviewId"); - - migrationBuilder.CreateIndex( - name: "IX_Reviews_Reply_UserId", - table: "Reviews_Reply", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Reviews_Review_UserId", - table: "Reviews_Review", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Shipments_Shipment_CreatedById", - table: "Shipments_Shipment", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Shipments_Shipment_OrderId", - table: "Shipments_Shipment", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_Shipments_Shipment_WarehouseId", - table: "Shipments_Shipment", - column: "WarehouseId"); - - migrationBuilder.CreateIndex( - name: "IX_Shipments_ShipmentItem_ProductId", - table: "Shipments_ShipmentItem", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Shipments_ShipmentItem_ShipmentId", - table: "Shipments_ShipmentItem", - column: "ShipmentId"); - - migrationBuilder.CreateIndex( - name: "IX_ShippingTableRate_PriceAndDestination_CountryId", - table: "ShippingTableRate_PriceAndDestination", - column: "CountryId"); - - migrationBuilder.CreateIndex( - name: "IX_ShippingTableRate_PriceAndDestination_DistrictId", - table: "ShippingTableRate_PriceAndDestination", - column: "DistrictId"); - - migrationBuilder.CreateIndex( - name: "IX_ShippingTableRate_PriceAndDestination_StateOrProvinceId", - table: "ShippingTableRate_PriceAndDestination", - column: "StateOrProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_ShoppingCart_Cart_CreatedById", - table: "ShoppingCart_Cart", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ShoppingCart_Cart_CustomerId", - table: "ShoppingCart_Cart", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_ShoppingCart_CartItem_CartId", - table: "ShoppingCart_CartItem", - column: "CartId"); - - migrationBuilder.CreateIndex( - name: "IX_ShoppingCart_CartItem_ProductId", - table: "ShoppingCart_CartItem", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Tax_TaxRate_CountryId", - table: "Tax_TaxRate", - column: "CountryId"); - - migrationBuilder.CreateIndex( - name: "IX_Tax_TaxRate_StateOrProvinceId", - table: "Tax_TaxRate", - column: "StateOrProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_Tax_TaxRate_TaxClassId", - table: "Tax_TaxRate", - column: "TaxClassId"); - - migrationBuilder.CreateIndex( - name: "IX_WishList_WishList_UserId", - table: "WishList_WishList", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_WishList_WishListItem_ProductId", - table: "WishList_WishListItem", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_WishList_WishListItem_WishListId", - table: "WishList_WishListItem", - column: "WishListId"); - - migrationBuilder.AddForeignKey( - name: "FK_Catalog_Product_Core_User_CreatedById", - table: "Catalog_Product", - column: "CreatedById", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Catalog_Product_Core_User_LatestUpdatedById", - table: "Catalog_Product", - column: "LatestUpdatedById", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Catalog_ProductPriceHistory_Core_User_CreatedById", - table: "Catalog_ProductPriceHistory", - column: "CreatedById", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Cms_Page_Core_User_CreatedById", - table: "Cms_Page", - column: "CreatedById", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Cms_Page_Core_User_LatestUpdatedById", - table: "Cms_Page", - column: "LatestUpdatedById", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Comments_Comment_Core_User_UserId", - table: "Comments_Comment", - column: "UserId", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Core_CustomerGroupUser_Core_User_UserId", - table: "Core_CustomerGroupUser", - column: "UserId", - principalTable: "Core_User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Core_User_Core_UserAddress_DefaultBillingAddressId", - table: "Core_User", - column: "DefaultBillingAddressId", - principalTable: "Core_UserAddress", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Core_User_Core_UserAddress_DefaultShippingAddressId", - table: "Core_User", - column: "DefaultShippingAddressId", - principalTable: "Core_UserAddress", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Core_UserAddress_Core_User_UserId", - table: "Core_UserAddress"); - - migrationBuilder.DropTable( - name: "ActivityLog_Activity"); - - migrationBuilder.DropTable( - name: "Catalog_ProductAttributeValue"); - - migrationBuilder.DropTable( - name: "Catalog_ProductCategory"); - - migrationBuilder.DropTable( - name: "Catalog_ProductLink"); - - migrationBuilder.DropTable( - name: "Catalog_ProductMedia"); - - migrationBuilder.DropTable( - name: "Catalog_ProductOptionCombination"); - - migrationBuilder.DropTable( - name: "Catalog_ProductOptionValue"); - - migrationBuilder.DropTable( - name: "Catalog_ProductPriceHistory"); - - migrationBuilder.DropTable( - name: "Catalog_ProductTemplateProductAttribute"); - - migrationBuilder.DropTable( - name: "Cms_MenuItem"); - - migrationBuilder.DropTable( - name: "Cms_Page"); - - migrationBuilder.DropTable( - name: "Comments_Comment"); - - migrationBuilder.DropTable( - name: "Contacts_Contact"); - - migrationBuilder.DropTable( - name: "Core_AppSetting"); - - migrationBuilder.DropTable( - name: "Core_CustomerGroupUser"); - - migrationBuilder.DropTable( - name: "Core_RoleClaim"); - - migrationBuilder.DropTable( - name: "Core_UserClaim"); - - migrationBuilder.DropTable( - name: "Core_UserLogin"); - - migrationBuilder.DropTable( - name: "Core_UserRole"); - - migrationBuilder.DropTable( - name: "Core_UserToken"); - - migrationBuilder.DropTable( - name: "Core_WidgetInstance"); - - migrationBuilder.DropTable( - name: "Inventory_Stock"); - - migrationBuilder.DropTable( - name: "Inventory_StockHistory"); - - migrationBuilder.DropTable( - name: "Localization_LocalizedContentProperty"); - - migrationBuilder.DropTable( - name: "Localization_Resource"); - - migrationBuilder.DropTable( - name: "News_NewsItemCategory"); - - migrationBuilder.DropTable( - name: "Orders_OrderHistory"); - - migrationBuilder.DropTable( - name: "Orders_OrderItem"); - - migrationBuilder.DropTable( - name: "Payments_Payment"); - - migrationBuilder.DropTable( - name: "Payments_PaymentProvider"); - - migrationBuilder.DropTable( - name: "Pricing_CartRuleCategory"); - - migrationBuilder.DropTable( - name: "Pricing_CartRuleCustomerGroup"); - - migrationBuilder.DropTable( - name: "Pricing_CartRuleProduct"); - - migrationBuilder.DropTable( - name: "Pricing_CartRuleUsage"); - - migrationBuilder.DropTable( - name: "Pricing_CatalogRuleCustomerGroup"); - - migrationBuilder.DropTable( - name: "ProductComparison_ComparingProduct"); - - migrationBuilder.DropTable( - name: "ProductRecentlyViewed_RecentlyViewedProduct"); - - migrationBuilder.DropTable( - name: "Reviews_Reply"); - - migrationBuilder.DropTable( - name: "Search_Query"); - - migrationBuilder.DropTable( - name: "Shipments_ShipmentItem"); - - migrationBuilder.DropTable( - name: "Shipping_ShippingProvider"); - - migrationBuilder.DropTable( - name: "ShippingTableRate_PriceAndDestination"); - - migrationBuilder.DropTable( - name: "ShoppingCart_CartItem"); - - migrationBuilder.DropTable( - name: "Tax_TaxRate"); - - migrationBuilder.DropTable( - name: "WishList_WishListItem"); - - migrationBuilder.DropTable( - name: "ActivityLog_ActivityType"); - - migrationBuilder.DropTable( - name: "Catalog_ProductOption"); - - migrationBuilder.DropTable( - name: "Catalog_ProductAttribute"); - - migrationBuilder.DropTable( - name: "Catalog_ProductTemplate"); - - migrationBuilder.DropTable( - name: "Cms_Menu"); - - migrationBuilder.DropTable( - name: "Core_Entity"); - - migrationBuilder.DropTable( - name: "Contacts_ContactArea"); - - migrationBuilder.DropTable( - name: "Core_Role"); - - migrationBuilder.DropTable( - name: "Core_Widget"); - - migrationBuilder.DropTable( - name: "Core_WidgetZone"); - - migrationBuilder.DropTable( - name: "Localization_Culture"); - - migrationBuilder.DropTable( - name: "News_NewsCategory"); - - migrationBuilder.DropTable( - name: "News_NewsItem"); - - migrationBuilder.DropTable( - name: "Catalog_Category"); - - migrationBuilder.DropTable( - name: "Pricing_Coupon"); - - migrationBuilder.DropTable( - name: "Core_CustomerGroup"); - - migrationBuilder.DropTable( - name: "Pricing_CatalogRule"); - - migrationBuilder.DropTable( - name: "Reviews_Review"); - - migrationBuilder.DropTable( - name: "Shipments_Shipment"); - - migrationBuilder.DropTable( - name: "ShoppingCart_Cart"); - - migrationBuilder.DropTable( - name: "Catalog_Product"); - - migrationBuilder.DropTable( - name: "WishList_WishList"); - - migrationBuilder.DropTable( - name: "Catalog_ProductAttributeGroup"); - - migrationBuilder.DropTable( - name: "Core_EntityType"); - - migrationBuilder.DropTable( - name: "Pricing_CartRule"); - - migrationBuilder.DropTable( - name: "Inventory_Warehouse"); - - migrationBuilder.DropTable( - name: "Orders_Order"); - - migrationBuilder.DropTable( - name: "Catalog_Brand"); - - migrationBuilder.DropTable( - name: "Core_Media"); - - migrationBuilder.DropTable( - name: "Tax_TaxClass"); - - migrationBuilder.DropTable( - name: "Orders_OrderAddress"); - - migrationBuilder.DropTable( - name: "Core_User"); - - migrationBuilder.DropTable( - name: "Core_UserAddress"); - - migrationBuilder.DropTable( - name: "Core_Vendor"); - - migrationBuilder.DropTable( - name: "Core_Address"); - - migrationBuilder.DropTable( - name: "Core_District"); - - migrationBuilder.DropTable( - name: "Core_StateOrProvince"); - - migrationBuilder.DropTable( - name: "Core_Country"); - } - } -}