-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue-5312-Import-customers' into develop
# Conflicts: # src/Libraries/Nop.Core/Domain/Security/SecuritySettings.cs # src/Libraries/Nop.Services/ExportImport/ExportManager.cs # src/Libraries/Nop.Services/ExportImport/ImportManager.cs # src/Libraries/Nop.Services/Installation/InstallationService.cs # src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo470/LocalizationMigration.cs # src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo470/SettingMigration.cs # src/Presentation/Nop.Web/Areas/Admin/Controllers/CustomerController.cs
- Loading branch information
Showing
11 changed files
with
453 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Libraries/Nop.Data/Migrations/UpgradeTo470/DataMigration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using FluentMigrator; | ||
using Nop.Core.Domain.Logging; | ||
|
||
namespace Nop.Data.Migrations.UpgradeTo470 | ||
{ | ||
[NopMigration("2023-01-01 00:00:00", "4.70.0", UpdateMigrationType.Data, MigrationProcessType.Update)] | ||
public class DataMigration : Migration | ||
{ | ||
private readonly INopDataProvider _dataProvider; | ||
|
||
public DataMigration(INopDataProvider dataProvider) | ||
{ | ||
_dataProvider = dataProvider; | ||
} | ||
|
||
/// <summary> | ||
/// Collect the UP migration expressions | ||
/// </summary> | ||
public override void Up() | ||
{ | ||
//#5312 new activity log type | ||
var activityLogTypeTable = _dataProvider.GetTable<ActivityLogType>(); | ||
|
||
if (!activityLogTypeTable.Any(alt => string.Compare(alt.SystemKeyword, "ImportCustomers", StringComparison.InvariantCultureIgnoreCase) == 0)) | ||
_dataProvider.InsertEntity( | ||
new ActivityLogType | ||
{ | ||
SystemKeyword = "ImportCustomers", | ||
Enabled = true, | ||
Name = "Customers were imported" | ||
} | ||
); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
//add the downgrade logic if necessary | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.