import 'package:drift/drift.dart';

@DataClassName('DriftMessage')
class Messages extends Table {
  IntColumn get id => integer()();
  IntColumn get messageId => integer().nullable()();
  IntColumn get chatId => integer().nullable()();
  IntColumn get chatIdx => integer().nullable()();
  IntColumn get sendId => integer().nullable()();
  TextColumn get content => text().nullable()();
  IntColumn get typ => integer().nullable()();
  IntColumn get sendTime => integer().nullable()();
  IntColumn get expireTime => integer().nullable()();
  IntColumn get createTime => integer().nullable()();
  TextColumn get atUsers => text().nullable()();
  TextColumn get emojis => text().withDefault(const Constant('[]'))();
  IntColumn get editTime => integer().withDefault(const Constant(0))();
  IntColumn get refTyp => integer().withDefault(const Constant(0))();
  IntColumn get flag => integer().withDefault(const Constant(0))();
  TextColumn get cmid => text().withDefault(const Constant(''))();

  @override
  Set<Column> get primaryKey => {id};

  @override
  String get tableName => 'message';
}