restart schema with clean database

This commit is contained in:
Julian Krauser 2025-01-29 18:10:41 +01:00
parent f78097b616
commit 5701313228
35 changed files with 95 additions and 2517 deletions

View file

@ -21,7 +21,7 @@ declare global {
import { dataSource } from "./data-source";
import BackupHelper from "./helpers/backupHelper";
dataSource.initialize().then(async () => {
if ((BACKUP_AUTO_RESTORE as "true" | "false") == "true") {
if ((BACKUP_AUTO_RESTORE as "true" | "false") == "true" && (await dataSource.createQueryRunner().hasTable("user"))) {
await BackupHelper.autoRestoreBackup().catch((err) => {
console.log(`${new Date().toISOString()}: failed auto-restoring database`);
});