Make DatabaseFacts migrate database before running

This commit is contained in:
jvyden 2021-10-18 22:45:57 -04:00
parent d6b141d1f0
commit ba85c28041
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,4 @@
using Microsoft.EntityFrameworkCore;
using ProjectLighthouse.Types;
using Xunit;
@ -6,6 +7,10 @@ namespace ProjectLighthouse.Tests {
public DatabaseFact() {
ServerSettings.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
if(!ServerSettings.DbConnected) Skip = "Database not available";
else {
using Database database = new();
database.Database.Migrate();
}
}
}
}