mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-22 03:37:25 +08:00
Adding migration steps for Orchard.Indexing and Orchard.Search
--HG-- branch : 1.x
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Data;
|
||||
using Orchard.Data.Migration;
|
||||
using Orchard.Search.Models;
|
||||
|
||||
namespace Orchard.Search {
|
||||
public class SearchDataMigration : DataMigrationImpl {
|
||||
private readonly IRepository<SearchSettingsPartRecord> _searchSettingsPartRecordRepository;
|
||||
|
||||
public SearchDataMigration(IRepository<SearchSettingsPartRecord> searchSettingsPartRecordRepository) {
|
||||
_searchSettingsPartRecordRepository = searchSettingsPartRecordRepository;
|
||||
}
|
||||
|
||||
public int Create() {
|
||||
|
||||
@@ -29,6 +37,11 @@ namespace Orchard.Search {
|
||||
.AddColumn<string>("SearchIndex")
|
||||
);
|
||||
|
||||
var settings = _searchSettingsPartRecordRepository.Table.FirstOrDefault();
|
||||
if (settings != null) {
|
||||
settings.SearchIndex = "Search";
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user