clean-up migrate data param
parent
aba5b9362e
commit
1bb33f7aff
|
@ -76,7 +76,6 @@ async function checkV2Tables() {
|
||||||
// run v2 prisma migration steps
|
// run v2 prisma migration steps
|
||||||
await runSqlFile('../prisma/migrations/01_init/migration.sql');
|
await runSqlFile('../prisma/migrations/01_init/migration.sql');
|
||||||
console.log(execSync('prisma migrate resolve --applied 01_init').toString());
|
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) {
|
async function migrateData() {
|
||||||
const filePath = `../db/${databaseType}/migration_v2.sql`;
|
const filePath = `../prisma/migration_v2.sql`;
|
||||||
console.log('Starting v2 data migration. Please do no cancel this process, it may take a while.');
|
console.log('Starting v2 data migration. Please do no cancel this process, it may take a while.');
|
||||||
await runSqlFile(filePath);
|
await runSqlFile(filePath);
|
||||||
|
|
||||||
|
@ -264,7 +263,7 @@ async function runSqlFile(filePath) {
|
||||||
deleteV1TablesPrompt,
|
deleteV1TablesPrompt,
|
||||||
]) {
|
]) {
|
||||||
try {
|
try {
|
||||||
['checkV1Tables', 'migrateData'].includes(fn.name) ? await fn(databaseType) : await fn();
|
fn.name === 'checkV1Tables' ? await fn(databaseType) : await fn();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error(e.message);
|
error(e.message);
|
||||||
err = true;
|
err = true;
|
||||||
|
|
Loading…
Reference in New Issue