Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mobile/drift_schemas/main/drift_schema_v15.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import 'package:immich_mobile/infrastructure/entities/trashed_local_asset.entity
import 'package:immich_mobile/infrastructure/utils/asset.mixin.dart';
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';

enum TrashOrigin {
// do not change this order!
localSync,
remoteSync,
localUser,
}

@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)')
@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)')
class TrashedLocalAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin {
Expand All @@ -19,6 +26,8 @@ class TrashedLocalAssetEntity extends Table with DriftDefaultsMixin, AssetEntity

IntColumn get orientation => integer().withDefault(const Constant(0))();

IntColumn get source => intEnum<TrashOrigin>()();

@override
Set<Column> get primaryKey => {id, albumId};
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion mobile/lib/infrastructure/repositories/db.repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Drift extends $Drift implements IDatabaseRepository {
}

@override
int get schemaVersion => 14;
int get schemaVersion => 15;

@override
MigrationStrategy get migration => MigrationStrategy(
Expand Down Expand Up @@ -190,6 +190,9 @@ class Drift extends $Drift implements IDatabaseRepository {
await m.addColumn(v14.localAssetEntity, v14.localAssetEntity.latitude);
await m.addColumn(v14.localAssetEntity, v14.localAssetEntity.longitude);
},
from14To15: (m, v15) async {
await m.addColumn(v15.trashedLocalAssetEntity, v15.trashedLocalAssetEntity.source);
},
),
);

Expand Down
Loading
Loading