From c46f723631a32c0a556dd9ac741dd661b1ab0e5b Mon Sep 17 00:00:00 2001 From: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:45:45 +0530 Subject: [PATCH] reset asset sync entity on mobile and server --- mobile/lib/utils/migration.dart | 7 ++++++- .../src/schema/migrations/1769598833536-ResetAssetSync.ts | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 server/src/schema/migrations/1769598833536-ResetAssetSync.ts diff --git a/mobile/lib/utils/migration.dart b/mobile/lib/utils/migration.dart index 3d9a22cea8..ec7a8f23ff 100644 --- a/mobile/lib/utils/migration.dart +++ b/mobile/lib/utils/migration.dart @@ -92,7 +92,12 @@ Future migrateDatabaseIfNeeded(Isar db, Drift drift) async { } if (version < 21) { - await _addSyncEntityReset([SyncEntityType.assetExifV1]); + await _addSyncEntityReset([ + SyncEntityType.assetV1, + SyncEntityType.partnerAssetV1, + SyncEntityType.albumAssetCreateV1, + SyncEntityType.albumAssetUpdateV1, + ]); } if (targetVersion >= 12) { diff --git a/server/src/schema/migrations/1769598833536-ResetAssetSync.ts b/server/src/schema/migrations/1769598833536-ResetAssetSync.ts new file mode 100644 index 0000000000..cc7347695b --- /dev/null +++ b/server/src/schema/migrations/1769598833536-ResetAssetSync.ts @@ -0,0 +1,7 @@ +import { Kysely, sql } from 'kysely'; + +export async function up(db: Kysely): Promise { + await sql`DELETE FROM session_sync_checkpoint WHERE type IN ('AssetV1', 'PartnerAssetV1', 'AlbumAssetCreateV1', 'AlbumAssetUpdateV1')`.execute(db); +} + +export async function down(): Promise {}