Updated database reset script to work from any directory.

This commit is contained in:
Harrison Deng 2021-05-26 15:12:30 -05:00
parent f459cbdfda
commit 3611e4be34

View File

@ -1,13 +1,16 @@
import os import os
import shutil import shutil
SERVER_DIR = "../src/MultiShop/Server"
SERVER_DIR = "src/MultiShop/Server"
DATA_DIR = "Data" DATA_DIR = "Data"
DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}" DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}"
DB_UPDATE_CMD = "dotnet ef database update" DB_UPDATE_CMD = "dotnet ef database update"
print("Changing to database migrations directory.") os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir("..")
os.chdir(SERVER_DIR) os.chdir(SERVER_DIR)
print("Working in: " + os.getcwd())
migrationsDir = os.path.join(DATA_DIR, "Migrations") migrationsDir = os.path.join(DATA_DIR, "Migrations")