mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
79fccdbee0
* refactor: yank old timeline # Conflicts: # mobile/lib/presentation/pages/editing/drift_edit.page.dart # mobile/lib/providers/websocket.provider.dart # mobile/lib/routing/router.dart * more cleanup * remove native code * chore: bump sqlite-data version * remove old background tasks from BGTaskSchedulerPermittedIdentifiers * rebase --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
27 lines
967 B
Dart
27 lines
967 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:drift_flutter/drift_flutter.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/log.entity.dart';
|
|
import 'package:immich_mobile/infrastructure/repositories/logger_db.repository.drift.dart';
|
|
|
|
@DriftDatabase(tables: [LogMessageEntity])
|
|
class DriftLogger extends $DriftLogger {
|
|
DriftLogger([QueryExecutor? executor])
|
|
: super(
|
|
executor ?? driftDatabase(name: 'immich_logs', native: const DriftNativeOptions(shareAcrossIsolates: true)),
|
|
);
|
|
|
|
@override
|
|
int get schemaVersion => 1;
|
|
|
|
@override
|
|
MigrationStrategy get migration => MigrationStrategy(
|
|
beforeOpen: (details) async {
|
|
await customStatement('PRAGMA foreign_keys = ON');
|
|
await customStatement('PRAGMA synchronous = NORMAL');
|
|
await customStatement('PRAGMA journal_mode = WAL');
|
|
await customStatement('PRAGMA busy_timeout = 500');
|
|
await customStatement('PRAGMA temp_store = MEMORY');
|
|
},
|
|
);
|
|
}
|