mirror of
https://github.com/immich-app/immich.git
synced 2026-03-03 02:57:01 +00:00
* feat: SyncAssetV2 * feat: mobile sync handling * feat: request correct sync object based on server version * fix: mobile queries * chore: sync sql * fix: test * chore: switch to mapper * fix: sql sync
38 lines
1.3 KiB
Dart
38 lines
1.3 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()();
|
|
|
|
BoolColumn get isVisible => boolean().withDefault(const Constant(true))();
|
|
|
|
DateTimeColumn get deletedAt => dateTime().nullable()();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {id};
|
|
}
|