Ensure existence of DB

This commit is contained in:
Basique Evangelist 2019-06-07 18:37:11 +03:00
parent 28bca4832d
commit e4923e4d79
Signed by untrusted user: BasiqueEvangelist
GPG Key ID: B370219149301706
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ namespace JetKarmaBot
public async Task Init()
{
using (KarmaContext db = Db.GetContext())
await db.Database.EnsureCreatedAsync();
var httpProxy = new WebProxy($"{Config.Proxy.Url}:{Config.Proxy.Port}")
{
Credentials = new NetworkCredential(Config.Proxy.Login, Config.Proxy.Password)

View File

@ -69,7 +69,7 @@ namespace JetKarmaBot.Models
entity.Property(e => e.Date)
.HasColumnName("date")
.HasColumnType("datetime")
.HasDefaultValueSql("'CURRENT_TIMESTAMP'");
.HasDefaultValueSql("CURRENT_TIMESTAMP");
entity.Property(e => e.FromId)
.HasColumnName("fromid")