diff --git a/util/src/migrations/migrate_db_engine.ts b/util/src/migrations/migrate_db_engine.ts
index 527e7b53..886a16a0 100644
--- a/util/src/migrations/migrate_db_engine.ts
+++ b/util/src/migrations/migrate_db_engine.ts
@@ -1,6 +1,6 @@
import { config } from "dotenv";
config();
-import { BaseEntity, createConnection, EntityTarget } from "typeorm";
+import { createConnection, EntityTarget } from "typeorm";
import { initDatabase } from "../util/Database";
import "missing-native-js-functions";
import {
@@ -31,7 +31,7 @@ import {
async function main() {
if (!process.env.TO) throw new Error("TO database env connection string not set");
- // manually arrange them because of foreign key
+ // manually arrange them because of foreign keys
const entities = [
User,
Guild,
@@ -56,7 +56,7 @@ async function main() {
Attachment,
];
- const newDB = await initDatabase();
+ const oldDB = await initDatabase();
const type = process.env.TO.includes("://") ? process.env.TO.split(":")[0]?.replace("+srv", "") : "sqlite";
const isSqlite = type.includes("sqlite");
@@ -75,6 +75,7 @@ async function main() {
for (const e of entities) {
const entity = e as EntityTarget<any>;
const entries = await oldDB.manager.find(entity);
+
// @ts-ignore
console.log("migrating " + entries.length + " " + entity.name + " ...");
@@ -117,6 +118,7 @@ async function main() {
// await newDB.manager.update(entity, { id: entry.id }, entry);
// }
}
+
// @ts-ignore
console.log("migrated " + entries.length + " " + entity.name);
}
|