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...');
|
||||
const results = await migrator.migrateToLatest();
|
||||
console.warn('Running migrations...');
|
||||
const { results, error } = await migrator.migrateToLatest();
|
||||
|
||||
if (results.error) {
|
||||
console.error(results.error);
|
||||
if (error) {
|
||||
console.error(error);
|
||||
Deno.exit(1);
|
||||
} else {
|
||||
if (!results.results?.length) {
|
||||
console.info('Everything up-to-date.');
|
||||
if (!results?.length) {
|
||||
console.warn('Everything up-to-date.');
|
||||
} else {
|
||||
console.info('Migrations finished!');
|
||||
for (const { migrationName, status } of results.results!) {
|
||||
console.info(` - ${migrationName}: ${status}`);
|
||||
console.warn('Migrations finished!');
|
||||
for (const { migrationName, status } of results!) {
|
||||
console.warn(` - ${migrationName}: ${status}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue