modify entities according to NNBD models

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-04-20 15:37:12 +05:30
parent 271dad7f0c
commit e3589a3030
8 changed files with 1323 additions and 1459 deletions
@@ -15,19 +15,18 @@ class Messages extends Table {
/// The list of attachments, either provided by the user
/// or generated from a command or as a result of URL scraping.
TextColumn get attachments =>
text().nullable().map(ListConverter<String>())();
TextColumn get attachments => text().map(ListConverter<String>())();
/// The status of a sending message
IntColumn get status =>
integer().nullable().map(MessageSendingStatusConverter())();
IntColumn get status => integer()
.withDefault(const Constant(1))
.map(MessageSendingStatusConverter())();
/// The message type
TextColumn get type => text().nullable()();
TextColumn get type => text().withDefault(const Constant('regular'))();
/// The list of user mentioned in the message
TextColumn get mentionedUsers =>
text().nullable().map(ListConverter<String>())();
TextColumn get mentionedUsers => text().map(ListConverter<String>())();
/// A map describing the count of number of every reaction
TextColumn get reactionCounts => text().nullable().map(MapConverter<int>())();
@@ -48,16 +47,16 @@ class Messages extends Table {
BoolColumn get showInChannel => boolean().nullable()();
/// If true the message is shadowed
BoolColumn get shadowed => boolean().nullable()();
BoolColumn get shadowed => boolean().withDefault(const Constant(false))();
/// A used command name.
TextColumn get command => text().nullable()();
/// The DateTime when the message was created.
DateTimeColumn get createdAt => dateTime()();
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
/// The DateTime when the message was updated last time.
DateTimeColumn get updatedAt => dateTime().nullable()();
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
/// The DateTime when the message was deleted.
DateTimeColumn get deletedAt => dateTime().nullable()();