Add ability to migrate from MySQL and SQLite with EF (#4614)

This commit is contained in:
Nicolas Dorier
2023-02-10 11:43:46 +09:00
committed by GitHub
parent 753ffd401b
commit 1f8bc5b490
7 changed files with 335 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Data.Data;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
@@ -31,6 +32,11 @@ namespace BTCPayServer.Data
_designTime = designTime;
}
public async Task<string?> GetMigrationState()
{
return (await Settings.FromSqlRaw("SELECT \"Id\", \"Value\" FROM \"Settings\" WHERE \"Id\"='MigrationData'").AsNoTracking().FirstOrDefaultAsync())?.Value;
}
public DbSet<AddressInvoiceData> AddressInvoices { get; set; }
public DbSet<APIKeyData> ApiKeys { get; set; }
public DbSet<AppData> Apps { get; set; }