mirror of
https://github.com/immich-app/immich.git
synced 2026-02-16 00:09:42 -05: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>
34 lines
1.2 KiB
Dart
34 lines
1.2 KiB
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/person.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|
|
|
@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)')
|
|
@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)')
|
|
class AssetFaceEntity extends Table with DriftDefaultsMixin {
|
|
const AssetFaceEntity();
|
|
|
|
TextColumn get id => text()();
|
|
|
|
TextColumn get assetId => text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
TextColumn get personId => text().nullable().references(PersonEntity, #id, onDelete: KeyAction.setNull)();
|
|
|
|
IntColumn get imageWidth => integer()();
|
|
|
|
IntColumn get imageHeight => integer()();
|
|
|
|
IntColumn get boundingBoxX1 => integer()();
|
|
|
|
IntColumn get boundingBoxY1 => integer()();
|
|
|
|
IntColumn get boundingBoxX2 => integer()();
|
|
|
|
IntColumn get boundingBoxY2 => integer()();
|
|
|
|
TextColumn get sourceType => text()();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {id};
|
|
}
|