Files
Immich/mobile/lib/data/db/main/table/user/user.dart
T
Santo ShakilandGitHub 909b8aac93 fix(mobile): clamp out of range datetimes so timeline queries cannot crash (#30490)
* fix(mobile): clamp out of range datetimes so timeline queries cannot crash

* replace the per column converters with a clamping custom type

* heal each table in one statement, rename the clamp type, read dates as stored

* one medium test for the clamp, drop the dart side bounds, private clamp type
2026-09-18 17:41:15 +00:00

21 lines
777 B
Dart

import 'package:drift/drift.dart' hide Index;
import 'package:immich_mobile/data/db/util/datetime_clamp_type.dart';
import 'package:immich_mobile/data/db/util/defaults_mixin.dart';
import 'package:immich_mobile/domain/models/user.model.dart';
class UserEntity extends Table with DriftDefaultsMixin {
const UserEntity();
TextColumn get id => text()();
TextColumn get name => text()();
TextColumn get email => text()();
// Profile image
BoolColumn get hasProfileImage => boolean().withDefault(const Constant(false))();
DateTimeColumn get profileChangedAt => customType(clampedDateTime).withDefault(currentDateAndTime)();
IntColumn get avatarColor => intEnum<AvatarColor>().withDefault(const Constant(0))();
@override
Set<Column> get primaryKey => {id};
}