mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
32 lines
1.1 KiB
Dart
32 lines
1.1 KiB
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/utils/datetime_clamp.type.dart';
|
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|
|
|
@TableIndex.sql('CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)')
|
|
class PersonEntity extends Table with DriftDefaultsMixin {
|
|
const PersonEntity();
|
|
|
|
TextColumn get id => text()();
|
|
|
|
DateTimeColumn get createdAt => customType(clampedDateTime).withDefault(currentDateAndTime)();
|
|
|
|
DateTimeColumn get updatedAt => customType(clampedDateTime).withDefault(currentDateAndTime)();
|
|
|
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
|
|
TextColumn get name => text()();
|
|
|
|
TextColumn get faceAssetId => text().nullable()();
|
|
|
|
BoolColumn get isFavorite => boolean()();
|
|
|
|
BoolColumn get isHidden => boolean()();
|
|
|
|
TextColumn get color => text().nullable()();
|
|
|
|
DateTimeColumn get birthDate => customType(clampedDateTime).nullable()();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {id};
|
|
}
|