[StreamChatPersistence] Add initial implementation
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:moor/moor.dart';
|
||||
import 'package:stream_chat_persistence/src/converter/map_converter.dart';
|
||||
|
||||
@DataClassName('ReactionEntity')
|
||||
class Reactions extends Table {
|
||||
TextColumn get userId => text()();
|
||||
|
||||
TextColumn get messageId =>
|
||||
text().customConstraint('REFERENCES messages(id) ON DELETE CASCADE')();
|
||||
|
||||
TextColumn get type => text()();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime()();
|
||||
|
||||
IntColumn get score => integer().nullable()();
|
||||
|
||||
TextColumn get extraData => text().nullable().map(MapConverter<Object>())();
|
||||
|
||||
@override
|
||||
Set<Column> get primaryKey => {
|
||||
messageId,
|
||||
type,
|
||||
userId,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user