Change some table type from TEXT to JSONB (#4371)

* Change some table type from TEXT to JSONB

* Deprecate mysql and sqlite backend
This commit is contained in:
Nicolas Dorier
2022-11-28 20:36:18 +09:00
committed by GitHub
parent 84132e794a
commit 08b239e87a
8 changed files with 68 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace BTCPayServer.Data
{
public class SettingData
@@ -5,5 +8,15 @@ namespace BTCPayServer.Data
public string Id { get; set; }
public string Value { get; set; }
public static void OnModelCreating(ModelBuilder builder, DatabaseFacade databaseFacade)
{
if (databaseFacade.IsNpgsql())
{
builder.Entity<SettingData>()
.Property(o => o.Value)
.HasColumnType("JSONB");
}
}
}
}