Skip to content

High performance self-hosted photo and video management solution.

fix: migration on trash source column (#25590)

shenlong46d2238431ea
diff --git a/mobile/lib/infrastructure/repositories/db.repository.dart b/mobile/lib/infrastructure/repositories/db.repository.dart
index e0e29e8290..2d30e3a0b9 100644
--- a/mobile/lib/infrastructure/repositories/db.repository.dart
+++ b/mobile/lib/infrastructure/repositories/db.repository.dart
@@ -193,7 +193,13 @@ class Drift extends $Drift implements IDatabaseRepository {
await m.addColumn(v14.localAssetEntity, v14.localAssetEntity.longitude);
},
from14To15: (m, v15) async {
- await m.addColumn(v15.trashedLocalAssetEntity, v15.trashedLocalAssetEntity.source);
+ await m.alterTable(
+ TableMigration(
+ v15.trashedLocalAssetEntity,
+ columnTransformer: {v15.trashedLocalAssetEntity.source: Constant(TrashOrigin.localSync.index)},
+ newColumns: [v15.trashedLocalAssetEntity.source],
+ ),
+ );
},
from15To16: (m, v16) async {
// Add i_cloud_id to local and remote asset tables