Files
stream-chat-flutter/packages/stream_chat_persistence/lib/src/entity/reads.dart
T
2021-01-28 19:48:54 +05:30

25 lines
644 B
Dart

import 'package:moor/moor.dart';
/// Represents a [Reads] table in [MoorChatDatabase].
@DataClassName('ReadEntity')
class Reads extends Table {
/// Date of the read event
DateTimeColumn get lastRead => dateTime()();
/// Id of the User who sent the event
TextColumn get userId => text()();
/// The channel cid of which this read belongs
TextColumn get channelCid =>
text().customConstraint('REFERENCES channels(cid) ON DELETE CASCADE')();
/// Number of unread messages
IntColumn get unreadMessages => integer().nullable()();
@override
Set<Column> get primaryKey => {
userId,
channelCid,
};
}