datenbank nur auf testserver automatisch updaten
This commit is contained in:
@@ -43,6 +43,9 @@ namespace ReallifeGamemode.Server
|
|||||||
|
|
||||||
[ServerEvent(Event.ResourceStart)]
|
[ServerEvent(Event.ResourceStart)]
|
||||||
public void OnResourceStart()
|
public void OnResourceStart()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (System.Environment.GetEnvironmentVariable("RAGEMP_UPDATE_DATABASE_ON_STARTUP", System.EnvironmentVariableTarget.User) == "true")
|
||||||
{
|
{
|
||||||
using var dbContext = new DatabaseContext(true);
|
using var dbContext = new DatabaseContext(true);
|
||||||
|
|
||||||
@@ -73,6 +76,7 @@ namespace ReallifeGamemode.Server
|
|||||||
|
|
||||||
System.Console.WriteLine("Migrations successfull");
|
System.Console.WriteLine("Migrations successfull");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var methods = Assembly.GetExecutingAssembly()
|
var methods = Assembly.GetExecutingAssembly()
|
||||||
.GetTypes()
|
.GetTypes()
|
||||||
|
|||||||
Reference in New Issue
Block a user