mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 17:49:05 +03:00
* chore: add indexes for foreign keys * update idx_asset_face_person_id index --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
22 lines
860 B
Dart
22 lines
860 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/local_album.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/local_asset.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|
|
|
@TableIndex.sql(
|
|
'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)',
|
|
)
|
|
class LocalAlbumAssetEntity extends Table with DriftDefaultsMixin {
|
|
const LocalAlbumAssetEntity();
|
|
|
|
TextColumn get assetId => text().references(LocalAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
TextColumn get albumId => text().references(LocalAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
// Used for mark & sweep
|
|
BoolColumn get marker_ => boolean().nullable()();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {assetId, albumId};
|
|
}
|