mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Remove only dependency on Dbriize (TextSearch in new invoice column) (#2029)
* Remove only dependency on Dbriize (TextSearch in new invoice column) * Switch to table for invoice text search * Adding missing using after rebase * Removing database migration in preparation for refresh * Database Migration: Adding InvoiceSearchData * Refactoring InvoicesRepository to make AddToTextSearch static and non-async Operation as async is too expensive for simple filtering and AddRange * Renaming InvoiceQuery property to Take More inline with what property does by convention, Take is used in conjuction with Skip * Refactoring SettingsRepository so update of settings can happen in another context * Adding DbMigrationsHostedService that performs long running data migrations * Commenting special placing of MigrationStartupTask * Simplifying code and leaving comment on expected flow * Resolving problems after merge * Database Migration: Refreshing database migration, ensuring no unintended changes on ModelSnapshot Co-authored-by: rockstardev <rockstardev@users.noreply.github.com> Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Client.Models;
|
||||
using BTCPayServer.Configuration;
|
||||
using BTCPayServer.Data;
|
||||
using BTCPayServer.Logging;
|
||||
using BTCPayServer.Services;
|
||||
using BTCPayServer.Services.Stores;
|
||||
using DBriize;
|
||||
using DBriize.Utils;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NBitcoin.DataEncoders;
|
||||
|
||||
namespace BTCPayServer.Hosting
|
||||
{
|
||||
@@ -20,18 +27,21 @@ namespace BTCPayServer.Hosting
|
||||
private readonly StoreRepository _StoreRepository;
|
||||
private readonly BTCPayNetworkProvider _NetworkProvider;
|
||||
private readonly SettingsRepository _Settings;
|
||||
private readonly BTCPayServerOptions _btcPayServerOptions;
|
||||
private readonly UserManager<ApplicationUser> _userManager;
|
||||
public MigrationStartupTask(
|
||||
BTCPayNetworkProvider networkProvider,
|
||||
StoreRepository storeRepository,
|
||||
ApplicationDbContextFactory dbContextFactory,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
SettingsRepository settingsRepository)
|
||||
SettingsRepository settingsRepository,
|
||||
BTCPayServerOptions btcPayServerOptions)
|
||||
{
|
||||
_DBContextFactory = dbContextFactory;
|
||||
_StoreRepository = storeRepository;
|
||||
_NetworkProvider = networkProvider;
|
||||
_Settings = settingsRepository;
|
||||
_btcPayServerOptions = btcPayServerOptions;
|
||||
_userManager = userManager;
|
||||
}
|
||||
public async Task ExecuteAsync(CancellationToken cancellationToken = default)
|
||||
|
||||
Reference in New Issue
Block a user