feat(persistence): add support for message.i18n

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-07-27 20:06:06 +05:30
committed by xsahil03x
parent 7449540f34
commit 658f7f2504
11 changed files with 205 additions and 26 deletions
@@ -80,6 +80,9 @@ class Messages extends Table {
TextColumn get channelCid => text().nullable().customConstraint(
'NULLABLE REFERENCES channels(cid) ON DELETE CASCADE')();
/// A Map of [messageText] translations.
TextColumn get i18n => text().nullable().map(MapConverter<String>())();
/// Message custom extraData
TextColumn get extraData => text().nullable().map(MapConverter<Object?>())();
@@ -11,6 +11,9 @@ class Users extends Table {
/// User role
TextColumn get role => text().nullable()();
/// The language this user prefers.
TextColumn get language => text().withDefault(const Constant('en'))();
/// Date of user creation
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();