mirror of
https://github.com/immich-app/immich.git
synced 2026-02-13 20:37:51 +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>
18 lines
735 B
Dart
18 lines
735 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|
|
|
@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)')
|
|
class PartnerEntity extends Table with DriftDefaultsMixin {
|
|
const PartnerEntity();
|
|
|
|
TextColumn get sharedById => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
TextColumn get sharedWithId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
BoolColumn get inTimeline => boolean().withDefault(const Constant(false))();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {sharedById, sharedWithId};
|
|
}
|