mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
Migration can be null
This commit is contained in:
parent
7ad73df170
commit
a0d23046bf
@ -269,7 +269,7 @@ async function main() {
|
||||
if (config().database.autoMigration) {
|
||||
appLogger().info('Auto-migrating database...');
|
||||
await migrateLatest(ctx.joplinBase.db);
|
||||
appLogger().info('Latest migration:', (await latestMigration(ctx.joplinBase.db)).name);
|
||||
appLogger().info('Latest migration:', await latestMigration(ctx.joplinBase.db));
|
||||
} else {
|
||||
appLogger().info('Skipped database auto-migration.');
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ export function isUniqueConstraintError(error: any): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function latestMigration(db: DbConnection): Promise<Migration> {
|
||||
export async function latestMigration(db: DbConnection): Promise<Migration | null> {
|
||||
try {
|
||||
const result = await db('knex_migrations').select('name').orderBy('id', 'desc').first();
|
||||
return { name: result.name, done: true };
|
||||
|
Loading…
Reference in New Issue
Block a user