// dart format width=80
import 'package:drift/internal/versioned_schema.dart' as i0;
import 'package:drift/drift.dart' as i1;
import 'dart:typed_data' as i2;
import 'package:drift/drift.dart'; // ignore_for_file: type=lint,unused_import

// GENERATED BY drift_dev, DO NOT MODIFY.
final class Schema2 extends i0.VersionedSchema {
  Schema2({required super.database}) : super(version: 2);
  @override
  late final List<i1.DatabaseSchemaEntity> entities = [
    contacts,
    groups,
    mediaFiles,
    messages,
    messageHistories,
    reactions,
    groupMembers,
    receipts,
    receivedReceipts,
    signalIdentityKeyStores,
    signalPreKeyStores,
    signalSenderKeyStores,
    signalSessionStores,
    signalContactPreKeys,
    signalContactSignedPreKeys,
    messageActions,
    groupHistories,
  ];
  late final Shape0 contacts = Shape0(
      source: i0.VersionedTable(
        entityName: 'contacts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(user_id)',
        ],
        columns: [
          _column_0,
          _column_1,
          _column_2,
          _column_3,
          _column_4,
          _column_5,
          _column_6,
          _column_7,
          _column_8,
          _column_9,
          _column_10,
          _column_11,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape1 groups = Shape1(
      source: i0.VersionedTable(
        entityName: 'groups',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_id)',
        ],
        columns: [
          _column_13,
          _column_14,
          _column_15,
          _column_16,
          _column_17,
          _column_18,
          _column_19,
          _column_20,
          _column_21,
          _column_22,
          _column_23,
          _column_24,
          _column_25,
          _column_26,
          _column_27,
          _column_12,
          _column_28,
          _column_29,
          _column_30,
          _column_31,
          _column_32,
          _column_33,
          _column_34,
          _column_35,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape2 mediaFiles = Shape2(
      source: i0.VersionedTable(
        entityName: 'media_files',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(media_id)',
        ],
        columns: [
          _column_36,
          _column_37,
          _column_38,
          _column_39,
          _column_40,
          _column_41,
          _column_42,
          _column_43,
          _column_44,
          _column_45,
          _column_46,
          _column_47,
          _column_48,
          _column_49,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape3 messages = Shape3(
      source: i0.VersionedTable(
        entityName: 'messages',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id)',
        ],
        columns: [
          _column_50,
          _column_51,
          _column_52,
          _column_37,
          _column_53,
          _column_54,
          _column_55,
          _column_56,
          _column_46,
          _column_57,
          _column_58,
          _column_59,
          _column_60,
          _column_12,
          _column_61,
          _column_62,
          _column_63,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape4 messageHistories = Shape4(
      source: i0.VersionedTable(
        entityName: 'message_histories',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(id)',
        ],
        columns: [
          _column_64,
          _column_65,
          _column_66,
          _column_53,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape5 reactions = Shape5(
      source: i0.VersionedTable(
        entityName: 'reactions',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id, sender_id, emoji)',
        ],
        columns: [
          _column_65,
          _column_67,
          _column_68,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape6 groupMembers = Shape6(
      source: i0.VersionedTable(
        entityName: 'group_members',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_id, contact_id)',
        ],
        columns: [
          _column_50,
          _column_69,
          _column_70,
          _column_71,
          _column_72,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape7 receipts = Shape7(
      source: i0.VersionedTable(
        entityName: 'receipts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(receipt_id)',
        ],
        columns: [
          _column_73,
          _column_74,
          _column_75,
          _column_76,
          _column_77,
          _column_78,
          _column_79,
          _column_80,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape8 receivedReceipts = Shape8(
      source: i0.VersionedTable(
        entityName: 'received_receipts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(receipt_id)',
        ],
        columns: [
          _column_73,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape9 signalIdentityKeyStores = Shape9(
      source: i0.VersionedTable(
        entityName: 'signal_identity_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(device_id, name)',
        ],
        columns: [
          _column_81,
          _column_82,
          _column_83,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape10 signalPreKeyStores = Shape10(
      source: i0.VersionedTable(
        entityName: 'signal_pre_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(pre_key_id)',
        ],
        columns: [
          _column_84,
          _column_85,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape11 signalSenderKeyStores = Shape11(
      source: i0.VersionedTable(
        entityName: 'signal_sender_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(sender_key_name)',
        ],
        columns: [
          _column_86,
          _column_87,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape12 signalSessionStores = Shape12(
      source: i0.VersionedTable(
        entityName: 'signal_session_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(device_id, name)',
        ],
        columns: [
          _column_81,
          _column_82,
          _column_88,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape13 signalContactPreKeys = Shape13(
      source: i0.VersionedTable(
        entityName: 'signal_contact_pre_keys',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(contact_id, pre_key_id)',
        ],
        columns: [
          _column_74,
          _column_84,
          _column_85,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape14 signalContactSignedPreKeys = Shape14(
      source: i0.VersionedTable(
        entityName: 'signal_contact_signed_pre_keys',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(contact_id)',
        ],
        columns: [
          _column_74,
          _column_89,
          _column_90,
          _column_91,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape15 messageActions = Shape15(
      source: i0.VersionedTable(
        entityName: 'message_actions',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id, contact_id, type)',
        ],
        columns: [
          _column_65,
          _column_92,
          _column_37,
          _column_93,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape16 groupHistories = Shape16(
      source: i0.VersionedTable(
        entityName: 'group_histories',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_history_id)',
        ],
        columns: [
          _column_94,
          _column_50,
          _column_95,
          _column_96,
          _column_97,
          _column_98,
          _column_99,
          _column_37,
          _column_93,
        ],
        attachedDatabase: database,
      ),
      alias: null);
}

class Shape0 extends i0.VersionedTable {
  Shape0({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get userId =>
      columnsByName['user_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get username =>
      columnsByName['username']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get displayName =>
      columnsByName['display_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get nickName =>
      columnsByName['nick_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get avatarSvgCompressed =>
      columnsByName['avatar_svg_compressed']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<int> get senderProfileCounter =>
      columnsByName['sender_profile_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get accepted =>
      columnsByName['accepted']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get deletedByUser =>
      columnsByName['deleted_by_user']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get requested =>
      columnsByName['requested']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get blocked =>
      columnsByName['blocked']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get verified =>
      columnsByName['verified']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get accountDeleted =>
      columnsByName['account_deleted']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_0(String aliasedName) =>
    i1.GeneratedColumn<int>('user_id', aliasedName, false,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<String> _column_1(String aliasedName) =>
    i1.GeneratedColumn<String>('username', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_2(String aliasedName) =>
    i1.GeneratedColumn<String>('display_name', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_3(String aliasedName) =>
    i1.GeneratedColumn<String>('nick_name', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<i2.Uint8List> _column_4(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('avatar_svg_compressed', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<int> _column_5(String aliasedName) =>
    i1.GeneratedColumn<int>('sender_profile_counter', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_6(String aliasedName) =>
    i1.GeneratedColumn<bool>('accepted', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("accepted" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_7(String aliasedName) =>
    i1.GeneratedColumn<bool>('deleted_by_user', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("deleted_by_user" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_8(String aliasedName) =>
    i1.GeneratedColumn<bool>('requested', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("requested" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_9(String aliasedName) =>
    i1.GeneratedColumn<bool>('blocked', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("blocked" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_10(String aliasedName) =>
    i1.GeneratedColumn<bool>('verified', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("verified" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_11(String aliasedName) =>
    i1.GeneratedColumn<bool>('account_deleted', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("account_deleted" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<DateTime> _column_12(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('created_at', aliasedName, false,
        type: i1.DriftSqlType.dateTime,
        defaultValue: const CustomExpression(
            'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)'));

class Shape1 extends i0.VersionedTable {
  Shape1({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get groupId =>
      columnsByName['group_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<bool> get isGroupAdmin =>
      columnsByName['is_group_admin']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get isDirectChat =>
      columnsByName['is_direct_chat']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get pinned =>
      columnsByName['pinned']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get archived =>
      columnsByName['archived']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get joinedGroup =>
      columnsByName['joined_group']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get leftGroup =>
      columnsByName['left_group']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get deletedContent =>
      columnsByName['deleted_content']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<int> get stateVersionId =>
      columnsByName['state_version_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<i2.Uint8List> get stateEncryptionKey =>
      columnsByName['state_encryption_key']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get myGroupPrivateKey =>
      columnsByName['my_group_private_key']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<String> get groupName =>
      columnsByName['group_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get totalMediaCounter =>
      columnsByName['total_media_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get alsoBestFriend =>
      columnsByName['also_best_friend']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<int> get deleteMessagesAfterMilliseconds =>
      columnsByName['delete_messages_after_milliseconds']!
          as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageSend =>
      columnsByName['last_message_send']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageReceived =>
      columnsByName['last_message_received']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastFlameCounterChange =>
      columnsByName['last_flame_counter_change']!
          as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastFlameSync =>
      columnsByName['last_flame_sync']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<int> get flameCounter =>
      columnsByName['flame_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get maxFlameCounter =>
      columnsByName['max_flame_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get maxFlameCounterFrom =>
      columnsByName['max_flame_counter_from']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageExchange =>
      columnsByName['last_message_exchange']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_13(String aliasedName) =>
    i1.GeneratedColumn<String>('group_id', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<bool> _column_14(String aliasedName) =>
    i1.GeneratedColumn<bool>('is_group_admin', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("is_group_admin" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_15(String aliasedName) =>
    i1.GeneratedColumn<bool>('is_direct_chat', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("is_direct_chat" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_16(String aliasedName) =>
    i1.GeneratedColumn<bool>('pinned', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints:
            i1.GeneratedColumn.constraintIsAlways('CHECK ("pinned" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_17(String aliasedName) =>
    i1.GeneratedColumn<bool>('archived', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("archived" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_18(String aliasedName) =>
    i1.GeneratedColumn<bool>('joined_group', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("joined_group" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_19(String aliasedName) =>
    i1.GeneratedColumn<bool>('left_group', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("left_group" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_20(String aliasedName) =>
    i1.GeneratedColumn<bool>('deleted_content', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("deleted_content" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<int> _column_21(String aliasedName) =>
    i1.GeneratedColumn<int>('state_version_id', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<i2.Uint8List> _column_22(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('state_encryption_key', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<i2.Uint8List> _column_23(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('my_group_private_key', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<String> _column_24(String aliasedName) =>
    i1.GeneratedColumn<String>('group_name', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_25(String aliasedName) =>
    i1.GeneratedColumn<int>('total_media_counter', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_26(String aliasedName) =>
    i1.GeneratedColumn<bool>('also_best_friend', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("also_best_friend" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<int> _column_27(String aliasedName) =>
    i1.GeneratedColumn<int>(
        'delete_messages_after_milliseconds', aliasedName, false,
        type: i1.DriftSqlType.int,
        defaultValue: const CustomExpression('86400000'));
i1.GeneratedColumn<DateTime> _column_28(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_message_send', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_29(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_message_received', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_30(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_flame_counter_change', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_31(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_flame_sync', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<int> _column_32(String aliasedName) =>
    i1.GeneratedColumn<int>('flame_counter', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<int> _column_33(String aliasedName) =>
    i1.GeneratedColumn<int>('max_flame_counter', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<DateTime> _column_34(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('max_flame_counter_from', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_35(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_message_exchange', aliasedName, false,
        type: i1.DriftSqlType.dateTime,
        defaultValue: const CustomExpression(
            'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)'));

class Shape2 extends i0.VersionedTable {
  Shape2({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get mediaId =>
      columnsByName['media_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get type =>
      columnsByName['type']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get uploadState =>
      columnsByName['upload_state']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get downloadState =>
      columnsByName['download_state']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<bool> get requiresAuthentication =>
      columnsByName['requires_authentication']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get stored =>
      columnsByName['stored']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get isDraftMedia =>
      columnsByName['is_draft_media']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<String> get reuploadRequestedBy =>
      columnsByName['reupload_requested_by']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get displayLimitInMilliseconds =>
      columnsByName['display_limit_in_milliseconds']!
          as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get removeAudio =>
      columnsByName['remove_audio']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<i2.Uint8List> get downloadToken =>
      columnsByName['download_token']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get encryptionKey =>
      columnsByName['encryption_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get encryptionMac =>
      columnsByName['encryption_mac']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get encryptionNonce =>
      columnsByName['encryption_nonce']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_36(String aliasedName) =>
    i1.GeneratedColumn<String>('media_id', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_37(String aliasedName) =>
    i1.GeneratedColumn<String>('type', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_38(String aliasedName) =>
    i1.GeneratedColumn<String>('upload_state', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_39(String aliasedName) =>
    i1.GeneratedColumn<String>('download_state', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<bool> _column_40(String aliasedName) =>
    i1.GeneratedColumn<bool>('requires_authentication', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("requires_authentication" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_41(String aliasedName) =>
    i1.GeneratedColumn<bool>('stored', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints:
            i1.GeneratedColumn.constraintIsAlways('CHECK ("stored" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_42(String aliasedName) =>
    i1.GeneratedColumn<bool>('is_draft_media', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("is_draft_media" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<String> _column_43(String aliasedName) =>
    i1.GeneratedColumn<String>('reupload_requested_by', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_44(String aliasedName) =>
    i1.GeneratedColumn<int>('display_limit_in_milliseconds', aliasedName, true,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<bool> _column_45(String aliasedName) =>
    i1.GeneratedColumn<bool>('remove_audio', aliasedName, true,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("remove_audio" IN (0, 1))'));
i1.GeneratedColumn<i2.Uint8List> _column_46(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('download_token', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<i2.Uint8List> _column_47(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('encryption_key', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<i2.Uint8List> _column_48(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('encryption_mac', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<i2.Uint8List> _column_49(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('encryption_nonce', aliasedName, true,
        type: i1.DriftSqlType.blob);

class Shape3 extends i0.VersionedTable {
  Shape3({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get groupId =>
      columnsByName['group_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get messageId =>
      columnsByName['message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get senderId =>
      columnsByName['sender_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get type =>
      columnsByName['type']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get content =>
      columnsByName['content']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get mediaId =>
      columnsByName['media_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<bool> get mediaStored =>
      columnsByName['media_stored']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get mediaReopened =>
      columnsByName['media_reopened']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<i2.Uint8List> get downloadToken =>
      columnsByName['download_token']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<String> get quotesMessageId =>
      columnsByName['quotes_message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<bool> get isDeletedFromSender =>
      columnsByName['is_deleted_from_sender']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<DateTime> get openedAt =>
      columnsByName['opened_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get openedByAll =>
      columnsByName['opened_by_all']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get modifiedAt =>
      columnsByName['modified_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get ackByUser =>
      columnsByName['ack_by_user']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get ackByServer =>
      columnsByName['ack_by_server']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_50(String aliasedName) =>
    i1.GeneratedColumn<String>('group_id', aliasedName, false,
        type: i1.DriftSqlType.string,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES "groups" (group_id) ON DELETE CASCADE'));
i1.GeneratedColumn<String> _column_51(String aliasedName) =>
    i1.GeneratedColumn<String>('message_id', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_52(String aliasedName) =>
    i1.GeneratedColumn<int>('sender_id', aliasedName, true,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id)'));
i1.GeneratedColumn<String> _column_53(String aliasedName) =>
    i1.GeneratedColumn<String>('content', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_54(String aliasedName) =>
    i1.GeneratedColumn<String>('media_id', aliasedName, true,
        type: i1.DriftSqlType.string,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES media_files (media_id) ON DELETE SET NULL'));
i1.GeneratedColumn<bool> _column_55(String aliasedName) =>
    i1.GeneratedColumn<bool>('media_stored', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("media_stored" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<bool> _column_56(String aliasedName) =>
    i1.GeneratedColumn<bool>('media_reopened', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("media_reopened" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<String> _column_57(String aliasedName) =>
    i1.GeneratedColumn<String>('quotes_message_id', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<bool> _column_58(String aliasedName) =>
    i1.GeneratedColumn<bool>('is_deleted_from_sender', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("is_deleted_from_sender" IN (0, 1))'),
        defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<DateTime> _column_59(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('opened_at', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_60(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('opened_by_all', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_61(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('modified_at', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_62(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('ack_by_user', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<DateTime> _column_63(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('ack_by_server', aliasedName, true,
        type: i1.DriftSqlType.dateTime);

class Shape4 extends i0.VersionedTable {
  Shape4({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get id =>
      columnsByName['id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get messageId =>
      columnsByName['message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get content =>
      columnsByName['content']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_64(String aliasedName) =>
    i1.GeneratedColumn<int>('id', aliasedName, false,
        hasAutoIncrement: true,
        type: i1.DriftSqlType.int,
        defaultConstraints:
            i1.GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
i1.GeneratedColumn<String> _column_65(String aliasedName) =>
    i1.GeneratedColumn<String>('message_id', aliasedName, false,
        type: i1.DriftSqlType.string,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES messages (message_id) ON DELETE CASCADE'));
i1.GeneratedColumn<int> _column_66(String aliasedName) =>
    i1.GeneratedColumn<int>('contact_id', aliasedName, true,
        type: i1.DriftSqlType.int);

class Shape5 extends i0.VersionedTable {
  Shape5({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get messageId =>
      columnsByName['message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get emoji =>
      columnsByName['emoji']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get senderId =>
      columnsByName['sender_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_67(String aliasedName) =>
    i1.GeneratedColumn<String>('emoji', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_68(String aliasedName) =>
    i1.GeneratedColumn<int>('sender_id', aliasedName, true,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id) ON DELETE CASCADE'));

class Shape6 extends i0.VersionedTable {
  Shape6({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get groupId =>
      columnsByName['group_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get memberState =>
      columnsByName['member_state']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get groupPublicKey =>
      columnsByName['group_public_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get lastMessage =>
      columnsByName['last_message']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_69(String aliasedName) =>
    i1.GeneratedColumn<int>('contact_id', aliasedName, false,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id)'));
i1.GeneratedColumn<String> _column_70(String aliasedName) =>
    i1.GeneratedColumn<String>('member_state', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<i2.Uint8List> _column_71(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('group_public_key', aliasedName, true,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<DateTime> _column_72(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_message', aliasedName, true,
        type: i1.DriftSqlType.dateTime);

class Shape7 extends i0.VersionedTable {
  Shape7({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get receiptId =>
      columnsByName['receipt_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get messageId =>
      columnsByName['message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get message =>
      columnsByName['message']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<bool> get contactWillSendsReceipt =>
      columnsByName['contact_will_sends_receipt']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<DateTime> get ackByServerAt =>
      columnsByName['ack_by_server_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<int> get retryCount =>
      columnsByName['retry_count']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get lastRetry =>
      columnsByName['last_retry']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_73(String aliasedName) =>
    i1.GeneratedColumn<String>('receipt_id', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_74(String aliasedName) =>
    i1.GeneratedColumn<int>('contact_id', aliasedName, false,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id) ON DELETE CASCADE'));
i1.GeneratedColumn<String> _column_75(String aliasedName) =>
    i1.GeneratedColumn<String>('message_id', aliasedName, true,
        type: i1.DriftSqlType.string,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES messages (message_id) ON DELETE CASCADE'));
i1.GeneratedColumn<i2.Uint8List> _column_76(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('message', aliasedName, false,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<bool> _column_77(String aliasedName) =>
    i1.GeneratedColumn<bool>('contact_will_sends_receipt', aliasedName, false,
        type: i1.DriftSqlType.bool,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'CHECK ("contact_will_sends_receipt" IN (0, 1))'),
        defaultValue: const CustomExpression('1'));
i1.GeneratedColumn<DateTime> _column_78(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('ack_by_server_at', aliasedName, true,
        type: i1.DriftSqlType.dateTime);
i1.GeneratedColumn<int> _column_79(String aliasedName) =>
    i1.GeneratedColumn<int>('retry_count', aliasedName, false,
        type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
i1.GeneratedColumn<DateTime> _column_80(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('last_retry', aliasedName, true,
        type: i1.DriftSqlType.dateTime);

class Shape8 extends i0.VersionedTable {
  Shape8({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get receiptId =>
      columnsByName['receipt_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

class Shape9 extends i0.VersionedTable {
  Shape9({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get deviceId =>
      columnsByName['device_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get name =>
      columnsByName['name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get identityKey =>
      columnsByName['identity_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_81(String aliasedName) =>
    i1.GeneratedColumn<int>('device_id', aliasedName, false,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<String> _column_82(String aliasedName) =>
    i1.GeneratedColumn<String>('name', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<i2.Uint8List> _column_83(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('identity_key', aliasedName, false,
        type: i1.DriftSqlType.blob);

class Shape10 extends i0.VersionedTable {
  Shape10({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get preKeyId =>
      columnsByName['pre_key_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<i2.Uint8List> get preKey =>
      columnsByName['pre_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_84(String aliasedName) =>
    i1.GeneratedColumn<int>('pre_key_id', aliasedName, false,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<i2.Uint8List> _column_85(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('pre_key', aliasedName, false,
        type: i1.DriftSqlType.blob);

class Shape11 extends i0.VersionedTable {
  Shape11({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get senderKeyName =>
      columnsByName['sender_key_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get senderKey =>
      columnsByName['sender_key']! as i1.GeneratedColumn<i2.Uint8List>;
}

i1.GeneratedColumn<String> _column_86(String aliasedName) =>
    i1.GeneratedColumn<String>('sender_key_name', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<i2.Uint8List> _column_87(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('sender_key', aliasedName, false,
        type: i1.DriftSqlType.blob);

class Shape12 extends i0.VersionedTable {
  Shape12({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get deviceId =>
      columnsByName['device_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get name =>
      columnsByName['name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<i2.Uint8List> get sessionRecord =>
      columnsByName['session_record']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<i2.Uint8List> _column_88(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('session_record', aliasedName, false,
        type: i1.DriftSqlType.blob);

class Shape13 extends i0.VersionedTable {
  Shape13({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get preKeyId =>
      columnsByName['pre_key_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<i2.Uint8List> get preKey =>
      columnsByName['pre_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

class Shape14 extends i0.VersionedTable {
  Shape14({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get signedPreKeyId =>
      columnsByName['signed_pre_key_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<i2.Uint8List> get signedPreKey =>
      columnsByName['signed_pre_key']! as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get signedPreKeySignature =>
      columnsByName['signed_pre_key_signature']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_89(String aliasedName) =>
    i1.GeneratedColumn<int>('signed_pre_key_id', aliasedName, false,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<i2.Uint8List> _column_90(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>('signed_pre_key', aliasedName, false,
        type: i1.DriftSqlType.blob);
i1.GeneratedColumn<i2.Uint8List> _column_91(String aliasedName) =>
    i1.GeneratedColumn<i2.Uint8List>(
        'signed_pre_key_signature', aliasedName, false,
        type: i1.DriftSqlType.blob);

class Shape15 extends i0.VersionedTable {
  Shape15({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get messageId =>
      columnsByName['message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get type =>
      columnsByName['type']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get actionAt =>
      columnsByName['action_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<int> _column_92(String aliasedName) =>
    i1.GeneratedColumn<int>('contact_id', aliasedName, false,
        type: i1.DriftSqlType.int);
i1.GeneratedColumn<DateTime> _column_93(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('action_at', aliasedName, false,
        type: i1.DriftSqlType.dateTime,
        defaultValue: const CustomExpression(
            'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)'));

class Shape16 extends i0.VersionedTable {
  Shape16({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get groupHistoryId =>
      columnsByName['group_history_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get groupId =>
      columnsByName['group_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get contactId =>
      columnsByName['contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get affectedContactId =>
      columnsByName['affected_contact_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get oldGroupName =>
      columnsByName['old_group_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get newGroupName =>
      columnsByName['new_group_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get newDeleteMessagesAfterMilliseconds =>
      columnsByName['new_delete_messages_after_milliseconds']!
          as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<String> get type =>
      columnsByName['type']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get actionAt =>
      columnsByName['action_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_94(String aliasedName) =>
    i1.GeneratedColumn<String>('group_history_id', aliasedName, false,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_95(String aliasedName) =>
    i1.GeneratedColumn<int>('contact_id', aliasedName, true,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id)'));
i1.GeneratedColumn<int> _column_96(String aliasedName) =>
    i1.GeneratedColumn<int>('affected_contact_id', aliasedName, true,
        type: i1.DriftSqlType.int,
        defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
            'REFERENCES contacts (user_id)'));
i1.GeneratedColumn<String> _column_97(String aliasedName) =>
    i1.GeneratedColumn<String>('old_group_name', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_98(String aliasedName) =>
    i1.GeneratedColumn<String>('new_group_name', aliasedName, true,
        type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_99(String aliasedName) =>
    i1.GeneratedColumn<int>(
        'new_delete_messages_after_milliseconds', aliasedName, true,
        type: i1.DriftSqlType.int);

final class Schema3 extends i0.VersionedSchema {
  Schema3({required super.database}) : super(version: 3);
  @override
  late final List<i1.DatabaseSchemaEntity> entities = [
    contacts,
    groups,
    mediaFiles,
    messages,
    messageHistories,
    reactions,
    groupMembers,
    receipts,
    receivedReceipts,
    signalIdentityKeyStores,
    signalPreKeyStores,
    signalSenderKeyStores,
    signalSessionStores,
    signalContactPreKeys,
    signalContactSignedPreKeys,
    messageActions,
    groupHistories,
  ];
  late final Shape0 contacts = Shape0(
      source: i0.VersionedTable(
        entityName: 'contacts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(user_id)',
        ],
        columns: [
          _column_0,
          _column_1,
          _column_2,
          _column_3,
          _column_4,
          _column_5,
          _column_6,
          _column_7,
          _column_8,
          _column_9,
          _column_10,
          _column_11,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape17 groups = Shape17(
      source: i0.VersionedTable(
        entityName: 'groups',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_id)',
        ],
        columns: [
          _column_13,
          _column_14,
          _column_15,
          _column_16,
          _column_17,
          _column_18,
          _column_19,
          _column_20,
          _column_21,
          _column_22,
          _column_23,
          _column_24,
          _column_100,
          _column_25,
          _column_26,
          _column_27,
          _column_12,
          _column_28,
          _column_29,
          _column_30,
          _column_31,
          _column_32,
          _column_33,
          _column_34,
          _column_35,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape2 mediaFiles = Shape2(
      source: i0.VersionedTable(
        entityName: 'media_files',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(media_id)',
        ],
        columns: [
          _column_36,
          _column_37,
          _column_38,
          _column_39,
          _column_40,
          _column_41,
          _column_42,
          _column_43,
          _column_44,
          _column_45,
          _column_46,
          _column_47,
          _column_48,
          _column_49,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape3 messages = Shape3(
      source: i0.VersionedTable(
        entityName: 'messages',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id)',
        ],
        columns: [
          _column_50,
          _column_51,
          _column_52,
          _column_37,
          _column_53,
          _column_54,
          _column_55,
          _column_56,
          _column_46,
          _column_57,
          _column_58,
          _column_59,
          _column_60,
          _column_12,
          _column_61,
          _column_62,
          _column_63,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape4 messageHistories = Shape4(
      source: i0.VersionedTable(
        entityName: 'message_histories',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(id)',
        ],
        columns: [
          _column_64,
          _column_65,
          _column_66,
          _column_53,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape5 reactions = Shape5(
      source: i0.VersionedTable(
        entityName: 'reactions',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id, sender_id, emoji)',
        ],
        columns: [
          _column_65,
          _column_67,
          _column_68,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape6 groupMembers = Shape6(
      source: i0.VersionedTable(
        entityName: 'group_members',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_id, contact_id)',
        ],
        columns: [
          _column_50,
          _column_69,
          _column_70,
          _column_71,
          _column_72,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape7 receipts = Shape7(
      source: i0.VersionedTable(
        entityName: 'receipts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(receipt_id)',
        ],
        columns: [
          _column_73,
          _column_74,
          _column_75,
          _column_76,
          _column_77,
          _column_78,
          _column_79,
          _column_80,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape8 receivedReceipts = Shape8(
      source: i0.VersionedTable(
        entityName: 'received_receipts',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(receipt_id)',
        ],
        columns: [
          _column_73,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape9 signalIdentityKeyStores = Shape9(
      source: i0.VersionedTable(
        entityName: 'signal_identity_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(device_id, name)',
        ],
        columns: [
          _column_81,
          _column_82,
          _column_83,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape10 signalPreKeyStores = Shape10(
      source: i0.VersionedTable(
        entityName: 'signal_pre_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(pre_key_id)',
        ],
        columns: [
          _column_84,
          _column_85,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape11 signalSenderKeyStores = Shape11(
      source: i0.VersionedTable(
        entityName: 'signal_sender_key_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(sender_key_name)',
        ],
        columns: [
          _column_86,
          _column_87,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape12 signalSessionStores = Shape12(
      source: i0.VersionedTable(
        entityName: 'signal_session_stores',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(device_id, name)',
        ],
        columns: [
          _column_81,
          _column_82,
          _column_88,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape13 signalContactPreKeys = Shape13(
      source: i0.VersionedTable(
        entityName: 'signal_contact_pre_keys',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(contact_id, pre_key_id)',
        ],
        columns: [
          _column_74,
          _column_84,
          _column_85,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape14 signalContactSignedPreKeys = Shape14(
      source: i0.VersionedTable(
        entityName: 'signal_contact_signed_pre_keys',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(contact_id)',
        ],
        columns: [
          _column_74,
          _column_89,
          _column_90,
          _column_91,
          _column_12,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape15 messageActions = Shape15(
      source: i0.VersionedTable(
        entityName: 'message_actions',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(message_id, contact_id, type)',
        ],
        columns: [
          _column_65,
          _column_92,
          _column_37,
          _column_93,
        ],
        attachedDatabase: database,
      ),
      alias: null);
  late final Shape16 groupHistories = Shape16(
      source: i0.VersionedTable(
        entityName: 'group_histories',
        withoutRowId: false,
        isStrict: false,
        tableConstraints: [
          'PRIMARY KEY(group_history_id)',
        ],
        columns: [
          _column_94,
          _column_50,
          _column_95,
          _column_96,
          _column_97,
          _column_98,
          _column_99,
          _column_37,
          _column_93,
        ],
        attachedDatabase: database,
      ),
      alias: null);
}

class Shape17 extends i0.VersionedTable {
  Shape17({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get groupId =>
      columnsByName['group_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<bool> get isGroupAdmin =>
      columnsByName['is_group_admin']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get isDirectChat =>
      columnsByName['is_direct_chat']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get pinned =>
      columnsByName['pinned']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get archived =>
      columnsByName['archived']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get joinedGroup =>
      columnsByName['joined_group']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get leftGroup =>
      columnsByName['left_group']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get deletedContent =>
      columnsByName['deleted_content']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<int> get stateVersionId =>
      columnsByName['state_version_id']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<i2.Uint8List> get stateEncryptionKey =>
      columnsByName['state_encryption_key']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<i2.Uint8List> get myGroupPrivateKey =>
      columnsByName['my_group_private_key']!
          as i1.GeneratedColumn<i2.Uint8List>;
  i1.GeneratedColumn<String> get groupName =>
      columnsByName['group_name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get draftMessage =>
      columnsByName['draft_message']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get totalMediaCounter =>
      columnsByName['total_media_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get alsoBestFriend =>
      columnsByName['also_best_friend']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<int> get deleteMessagesAfterMilliseconds =>
      columnsByName['delete_messages_after_milliseconds']!
          as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageSend =>
      columnsByName['last_message_send']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageReceived =>
      columnsByName['last_message_received']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastFlameCounterChange =>
      columnsByName['last_flame_counter_change']!
          as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastFlameSync =>
      columnsByName['last_flame_sync']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<int> get flameCounter =>
      columnsByName['flame_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get maxFlameCounter =>
      columnsByName['max_flame_counter']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get maxFlameCounterFrom =>
      columnsByName['max_flame_counter_from']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get lastMessageExchange =>
      columnsByName['last_message_exchange']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_100(String aliasedName) =>
    i1.GeneratedColumn<String>('draft_message', aliasedName, true,
        type: i1.DriftSqlType.string);
i0.MigrationStepWithVersion migrationSteps({
  required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
  required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
}) {
  return (currentVersion, database) async {
    switch (currentVersion) {
      case 1:
        final schema = Schema2(database: database);
        final migrator = i1.Migrator(database, schema);
        await from1To2(migrator, schema);
        return 2;
      case 2:
        final schema = Schema3(database: database);
        final migrator = i1.Migrator(database, schema);
        await from2To3(migrator, schema);
        return 3;
      default:
        throw ArgumentError.value('Unknown migration from $currentVersion');
    }
  };
}

i1.OnUpgrade stepByStep({
  required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
  required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
}) =>
    i0.VersionedSchema.stepByStepHelper(
        step: migrationSteps(
      from1To2: from1To2,
      from2To3: from2To3,
    ));
