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