This commit is contained in:
callebtc
2022-09-19 00:27:00 +03:00
parent 088a0bc29f
commit afce11686c
3 changed files with 12 additions and 14 deletions

View File

@@ -123,18 +123,13 @@ class Database(Compat):
)
)
else:
if os.path.isdir(self.db_location):
self.path = os.path.join(self.db_location, f"{self.name}.sqlite3")
database_uri = f"sqlite:///{self.path}"
self.type = SQLITE
else:
if not os.path.exists(self.db_location):
print(f"Creating database directory: {self.db_location}")
if not os.path.exists(self.db_location):
os.makedirs(self.db_location)
# raise NotADirectoryError(
# f"db_location named {self.db_location} was not created"
# f" - please 'mkdir {self.db_location}' and try again"
# )
os.makedirs(self.db_location)
self.path = os.path.join(self.db_location, f"{self.name}.sqlite3")
database_uri = f"sqlite:///{self.path}"
self.type = SQLITE
self.schema = self.name
if self.name.startswith("ext_"):
self.schema = self.name[4:]