Files
nadekobot/src/NadekoBot/Db/PostgreSqlContext.cs

26 lines
695 B
C#

using Microsoft.EntityFrameworkCore;
namespace NadekoBot.Services.Database;
public sealed class PostgreSqlContext : NadekoContext
{
private readonly string _connStr;
protected override string CurrencyTransactionOtherIdDefaultValue
=> "NULL";
public PostgreSqlContext(string connStr = "Host=localhost")
{
_connStr = connStr;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
base.OnConfiguring(optionsBuilder);
optionsBuilder
.UseLowerCaseNamingConvention()
.UseNpgsql(_connStr);
}
}