* 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
20 lines
544 B
Dart
20 lines
544 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/data/db/util/datetime_clamp_type.dart';
|
|
import 'package:immich_mobile/data/db/util/defaults_mixin.dart';
|
|
|
|
class SettingsEntity extends Table with DriftDefaultsMixin {
|
|
const SettingsEntity();
|
|
|
|
TextColumn get key => text()();
|
|
|
|
TextColumn get value => text().nullable()();
|
|
|
|
DateTimeColumn get updatedAt => customType(clampedDateTime).withDefault(currentDateAndTime)();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {key};
|
|
|
|
@override
|
|
String get tableName => "settings";
|
|
}
|