Revert "feat: write migrations"
Some checks failed
Release / build (ubuntu-latest) (push) Has been cancelled
Release / build (windows-latest) (push) Has been cancelled

This reverts commit 81aa25fa52.
This commit is contained in:
Zamitto 2024-08-23 00:07:50 -03:00
parent 81aa25fa52
commit 5fcca9888d
12 changed files with 93 additions and 270 deletions

View file

@ -9,7 +9,6 @@ import { logger, PythonInstance, WindowManager } from "@main/services";
import { dataSource } from "@main/data-source";
import * as resources from "@locales";
import { userPreferencesRepository } from "@main/repository";
import { knexClient, migrationConfig } from "./knex";
const { autoUpdater } = updater;
@ -64,22 +63,8 @@ app.whenReady().then(async () => {
return net.fetch(url.pathToFileURL(decodeURI(filePath)).toString());
});
await knexClient.migrate.list(migrationConfig).then((result) => {
console.log("Migrations to run:", result[1]);
});
await knexClient.migrate
.latest(migrationConfig)
.then(() => {
console.log("Migrations executed successfully");
})
.catch((err) => {
console.log("Migrations failed to run:", err);
});
await knexClient.destroy();
await dataSource.initialize();
await dataSource.runMigrations();
await import("./main");