content: // GENERATED CODE - DO NOT MODIFY BY HAND
  
  part of 'history.dart';
  
  // **************************************************************************
  // IsarCollectionGenerator
  // **************************************************************************
  
  // coverage:ignore-file
  // ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types
  
  extension GetHistoryCollection on Isar {
    IsarCollection<History> get historys => this.collection();
  }
  
  const HistorySchema = CollectionSchema(
    name: r'History',
    id: 1676981785059398080,
    properties: {
      r'chapterId': PropertySchema(
        id: 0,
        name: r'chapterId',
        type: IsarType.long,
      ),
      r'date': PropertySchema(id: 1, name: r'date', type: IsarType.string),
      r'isManga': PropertySchema(id: 2, name: r'isManga', type: IsarType.bool),
      r'itemType': PropertySchema(
        id: 3,
        name: r'itemType',
        type: IsarType.byte,
        enumMap: _HistoryitemTypeEnumValueMap,
      ),
      r'mangaId': PropertySchema(id: 4, name: r'mangaId', type: IsarType.long),
      r'updatedAt': PropertySchema(
        id: 5,
        name: r'updatedAt',
        type: IsarType.long,
      ),
    },
  
    estimateSize: _historyEstimateSize,
    serialize: _historySerialize,
    deserialize: _historyDeserialize,
    deserializeProp: _historyDeserializeProp,
    idName: r'id',
    indexes: {},
    links: {
      r'chapter': LinkSchema(
        id: 4328961867471184172,
        name: r'chapter',
        target: r'Chapter',
        single: true,
      ),
    },
    embeddedSchemas: {},
  
    getId: _historyGetId,
    getLinks: _historyGetLinks,
    attach: _historyAttach,
    version: '3.1.0+1',
  );
  
  int _historyEstimateSize(
    History object,
    List<int> offsets,
    Map<Type, List<int>> allOffsets,
  ) {
    var bytesCount = offsets.last;
    {
      final value = object.date;
      if (value != null) {
        bytesCount += 3 + value.length * 3;
      }
    }
    return bytesCount;
  }
  
  void _historySerialize(
    History object,
    IsarWriter writer,
    List<int> offsets,
    Map<Type, List<int>> allOffsets,
  ) {
    writer.writeLong(offsets[0], object.chapterId);
    writer.writeString(offsets[1], object.date);
    writer.writeBool(offsets[2], object.isManga);
    writer.writeByte(offsets[3], object.itemType.index);
    writer.writeLong(offsets[4], object.mangaId);
    writer.writeLong(offsets[5], object.updatedAt);
  }
  
  History _historyDeserialize(
    Id id,
    IsarReader reader,
    List<int> offsets,
    Map<Type, List<int>> allOffsets,
  ) {
    final object = History(
      chapterId: reader.readLongOrNull(offsets[0]),
      date: reader.readStringOrNull(offsets[1]),
      id: id,
      isManga: reader.readBoolOrNull(offsets[2]),
      itemType:
          _HistoryitemTypeValueEnumMap[reader.readByteOrNull(offsets[3])] ??
          ItemType.manga,
      mangaId: reader.readLongOrNull(offsets[4]),
      updatedAt: reader.readLongOrNull(offsets[5]),
    );
    return object;
  }
  
  P _historyDeserializeProp<P>(
    IsarReader reader,
    int propertyId,
    int offset,
    Map<Type, List<int>> allOffsets,
  ) {
    switch (propertyId) {
      case 0:
        return (reader.readLongOrNull(offset)) as P;
      case 1:
        return (reader.readStringOrNull(offset)) as P;
      case 2:
        return (reader.readBoolOrNull(offset)) as P;
      case 3:
        return (_HistoryitemTypeValueEnumMap[reader.readByteOrNull(offset)] ??
                ItemType.manga)
            as P;
      case 4:
        return (reader.readLongOrNull(offset)) as P;
      case 5:
        return (reader.readLongOrNull(offset)) as P;
      default:
        throw IsarError('Unknown property with id $propertyId');
    }
  }
  
  const _HistoryitemTypeEnumValueMap = {'manga': 0, 'anime': 1, 'novel': 2};
  const _HistoryitemTypeValueEnumMap = {
    0: ItemType.manga,
    1: ItemType.anime,
    2: ItemType.novel,
  };
  
  Id _historyGetId(History object) {
    return object.id ?? Isar.autoIncrement;
  }
  
  List<IsarLinkBase<dynamic>> _historyGetLinks(History object) {
    return [object.chapter];
  }
  
  void _historyAttach(IsarCollection<dynamic> col, Id id, History object) {
    object.id = id;
    object.chapter.attach(col, col.isar.collection<Chapter>(), r'chapter', id);
  }
  
  extension HistoryQueryWhereSort on QueryBuilder<History, History, QWhere> {
    QueryBuilder<History, History, QAfterWhere> anyId() {
      return QueryBuilder.apply(this, (query) {
        return query.addWhereClause(const IdWhereClause.any());
      });
    }
  }
  
  extension HistoryQueryWhere on QueryBuilder<History, History, QWhereClause> {
    QueryBuilder<History, History, QAfterWhereClause> idEqualTo(Id id) {
      return QueryBuilder.apply(this, (query) {
        return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
      });
    }
  
    QueryBuilder<History, History, QAfterWhereClause> idNotEqualTo(Id id) {
      return QueryBuilder.apply(this, (query) {
        if (query.whereSort == Sort.asc) {
          return query
              .addWhereClause(
                IdWhereClause.lessThan(upper: id, includeUpper: false),
              )
              .addWhereClause(
                IdWhereClause.greaterThan(lower: id, includeLower: false),
              );
        } else {
          return query
              .addWhereClause(
                IdWhereClause.greaterThan(lower: id, includeLower: false),
              )
              .addWhereClause(
                IdWhereClause.lessThan(upper: id, includeUpper: false),
              );
        }
      });
    }
  
    QueryBuilder<History, History, QAfterWhereClause> idGreaterThan(
      Id id, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addWhereClause(
          IdWhereClause.greaterThan(lower: id, includeLower: include),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterWhereClause> idLessThan(
      Id id, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addWhereClause(
          IdWhereClause.lessThan(upper: id, includeUpper: include),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterWhereClause> idBetween(
      Id lowerId,
      Id upperId, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addWhereClause(
          IdWhereClause.between(
            lower: lowerId,
            includeLower: includeLower,
            upper: upperId,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  }
  
  extension HistoryQueryFilter
      on QueryBuilder<History, History, QFilterCondition> {
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'chapterId'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'chapterId'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdEqualTo(
      int? value,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'chapterId', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdGreaterThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'chapterId',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdLessThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'chapterId',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIdBetween(
      int? lower,
      int? upper, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'chapterId',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'date'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'date'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateEqualTo(
      String? value, {
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateGreaterThan(
      String? value, {
      bool include = false,
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateLessThan(
      String? value, {
      bool include = false,
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateBetween(
      String? lower,
      String? upper, {
      bool includeLower = true,
      bool includeUpper = true,
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'date',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateStartsWith(
      String value, {
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.startsWith(
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateEndsWith(
      String value, {
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.endsWith(
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateContains(
      String value, {
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.contains(
            property: r'date',
            value: value,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateMatches(
      String pattern, {
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.matches(
            property: r'date',
            wildcard: pattern,
            caseSensitive: caseSensitive,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateIsEmpty() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'date', value: ''),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> dateIsNotEmpty() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(property: r'date', value: ''),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'id'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'id'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idEqualTo(Id? value) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'id', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idGreaterThan(
      Id? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'id',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idLessThan(
      Id? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'id',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> idBetween(
      Id? lower,
      Id? upper, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'id',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> isMangaIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'isManga'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> isMangaIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'isManga'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> isMangaEqualTo(
      bool? value,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'isManga', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> itemTypeEqualTo(
      ItemType value,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'itemType', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> itemTypeGreaterThan(
      ItemType value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'itemType',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> itemTypeLessThan(
      ItemType value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'itemType',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> itemTypeBetween(
      ItemType lower,
      ItemType upper, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'itemType',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'mangaId'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'mangaId'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdEqualTo(
      int? value,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'mangaId', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdGreaterThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'mangaId',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdLessThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'mangaId',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> mangaIdBetween(
      int? lower,
      int? upper, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'mangaId',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNull(property: r'updatedAt'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtIsNotNull() {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          const FilterCondition.isNotNull(property: r'updatedAt'),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtEqualTo(
      int? value,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.equalTo(property: r'updatedAt', value: value),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtGreaterThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.greaterThan(
            include: include,
            property: r'updatedAt',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtLessThan(
      int? value, {
      bool include = false,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.lessThan(
            include: include,
            property: r'updatedAt',
            value: value,
          ),
        );
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> updatedAtBetween(
      int? lower,
      int? upper, {
      bool includeLower = true,
      bool includeUpper = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addFilterCondition(
          FilterCondition.between(
            property: r'updatedAt',
            lower: lower,
            includeLower: includeLower,
            upper: upper,
            includeUpper: includeUpper,
          ),
        );
      });
    }
  }
  
  extension HistoryQueryObject
      on QueryBuilder<History, History, QFilterCondition> {}
  
  extension HistoryQueryLinks
      on QueryBuilder<History, History, QFilterCondition> {
    QueryBuilder<History, History, QAfterFilterCondition> chapter(
      FilterQuery<Chapter> q,
    ) {
      return QueryBuilder.apply(this, (query) {
        return query.link(q, r'chapter');
      });
    }
  
    QueryBuilder<History, History, QAfterFilterCondition> chapterIsNull() {
      return QueryBuilder.apply(this, (query) {
        return query.linkLength(r'chapter', 0, true, 0, true);
      });
    }
  }
  
  extension HistoryQuerySortBy on QueryBuilder<History, History, QSortBy> {
    QueryBuilder<History, History, QAfterSortBy> sortByChapterId() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'chapterId', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByChapterIdDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'chapterId', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByDate() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'date', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByDateDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'date', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByIsManga() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'isManga', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByIsMangaDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'isManga', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByItemType() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'itemType', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByItemTypeDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'itemType', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByMangaId() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'mangaId', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByMangaIdDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'mangaId', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByUpdatedAt() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'updatedAt', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> sortByUpdatedAtDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'updatedAt', Sort.desc);
      });
    }
  }
  
  extension HistoryQuerySortThenBy
      on QueryBuilder<History, History, QSortThenBy> {
    QueryBuilder<History, History, QAfterSortBy> thenByChapterId() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'chapterId', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByChapterIdDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'chapterId', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByDate() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'date', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByDateDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'date', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenById() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'id', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByIdDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'id', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByIsManga() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'isManga', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByIsMangaDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'isManga', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByItemType() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'itemType', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByItemTypeDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'itemType', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByMangaId() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'mangaId', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByMangaIdDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'mangaId', Sort.desc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByUpdatedAt() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'updatedAt', Sort.asc);
      });
    }
  
    QueryBuilder<History, History, QAfterSortBy> thenByUpdatedAtDesc() {
      return QueryBuilder.apply(this, (query) {
        return query.addSortBy(r'updatedAt', Sort.desc);
      });
    }
  }
  
  extension HistoryQueryWhereDistinct
      on QueryBuilder<History, History, QDistinct> {
    QueryBuilder<History, History, QDistinct> distinctByChapterId() {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'chapterId');
      });
    }
  
    QueryBuilder<History, History, QDistinct> distinctByDate({
      bool caseSensitive = true,
    }) {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'date', caseSensitive: caseSensitive);
      });
    }
  
    QueryBuilder<History, History, QDistinct> distinctByIsManga() {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'isManga');
      });
    }
  
    QueryBuilder<History, History, QDistinct> distinctByItemType() {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'itemType');
      });
    }
  
    QueryBuilder<History, History, QDistinct> distinctByMangaId() {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'mangaId');
      });
    }
  
    QueryBuilder<History, History, QDistinct> distinctByUpdatedAt() {
      return QueryBuilder.apply(this, (query) {
        return query.addDistinctBy(r'updatedAt');
      });
    }
  }
  
  extension HistoryQueryProperty
      on QueryBuilder<History, History, QQueryProperty> {
    QueryBuilder<History, int, QQueryOperations> idProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'id');
      });
    }
  
    QueryBuilder<History, int?, QQueryOperations> chapterIdProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'chapterId');
      });
    }
  
    QueryBuilder<History, String?, QQueryOperations> dateProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'date');
      });
    }
  
    QueryBuilder<History, bool?, QQueryOperations> isMangaProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'isManga');
      });
    }
  
    QueryBuilder<History, ItemType, QQueryOperations> itemTypeProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'itemType');
      });
    }
  
    QueryBuilder<History, int?, QQueryOperations> mangaIdProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'mangaId');
      });
    }
  
    QueryBuilder<History, int?, QQueryOperations> updatedAtProperty() {
      return QueryBuilder.apply(this, (query) {
        return query.addPropertyName(r'updatedAt');
      });
    }
  }
  