update DriftChatDatabase version.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-04-20 19:05:54 +05:30
committed by xsahil03x
parent fc05a9a4cf
commit 3b0cc225eb
10 changed files with 52 additions and 11 deletions
@@ -1,5 +1,6 @@
// coverage:ignore-file
import 'package:drift/drift.dart';
import 'package:stream_chat_persistence/src/entity/channels.dart';
/// Represents a [Members] table in [MoorChatDatabase].
@DataClassName('MemberEntity')
@@ -9,7 +10,7 @@ class Members extends Table {
/// The channel cid of which this user is part of
TextColumn get channelCid =>
text().customConstraint('REFERENCES channels(cid) ON DELETE CASCADE')();
text().references(Channels, #cid, onDelete: KeyAction.cascade)();
/// The role of the user in the channel
TextColumn get channelRole => text().nullable()();
@@ -1,6 +1,6 @@
// coverage:ignore-file
import 'package:drift/drift.dart';
import 'package:stream_chat_persistence/src/entity/pinned_messages.dart';
import 'package:stream_chat_persistence/src/entity/reactions.dart';
/// Represents a [PinnedMessageReactions] table in [MoorChatDatabase].
@@ -8,6 +8,6 @@ import 'package:stream_chat_persistence/src/entity/reactions.dart';
class PinnedMessageReactions extends Reactions {
/// The messageId to which the reaction belongs
@override
TextColumn get messageId => text()
.customConstraint('REFERENCES pinned_messages(id) ON DELETE CASCADE')();
TextColumn get messageId =>
text().references(PinnedMessages, #id, onDelete: KeyAction.cascade)();
}
@@ -1,6 +1,7 @@
// coverage:ignore-file
import 'package:drift/drift.dart';
import 'package:stream_chat_persistence/src/converter/map_converter.dart';
import 'package:stream_chat_persistence/src/entity/messages.dart';
/// Represents a [Reactions] table in [MoorChatDatabase].
@DataClassName('ReactionEntity')
@@ -10,7 +11,7 @@ class Reactions extends Table {
/// The messageId to which the reaction belongs
TextColumn get messageId =>
text().customConstraint('REFERENCES messages(id) ON DELETE CASCADE')();
text().references(Messages, #id, onDelete: KeyAction.cascade)();
/// The type of the reaction
TextColumn get type => text()();
@@ -1,5 +1,6 @@
// coverage:ignore-file
import 'package:drift/drift.dart';
import 'package:stream_chat_persistence/src/entity/channels.dart';
/// Represents a [Reads] table in [MoorChatDatabase].
@DataClassName('ReadEntity')
@@ -12,7 +13,7 @@ class Reads extends Table {
/// The channel cid of which this read belongs
TextColumn get channelCid =>
text().customConstraint('REFERENCES channels(cid) ON DELETE CASCADE')();
text().references(Channels, #cid, onDelete: KeyAction.cascade)();
/// Number of unread messages
IntColumn get unreadMessages => integer().withDefault(const Constant(0))();