Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

clean-up migrate data param

Francis Cao1bb33f7afff5
diff --git a/scripts/migrate-db.js b/scripts/migrate-db.js
index 88e5336f8..a41b49412 100644
--- a/scripts/migrate-db.js
+++ b/scripts/migrate-db.js
@@ -76,7 +76,6 @@ async function checkV2Tables() {
// run v2 prisma migration steps
await runSqlFile('../prisma/migrations/01_init/migration.sql');
console.log(execSync('prisma migrate resolve --applied 01_init').toString());
- // console.log(execSync('prisma migrate deploy').toString());
}
}
@@ -91,8 +90,8 @@ async function checkMigrationReady() {
}
}
-async function migrateData(databaseType) {
- const filePath = `../db/${databaseType}/migration_v2.sql`;
+async function migrateData() {
+ const filePath = `../prisma/migration_v2.sql`;
console.log('Starting v2 data migration. Please do no cancel this process, it may take a while.');
await runSqlFile(filePath);
@@ -264,7 +263,7 @@ async function runSqlFile(filePath) {
deleteV1TablesPrompt,
]) {
try {
- ['checkV1Tables', 'migrateData'].includes(fn.name) ? await fn(databaseType) : await fn();
+ fn.name === 'checkV1Tables' ? await fn(databaseType) : await fn();
} catch (e) {
error(e.message);
err = true;