restart schema with clean database
This commit is contained in:
parent
f78097b616
commit
5701313228
35 changed files with 95 additions and 2517 deletions
|
@ -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`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue