Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Mobile App CI / test (push) Waiting to run
Mobile App CI / build-android (push) Blocked by required conditions
Mobile App CI / build-ios (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Telegram Bot / Deploy Telegram Bot (push) Waiting to run
28 lines
1.1 KiB
Dart
28 lines
1.1 KiB
Dart
import 'package:drift/drift.dart';
|
|
import 'users.dart';
|
|
import '../converters.dart' show generateUuid;
|
|
|
|
/// Таблица StudySessions - сессии изучения
|
|
class StudySessions extends Table {
|
|
TextColumn get id => text().withDefault(const Constant('gen_random_uuid()'))();
|
|
TextColumn get userId => text().references(Users, #id, onDelete: KeyAction.cascade)();
|
|
|
|
TextColumn get sessionId => text().nullable().unique()();
|
|
|
|
DateTimeColumn get startTime => dateTime()();
|
|
DateTimeColumn get endTime => dateTime().nullable()();
|
|
|
|
IntColumn get wordsLearned => integer().withDefault(const Constant(0))();
|
|
IntColumn get testsCompleted => integer().withDefault(const Constant(0))();
|
|
RealColumn get accuracy => real().withDefault(const Constant(0.0))();
|
|
|
|
TextColumn get packId => text().nullable()();
|
|
TextColumn get testId => text().nullable()();
|
|
|
|
// Audit
|
|
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {id};
|
|
}
|