mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Rework migrations logging
This commit is contained in:
parent
975294b8a4
commit
44a61c4a52
1 changed files with 9 additions and 9 deletions
|
|
@ -62,19 +62,19 @@ export class DittoDB {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.info('Running migrations...');
|
console.warn('Running migrations...');
|
||||||
const results = await migrator.migrateToLatest();
|
const { results, error } = await migrator.migrateToLatest();
|
||||||
|
|
||||||
if (results.error) {
|
if (error) {
|
||||||
console.error(results.error);
|
console.error(error);
|
||||||
Deno.exit(1);
|
Deno.exit(1);
|
||||||
} else {
|
} else {
|
||||||
if (!results.results?.length) {
|
if (!results?.length) {
|
||||||
console.info('Everything up-to-date.');
|
console.warn('Everything up-to-date.');
|
||||||
} else {
|
} else {
|
||||||
console.info('Migrations finished!');
|
console.warn('Migrations finished!');
|
||||||
for (const { migrationName, status } of results.results!) {
|
for (const { migrationName, status } of results!) {
|
||||||
console.info(` - ${migrationName}: ${status}`);
|
console.warn(` - ${migrationName}: ${status}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue