clean-up migrate data param

This commit is contained in:
Francis Cao 2023-01-16 12:14:50 -08:00
parent aba5b9362e
commit 1bb33f7aff

View File

@ -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;