// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'database.dart';

// ignore_for_file: type=lint
class $SessionsTable extends Sessions with TableInfo<$SessionsTable, Session> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $SessionsTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _titleMeta = const VerificationMeta('title');
  @override
  late final GeneratedColumn<String> title = GeneratedColumn<String>(
      'title', aliasedName, false,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32),
      type: DriftSqlType.string,
      requiredDuringInsert: true);
  static const VerificationMeta _contentMeta =
      const VerificationMeta('content');
  @override
  late final GeneratedColumn<String> content = GeneratedColumn<String>(
      'body', aliasedName, false,
      type: DriftSqlType.string, requiredDuringInsert: true);
  static const VerificationMeta _statusMeta = const VerificationMeta('status');
  @override
  late final GeneratedColumnWithTypeConverter<SessionStatus, String> status =
      GeneratedColumn<String>('status', aliasedName, false,
              type: DriftSqlType.string, requiredDuringInsert: true)
          .withConverter<SessionStatus>($SessionsTable.$converterstatus);
  static const VerificationMeta _achievementsMeta =
      const VerificationMeta('achievements');
  @override
  late final GeneratedColumn<String> achievements = GeneratedColumn<String>(
      'achievements', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _addressMeta =
      const VerificationMeta('address');
  @override
  late final GeneratedColumn<String> address = GeneratedColumn<String>(
      'address', aliasedName, true,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256),
      type: DriftSqlType.string,
      requiredDuringInsert: false);
  static const VerificationMeta _dateMeta = const VerificationMeta('date');
  @override
  late final GeneratedColumn<DateTime> date = GeneratedColumn<DateTime>(
      'date', aliasedName, true,
      type: DriftSqlType.dateTime, requiredDuringInsert: false);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns =>
      [id, title, content, status, achievements, address, date, createdAt];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'sessions';
  @override
  VerificationContext validateIntegrity(Insertable<Session> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('title')) {
      context.handle(
          _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
    } else if (isInserting) {
      context.missing(_titleMeta);
    }
    if (data.containsKey('body')) {
      context.handle(_contentMeta,
          content.isAcceptableOrUnknown(data['body']!, _contentMeta));
    } else if (isInserting) {
      context.missing(_contentMeta);
    }
    context.handle(_statusMeta, const VerificationResult.success());
    if (data.containsKey('achievements')) {
      context.handle(
          _achievementsMeta,
          achievements.isAcceptableOrUnknown(
              data['achievements']!, _achievementsMeta));
    }
    if (data.containsKey('address')) {
      context.handle(_addressMeta,
          address.isAcceptableOrUnknown(data['address']!, _addressMeta));
    }
    if (data.containsKey('date')) {
      context.handle(
          _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta));
    }
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  Session map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return Session(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      title: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}title'])!,
      content: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}body'])!,
      status: $SessionsTable.$converterstatus.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}status'])!),
      achievements: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}achievements']),
      address: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}address']),
      date: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}date']),
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $SessionsTable createAlias(String alias) {
    return $SessionsTable(attachedDatabase, alias);
  }

  static JsonTypeConverter2<SessionStatus, String, String> $converterstatus =
      const EnumNameConverter<SessionStatus>(SessionStatus.values);
}

class Session extends DataClass implements Insertable<Session> {
  final int id;
  final String title;
  final String content;
  final SessionStatus status;
  final String? achievements;
  final String? address;
  final DateTime? date;
  final DateTime createdAt;
  const Session(
      {required this.id,
      required this.title,
      required this.content,
      required this.status,
      this.achievements,
      this.address,
      this.date,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['title'] = Variable<String>(title);
    map['body'] = Variable<String>(content);
    {
      map['status'] =
          Variable<String>($SessionsTable.$converterstatus.toSql(status));
    }
    if (!nullToAbsent || achievements != null) {
      map['achievements'] = Variable<String>(achievements);
    }
    if (!nullToAbsent || address != null) {
      map['address'] = Variable<String>(address);
    }
    if (!nullToAbsent || date != null) {
      map['date'] = Variable<DateTime>(date);
    }
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  SessionsCompanion toCompanion(bool nullToAbsent) {
    return SessionsCompanion(
      id: Value(id),
      title: Value(title),
      content: Value(content),
      status: Value(status),
      achievements: achievements == null && nullToAbsent
          ? const Value.absent()
          : Value(achievements),
      address: address == null && nullToAbsent
          ? const Value.absent()
          : Value(address),
      date: date == null && nullToAbsent ? const Value.absent() : Value(date),
      createdAt: Value(createdAt),
    );
  }

  factory Session.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return Session(
      id: serializer.fromJson<int>(json['id']),
      title: serializer.fromJson<String>(json['title']),
      content: serializer.fromJson<String>(json['content']),
      status: $SessionsTable.$converterstatus
          .fromJson(serializer.fromJson<String>(json['status'])),
      achievements: serializer.fromJson<String?>(json['achievements']),
      address: serializer.fromJson<String?>(json['address']),
      date: serializer.fromJson<DateTime?>(json['date']),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'title': serializer.toJson<String>(title),
      'content': serializer.toJson<String>(content),
      'status': serializer
          .toJson<String>($SessionsTable.$converterstatus.toJson(status)),
      'achievements': serializer.toJson<String?>(achievements),
      'address': serializer.toJson<String?>(address),
      'date': serializer.toJson<DateTime?>(date),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  Session copyWith(
          {int? id,
          String? title,
          String? content,
          SessionStatus? status,
          Value<String?> achievements = const Value.absent(),
          Value<String?> address = const Value.absent(),
          Value<DateTime?> date = const Value.absent(),
          DateTime? createdAt}) =>
      Session(
        id: id ?? this.id,
        title: title ?? this.title,
        content: content ?? this.content,
        status: status ?? this.status,
        achievements:
            achievements.present ? achievements.value : this.achievements,
        address: address.present ? address.value : this.address,
        date: date.present ? date.value : this.date,
        createdAt: createdAt ?? this.createdAt,
      );
  Session copyWithCompanion(SessionsCompanion data) {
    return Session(
      id: data.id.present ? data.id.value : this.id,
      title: data.title.present ? data.title.value : this.title,
      content: data.content.present ? data.content.value : this.content,
      status: data.status.present ? data.status.value : this.status,
      achievements: data.achievements.present
          ? data.achievements.value
          : this.achievements,
      address: data.address.present ? data.address.value : this.address,
      date: data.date.present ? data.date.value : this.date,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('Session(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('content: $content, ')
          ..write('status: $status, ')
          ..write('achievements: $achievements, ')
          ..write('address: $address, ')
          ..write('date: $date, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode => Object.hash(
      id, title, content, status, achievements, address, date, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is Session &&
          other.id == this.id &&
          other.title == this.title &&
          other.content == this.content &&
          other.status == this.status &&
          other.achievements == this.achievements &&
          other.address == this.address &&
          other.date == this.date &&
          other.createdAt == this.createdAt);
}

class SessionsCompanion extends UpdateCompanion<Session> {
  final Value<int> id;
  final Value<String> title;
  final Value<String> content;
  final Value<SessionStatus> status;
  final Value<String?> achievements;
  final Value<String?> address;
  final Value<DateTime?> date;
  final Value<DateTime> createdAt;
  const SessionsCompanion({
    this.id = const Value.absent(),
    this.title = const Value.absent(),
    this.content = const Value.absent(),
    this.status = const Value.absent(),
    this.achievements = const Value.absent(),
    this.address = const Value.absent(),
    this.date = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  SessionsCompanion.insert({
    this.id = const Value.absent(),
    required String title,
    required String content,
    required SessionStatus status,
    this.achievements = const Value.absent(),
    this.address = const Value.absent(),
    this.date = const Value.absent(),
    this.createdAt = const Value.absent(),
  })  : title = Value(title),
        content = Value(content),
        status = Value(status);
  static Insertable<Session> custom({
    Expression<int>? id,
    Expression<String>? title,
    Expression<String>? content,
    Expression<String>? status,
    Expression<String>? achievements,
    Expression<String>? address,
    Expression<DateTime>? date,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (title != null) 'title': title,
      if (content != null) 'body': content,
      if (status != null) 'status': status,
      if (achievements != null) 'achievements': achievements,
      if (address != null) 'address': address,
      if (date != null) 'date': date,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  SessionsCompanion copyWith(
      {Value<int>? id,
      Value<String>? title,
      Value<String>? content,
      Value<SessionStatus>? status,
      Value<String?>? achievements,
      Value<String?>? address,
      Value<DateTime?>? date,
      Value<DateTime>? createdAt}) {
    return SessionsCompanion(
      id: id ?? this.id,
      title: title ?? this.title,
      content: content ?? this.content,
      status: status ?? this.status,
      achievements: achievements ?? this.achievements,
      address: address ?? this.address,
      date: date ?? this.date,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (title.present) {
      map['title'] = Variable<String>(title.value);
    }
    if (content.present) {
      map['body'] = Variable<String>(content.value);
    }
    if (status.present) {
      map['status'] =
          Variable<String>($SessionsTable.$converterstatus.toSql(status.value));
    }
    if (achievements.present) {
      map['achievements'] = Variable<String>(achievements.value);
    }
    if (address.present) {
      map['address'] = Variable<String>(address.value);
    }
    if (date.present) {
      map['date'] = Variable<DateTime>(date.value);
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('SessionsCompanion(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('content: $content, ')
          ..write('status: $status, ')
          ..write('achievements: $achievements, ')
          ..write('address: $address, ')
          ..write('date: $date, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $ActivitiesTable extends Activities
    with TableInfo<$ActivitiesTable, Activity> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $ActivitiesTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _titleMeta = const VerificationMeta('title');
  @override
  late final GeneratedColumn<String> title = GeneratedColumn<String>(
      'title', aliasedName, false,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100),
      type: DriftSqlType.string,
      requiredDuringInsert: true);
  static const VerificationMeta _typeMeta = const VerificationMeta('type');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityType?, String> type =
      GeneratedColumn<String>('type', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityType?>($ActivitiesTable.$convertertypen);
  static const VerificationMeta _descriptionMeta =
      const VerificationMeta('description');
  @override
  late final GeneratedColumn<String> description = GeneratedColumn<String>(
      'body', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _categoryMeta =
      const VerificationMeta('category');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityCategories?, String>
      category = GeneratedColumn<String>('category', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityCategories?>(
              $ActivitiesTable.$convertercategoryn);
  static const VerificationMeta _forceMeta = const VerificationMeta('force');
  @override
  late final GeneratedColumn<String> force = GeneratedColumn<String>(
      'force', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _levelMeta = const VerificationMeta('level');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityLevel?, String> level =
      GeneratedColumn<String>('level', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityLevel?>($ActivitiesTable.$converterleveln);
  static const VerificationMeta _mechanicMeta =
      const VerificationMeta('mechanic');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityMechanic?, String>
      mechanic = GeneratedColumn<String>('mechanic', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityMechanic?>(
              $ActivitiesTable.$convertermechanicn);
  static const VerificationMeta _equipmentMeta =
      const VerificationMeta('equipment');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityEquipment?, String>
      equipment = GeneratedColumn<String>('equipment', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityEquipment?>(
              $ActivitiesTable.$converterequipmentn);
  static const VerificationMeta _primaryMusclesMeta =
      const VerificationMeta('primaryMuscles');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityMuscle?, String>
      primaryMuscles = GeneratedColumn<String>(
              'primary_muscles', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityMuscle?>(
              $ActivitiesTable.$converterprimaryMusclesn);
  static const VerificationMeta _secondaryMusclesMeta =
      const VerificationMeta('secondaryMuscles');
  @override
  late final GeneratedColumnWithTypeConverter<ActivityMuscle?, String>
      secondaryMuscles = GeneratedColumn<String>(
              'secondary_muscles', aliasedName, true,
              type: DriftSqlType.string, requiredDuringInsert: false)
          .withConverter<ActivityMuscle?>(
              $ActivitiesTable.$convertersecondaryMusclesn);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns => [
        id,
        title,
        type,
        description,
        category,
        force,
        level,
        mechanic,
        equipment,
        primaryMuscles,
        secondaryMuscles,
        createdAt
      ];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'activities';
  @override
  VerificationContext validateIntegrity(Insertable<Activity> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('title')) {
      context.handle(
          _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
    } else if (isInserting) {
      context.missing(_titleMeta);
    }
    context.handle(_typeMeta, const VerificationResult.success());
    if (data.containsKey('body')) {
      context.handle(_descriptionMeta,
          description.isAcceptableOrUnknown(data['body']!, _descriptionMeta));
    }
    context.handle(_categoryMeta, const VerificationResult.success());
    if (data.containsKey('force')) {
      context.handle(
          _forceMeta, force.isAcceptableOrUnknown(data['force']!, _forceMeta));
    }
    context.handle(_levelMeta, const VerificationResult.success());
    context.handle(_mechanicMeta, const VerificationResult.success());
    context.handle(_equipmentMeta, const VerificationResult.success());
    context.handle(_primaryMusclesMeta, const VerificationResult.success());
    context.handle(_secondaryMusclesMeta, const VerificationResult.success());
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  Activity map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return Activity(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      title: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}title'])!,
      type: $ActivitiesTable.$convertertypen.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}type'])),
      description: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}body']),
      category: $ActivitiesTable.$convertercategoryn.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}category'])),
      force: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}force']),
      level: $ActivitiesTable.$converterleveln.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}level'])),
      mechanic: $ActivitiesTable.$convertermechanicn.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}mechanic'])),
      equipment: $ActivitiesTable.$converterequipmentn.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}equipment'])),
      primaryMuscles: $ActivitiesTable.$converterprimaryMusclesn.fromSql(
          attachedDatabase.typeMapping.read(
              DriftSqlType.string, data['${effectivePrefix}primary_muscles'])),
      secondaryMuscles: $ActivitiesTable.$convertersecondaryMusclesn.fromSql(
          attachedDatabase.typeMapping.read(DriftSqlType.string,
              data['${effectivePrefix}secondary_muscles'])),
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $ActivitiesTable createAlias(String alias) {
    return $ActivitiesTable(attachedDatabase, alias);
  }

  static JsonTypeConverter2<ActivityType, String, String> $convertertype =
      const EnumNameConverter<ActivityType>(ActivityType.values);
  static JsonTypeConverter2<ActivityType?, String?, String?> $convertertypen =
      JsonTypeConverter2.asNullable($convertertype);
  static JsonTypeConverter2<ActivityCategories, String, String>
      $convertercategory =
      const EnumNameConverter<ActivityCategories>(ActivityCategories.values);
  static JsonTypeConverter2<ActivityCategories?, String?, String?>
      $convertercategoryn = JsonTypeConverter2.asNullable($convertercategory);
  static JsonTypeConverter2<ActivityLevel, String, String> $converterlevel =
      const EnumNameConverter<ActivityLevel>(ActivityLevel.values);
  static JsonTypeConverter2<ActivityLevel?, String?, String?> $converterleveln =
      JsonTypeConverter2.asNullable($converterlevel);
  static JsonTypeConverter2<ActivityMechanic, String, String>
      $convertermechanic =
      const EnumNameConverter<ActivityMechanic>(ActivityMechanic.values);
  static JsonTypeConverter2<ActivityMechanic?, String?, String?>
      $convertermechanicn = JsonTypeConverter2.asNullable($convertermechanic);
  static JsonTypeConverter2<ActivityEquipment, String, String>
      $converterequipment =
      const EnumNameConverter<ActivityEquipment>(ActivityEquipment.values);
  static JsonTypeConverter2<ActivityEquipment?, String?, String?>
      $converterequipmentn = JsonTypeConverter2.asNullable($converterequipment);
  static JsonTypeConverter2<ActivityMuscle, String, String>
      $converterprimaryMuscles =
      const EnumNameConverter<ActivityMuscle>(ActivityMuscle.values);
  static JsonTypeConverter2<ActivityMuscle?, String?, String?>
      $converterprimaryMusclesn =
      JsonTypeConverter2.asNullable($converterprimaryMuscles);
  static JsonTypeConverter2<ActivityMuscle, String, String>
      $convertersecondaryMuscles =
      const EnumNameConverter<ActivityMuscle>(ActivityMuscle.values);
  static JsonTypeConverter2<ActivityMuscle?, String?, String?>
      $convertersecondaryMusclesn =
      JsonTypeConverter2.asNullable($convertersecondaryMuscles);
}

class Activity extends DataClass implements Insertable<Activity> {
  final int id;
  final String title;
  final ActivityType? type;
  final String? description;
  final ActivityCategories? category;
  final String? force;
  final ActivityLevel? level;
  final ActivityMechanic? mechanic;
  final ActivityEquipment? equipment;
  final ActivityMuscle? primaryMuscles;
  final ActivityMuscle? secondaryMuscles;
  final DateTime createdAt;
  const Activity(
      {required this.id,
      required this.title,
      this.type,
      this.description,
      this.category,
      this.force,
      this.level,
      this.mechanic,
      this.equipment,
      this.primaryMuscles,
      this.secondaryMuscles,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['title'] = Variable<String>(title);
    if (!nullToAbsent || type != null) {
      map['type'] =
          Variable<String>($ActivitiesTable.$convertertypen.toSql(type));
    }
    if (!nullToAbsent || description != null) {
      map['body'] = Variable<String>(description);
    }
    if (!nullToAbsent || category != null) {
      map['category'] = Variable<String>(
          $ActivitiesTable.$convertercategoryn.toSql(category));
    }
    if (!nullToAbsent || force != null) {
      map['force'] = Variable<String>(force);
    }
    if (!nullToAbsent || level != null) {
      map['level'] =
          Variable<String>($ActivitiesTable.$converterleveln.toSql(level));
    }
    if (!nullToAbsent || mechanic != null) {
      map['mechanic'] = Variable<String>(
          $ActivitiesTable.$convertermechanicn.toSql(mechanic));
    }
    if (!nullToAbsent || equipment != null) {
      map['equipment'] = Variable<String>(
          $ActivitiesTable.$converterequipmentn.toSql(equipment));
    }
    if (!nullToAbsent || primaryMuscles != null) {
      map['primary_muscles'] = Variable<String>(
          $ActivitiesTable.$converterprimaryMusclesn.toSql(primaryMuscles));
    }
    if (!nullToAbsent || secondaryMuscles != null) {
      map['secondary_muscles'] = Variable<String>(
          $ActivitiesTable.$convertersecondaryMusclesn.toSql(secondaryMuscles));
    }
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  ActivitiesCompanion toCompanion(bool nullToAbsent) {
    return ActivitiesCompanion(
      id: Value(id),
      title: Value(title),
      type: type == null && nullToAbsent ? const Value.absent() : Value(type),
      description: description == null && nullToAbsent
          ? const Value.absent()
          : Value(description),
      category: category == null && nullToAbsent
          ? const Value.absent()
          : Value(category),
      force:
          force == null && nullToAbsent ? const Value.absent() : Value(force),
      level:
          level == null && nullToAbsent ? const Value.absent() : Value(level),
      mechanic: mechanic == null && nullToAbsent
          ? const Value.absent()
          : Value(mechanic),
      equipment: equipment == null && nullToAbsent
          ? const Value.absent()
          : Value(equipment),
      primaryMuscles: primaryMuscles == null && nullToAbsent
          ? const Value.absent()
          : Value(primaryMuscles),
      secondaryMuscles: secondaryMuscles == null && nullToAbsent
          ? const Value.absent()
          : Value(secondaryMuscles),
      createdAt: Value(createdAt),
    );
  }

  factory Activity.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return Activity(
      id: serializer.fromJson<int>(json['id']),
      title: serializer.fromJson<String>(json['title']),
      type: $ActivitiesTable.$convertertypen
          .fromJson(serializer.fromJson<String?>(json['type'])),
      description: serializer.fromJson<String?>(json['description']),
      category: $ActivitiesTable.$convertercategoryn
          .fromJson(serializer.fromJson<String?>(json['category'])),
      force: serializer.fromJson<String?>(json['force']),
      level: $ActivitiesTable.$converterleveln
          .fromJson(serializer.fromJson<String?>(json['level'])),
      mechanic: $ActivitiesTable.$convertermechanicn
          .fromJson(serializer.fromJson<String?>(json['mechanic'])),
      equipment: $ActivitiesTable.$converterequipmentn
          .fromJson(serializer.fromJson<String?>(json['equipment'])),
      primaryMuscles: $ActivitiesTable.$converterprimaryMusclesn
          .fromJson(serializer.fromJson<String?>(json['primaryMuscles'])),
      secondaryMuscles: $ActivitiesTable.$convertersecondaryMusclesn
          .fromJson(serializer.fromJson<String?>(json['secondaryMuscles'])),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'title': serializer.toJson<String>(title),
      'type': serializer
          .toJson<String?>($ActivitiesTable.$convertertypen.toJson(type)),
      'description': serializer.toJson<String?>(description),
      'category': serializer.toJson<String?>(
          $ActivitiesTable.$convertercategoryn.toJson(category)),
      'force': serializer.toJson<String?>(force),
      'level': serializer
          .toJson<String?>($ActivitiesTable.$converterleveln.toJson(level)),
      'mechanic': serializer.toJson<String?>(
          $ActivitiesTable.$convertermechanicn.toJson(mechanic)),
      'equipment': serializer.toJson<String?>(
          $ActivitiesTable.$converterequipmentn.toJson(equipment)),
      'primaryMuscles': serializer.toJson<String?>(
          $ActivitiesTable.$converterprimaryMusclesn.toJson(primaryMuscles)),
      'secondaryMuscles': serializer.toJson<String?>($ActivitiesTable
          .$convertersecondaryMusclesn
          .toJson(secondaryMuscles)),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  Activity copyWith(
          {int? id,
          String? title,
          Value<ActivityType?> type = const Value.absent(),
          Value<String?> description = const Value.absent(),
          Value<ActivityCategories?> category = const Value.absent(),
          Value<String?> force = const Value.absent(),
          Value<ActivityLevel?> level = const Value.absent(),
          Value<ActivityMechanic?> mechanic = const Value.absent(),
          Value<ActivityEquipment?> equipment = const Value.absent(),
          Value<ActivityMuscle?> primaryMuscles = const Value.absent(),
          Value<ActivityMuscle?> secondaryMuscles = const Value.absent(),
          DateTime? createdAt}) =>
      Activity(
        id: id ?? this.id,
        title: title ?? this.title,
        type: type.present ? type.value : this.type,
        description: description.present ? description.value : this.description,
        category: category.present ? category.value : this.category,
        force: force.present ? force.value : this.force,
        level: level.present ? level.value : this.level,
        mechanic: mechanic.present ? mechanic.value : this.mechanic,
        equipment: equipment.present ? equipment.value : this.equipment,
        primaryMuscles:
            primaryMuscles.present ? primaryMuscles.value : this.primaryMuscles,
        secondaryMuscles: secondaryMuscles.present
            ? secondaryMuscles.value
            : this.secondaryMuscles,
        createdAt: createdAt ?? this.createdAt,
      );
  Activity copyWithCompanion(ActivitiesCompanion data) {
    return Activity(
      id: data.id.present ? data.id.value : this.id,
      title: data.title.present ? data.title.value : this.title,
      type: data.type.present ? data.type.value : this.type,
      description:
          data.description.present ? data.description.value : this.description,
      category: data.category.present ? data.category.value : this.category,
      force: data.force.present ? data.force.value : this.force,
      level: data.level.present ? data.level.value : this.level,
      mechanic: data.mechanic.present ? data.mechanic.value : this.mechanic,
      equipment: data.equipment.present ? data.equipment.value : this.equipment,
      primaryMuscles: data.primaryMuscles.present
          ? data.primaryMuscles.value
          : this.primaryMuscles,
      secondaryMuscles: data.secondaryMuscles.present
          ? data.secondaryMuscles.value
          : this.secondaryMuscles,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('Activity(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('type: $type, ')
          ..write('description: $description, ')
          ..write('category: $category, ')
          ..write('force: $force, ')
          ..write('level: $level, ')
          ..write('mechanic: $mechanic, ')
          ..write('equipment: $equipment, ')
          ..write('primaryMuscles: $primaryMuscles, ')
          ..write('secondaryMuscles: $secondaryMuscles, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode => Object.hash(id, title, type, description, category, force,
      level, mechanic, equipment, primaryMuscles, secondaryMuscles, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is Activity &&
          other.id == this.id &&
          other.title == this.title &&
          other.type == this.type &&
          other.description == this.description &&
          other.category == this.category &&
          other.force == this.force &&
          other.level == this.level &&
          other.mechanic == this.mechanic &&
          other.equipment == this.equipment &&
          other.primaryMuscles == this.primaryMuscles &&
          other.secondaryMuscles == this.secondaryMuscles &&
          other.createdAt == this.createdAt);
}

class ActivitiesCompanion extends UpdateCompanion<Activity> {
  final Value<int> id;
  final Value<String> title;
  final Value<ActivityType?> type;
  final Value<String?> description;
  final Value<ActivityCategories?> category;
  final Value<String?> force;
  final Value<ActivityLevel?> level;
  final Value<ActivityMechanic?> mechanic;
  final Value<ActivityEquipment?> equipment;
  final Value<ActivityMuscle?> primaryMuscles;
  final Value<ActivityMuscle?> secondaryMuscles;
  final Value<DateTime> createdAt;
  const ActivitiesCompanion({
    this.id = const Value.absent(),
    this.title = const Value.absent(),
    this.type = const Value.absent(),
    this.description = const Value.absent(),
    this.category = const Value.absent(),
    this.force = const Value.absent(),
    this.level = const Value.absent(),
    this.mechanic = const Value.absent(),
    this.equipment = const Value.absent(),
    this.primaryMuscles = const Value.absent(),
    this.secondaryMuscles = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  ActivitiesCompanion.insert({
    this.id = const Value.absent(),
    required String title,
    this.type = const Value.absent(),
    this.description = const Value.absent(),
    this.category = const Value.absent(),
    this.force = const Value.absent(),
    this.level = const Value.absent(),
    this.mechanic = const Value.absent(),
    this.equipment = const Value.absent(),
    this.primaryMuscles = const Value.absent(),
    this.secondaryMuscles = const Value.absent(),
    this.createdAt = const Value.absent(),
  }) : title = Value(title);
  static Insertable<Activity> custom({
    Expression<int>? id,
    Expression<String>? title,
    Expression<String>? type,
    Expression<String>? description,
    Expression<String>? category,
    Expression<String>? force,
    Expression<String>? level,
    Expression<String>? mechanic,
    Expression<String>? equipment,
    Expression<String>? primaryMuscles,
    Expression<String>? secondaryMuscles,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (title != null) 'title': title,
      if (type != null) 'type': type,
      if (description != null) 'body': description,
      if (category != null) 'category': category,
      if (force != null) 'force': force,
      if (level != null) 'level': level,
      if (mechanic != null) 'mechanic': mechanic,
      if (equipment != null) 'equipment': equipment,
      if (primaryMuscles != null) 'primary_muscles': primaryMuscles,
      if (secondaryMuscles != null) 'secondary_muscles': secondaryMuscles,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  ActivitiesCompanion copyWith(
      {Value<int>? id,
      Value<String>? title,
      Value<ActivityType?>? type,
      Value<String?>? description,
      Value<ActivityCategories?>? category,
      Value<String?>? force,
      Value<ActivityLevel?>? level,
      Value<ActivityMechanic?>? mechanic,
      Value<ActivityEquipment?>? equipment,
      Value<ActivityMuscle?>? primaryMuscles,
      Value<ActivityMuscle?>? secondaryMuscles,
      Value<DateTime>? createdAt}) {
    return ActivitiesCompanion(
      id: id ?? this.id,
      title: title ?? this.title,
      type: type ?? this.type,
      description: description ?? this.description,
      category: category ?? this.category,
      force: force ?? this.force,
      level: level ?? this.level,
      mechanic: mechanic ?? this.mechanic,
      equipment: equipment ?? this.equipment,
      primaryMuscles: primaryMuscles ?? this.primaryMuscles,
      secondaryMuscles: secondaryMuscles ?? this.secondaryMuscles,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (title.present) {
      map['title'] = Variable<String>(title.value);
    }
    if (type.present) {
      map['type'] =
          Variable<String>($ActivitiesTable.$convertertypen.toSql(type.value));
    }
    if (description.present) {
      map['body'] = Variable<String>(description.value);
    }
    if (category.present) {
      map['category'] = Variable<String>(
          $ActivitiesTable.$convertercategoryn.toSql(category.value));
    }
    if (force.present) {
      map['force'] = Variable<String>(force.value);
    }
    if (level.present) {
      map['level'] = Variable<String>(
          $ActivitiesTable.$converterleveln.toSql(level.value));
    }
    if (mechanic.present) {
      map['mechanic'] = Variable<String>(
          $ActivitiesTable.$convertermechanicn.toSql(mechanic.value));
    }
    if (equipment.present) {
      map['equipment'] = Variable<String>(
          $ActivitiesTable.$converterequipmentn.toSql(equipment.value));
    }
    if (primaryMuscles.present) {
      map['primary_muscles'] = Variable<String>($ActivitiesTable
          .$converterprimaryMusclesn
          .toSql(primaryMuscles.value));
    }
    if (secondaryMuscles.present) {
      map['secondary_muscles'] = Variable<String>($ActivitiesTable
          .$convertersecondaryMusclesn
          .toSql(secondaryMuscles.value));
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('ActivitiesCompanion(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('type: $type, ')
          ..write('description: $description, ')
          ..write('category: $category, ')
          ..write('force: $force, ')
          ..write('level: $level, ')
          ..write('mechanic: $mechanic, ')
          ..write('equipment: $equipment, ')
          ..write('primaryMuscles: $primaryMuscles, ')
          ..write('secondaryMuscles: $secondaryMuscles, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $SessionActivitiesTable extends SessionActivities
    with TableInfo<$SessionActivitiesTable, SessionActivity> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $SessionActivitiesTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _sessionIdMeta =
      const VerificationMeta('sessionId');
  @override
  late final GeneratedColumn<int> sessionId = GeneratedColumn<int>(
      'session_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES sessions (id) ON DELETE CASCADE'));
  static const VerificationMeta _activityIdMeta =
      const VerificationMeta('activityId');
  @override
  late final GeneratedColumn<int> activityId = GeneratedColumn<int>(
      'activity_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES activities (id) ON DELETE CASCADE'));
  static const VerificationMeta _positionMeta =
      const VerificationMeta('position');
  @override
  late final GeneratedColumn<int> position = GeneratedColumn<int>(
      'position', aliasedName, false,
      type: DriftSqlType.int, requiredDuringInsert: true);
  static const VerificationMeta _resultsMeta =
      const VerificationMeta('results');
  @override
  late final GeneratedColumn<String> results = GeneratedColumn<String>(
      'results', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns =>
      [id, sessionId, activityId, position, results, createdAt];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'session_activities';
  @override
  VerificationContext validateIntegrity(Insertable<SessionActivity> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('session_id')) {
      context.handle(_sessionIdMeta,
          sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta));
    } else if (isInserting) {
      context.missing(_sessionIdMeta);
    }
    if (data.containsKey('activity_id')) {
      context.handle(
          _activityIdMeta,
          activityId.isAcceptableOrUnknown(
              data['activity_id']!, _activityIdMeta));
    } else if (isInserting) {
      context.missing(_activityIdMeta);
    }
    if (data.containsKey('position')) {
      context.handle(_positionMeta,
          position.isAcceptableOrUnknown(data['position']!, _positionMeta));
    } else if (isInserting) {
      context.missing(_positionMeta);
    }
    if (data.containsKey('results')) {
      context.handle(_resultsMeta,
          results.isAcceptableOrUnknown(data['results']!, _resultsMeta));
    }
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  SessionActivity map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return SessionActivity(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      sessionId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}session_id'])!,
      activityId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}activity_id'])!,
      position: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}position'])!,
      results: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}results']),
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $SessionActivitiesTable createAlias(String alias) {
    return $SessionActivitiesTable(attachedDatabase, alias);
  }
}

class SessionActivity extends DataClass implements Insertable<SessionActivity> {
  final int id;
  final int sessionId;
  final int activityId;
  final int position;
  final String? results;
  final DateTime createdAt;
  const SessionActivity(
      {required this.id,
      required this.sessionId,
      required this.activityId,
      required this.position,
      this.results,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['session_id'] = Variable<int>(sessionId);
    map['activity_id'] = Variable<int>(activityId);
    map['position'] = Variable<int>(position);
    if (!nullToAbsent || results != null) {
      map['results'] = Variable<String>(results);
    }
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  SessionActivitiesCompanion toCompanion(bool nullToAbsent) {
    return SessionActivitiesCompanion(
      id: Value(id),
      sessionId: Value(sessionId),
      activityId: Value(activityId),
      position: Value(position),
      results: results == null && nullToAbsent
          ? const Value.absent()
          : Value(results),
      createdAt: Value(createdAt),
    );
  }

  factory SessionActivity.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return SessionActivity(
      id: serializer.fromJson<int>(json['id']),
      sessionId: serializer.fromJson<int>(json['sessionId']),
      activityId: serializer.fromJson<int>(json['activityId']),
      position: serializer.fromJson<int>(json['position']),
      results: serializer.fromJson<String?>(json['results']),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'sessionId': serializer.toJson<int>(sessionId),
      'activityId': serializer.toJson<int>(activityId),
      'position': serializer.toJson<int>(position),
      'results': serializer.toJson<String?>(results),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  SessionActivity copyWith(
          {int? id,
          int? sessionId,
          int? activityId,
          int? position,
          Value<String?> results = const Value.absent(),
          DateTime? createdAt}) =>
      SessionActivity(
        id: id ?? this.id,
        sessionId: sessionId ?? this.sessionId,
        activityId: activityId ?? this.activityId,
        position: position ?? this.position,
        results: results.present ? results.value : this.results,
        createdAt: createdAt ?? this.createdAt,
      );
  SessionActivity copyWithCompanion(SessionActivitiesCompanion data) {
    return SessionActivity(
      id: data.id.present ? data.id.value : this.id,
      sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
      activityId:
          data.activityId.present ? data.activityId.value : this.activityId,
      position: data.position.present ? data.position.value : this.position,
      results: data.results.present ? data.results.value : this.results,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('SessionActivity(')
          ..write('id: $id, ')
          ..write('sessionId: $sessionId, ')
          ..write('activityId: $activityId, ')
          ..write('position: $position, ')
          ..write('results: $results, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode =>
      Object.hash(id, sessionId, activityId, position, results, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is SessionActivity &&
          other.id == this.id &&
          other.sessionId == this.sessionId &&
          other.activityId == this.activityId &&
          other.position == this.position &&
          other.results == this.results &&
          other.createdAt == this.createdAt);
}

class SessionActivitiesCompanion extends UpdateCompanion<SessionActivity> {
  final Value<int> id;
  final Value<int> sessionId;
  final Value<int> activityId;
  final Value<int> position;
  final Value<String?> results;
  final Value<DateTime> createdAt;
  const SessionActivitiesCompanion({
    this.id = const Value.absent(),
    this.sessionId = const Value.absent(),
    this.activityId = const Value.absent(),
    this.position = const Value.absent(),
    this.results = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  SessionActivitiesCompanion.insert({
    this.id = const Value.absent(),
    required int sessionId,
    required int activityId,
    required int position,
    this.results = const Value.absent(),
    this.createdAt = const Value.absent(),
  })  : sessionId = Value(sessionId),
        activityId = Value(activityId),
        position = Value(position);
  static Insertable<SessionActivity> custom({
    Expression<int>? id,
    Expression<int>? sessionId,
    Expression<int>? activityId,
    Expression<int>? position,
    Expression<String>? results,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (sessionId != null) 'session_id': sessionId,
      if (activityId != null) 'activity_id': activityId,
      if (position != null) 'position': position,
      if (results != null) 'results': results,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  SessionActivitiesCompanion copyWith(
      {Value<int>? id,
      Value<int>? sessionId,
      Value<int>? activityId,
      Value<int>? position,
      Value<String?>? results,
      Value<DateTime>? createdAt}) {
    return SessionActivitiesCompanion(
      id: id ?? this.id,
      sessionId: sessionId ?? this.sessionId,
      activityId: activityId ?? this.activityId,
      position: position ?? this.position,
      results: results ?? this.results,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (sessionId.present) {
      map['session_id'] = Variable<int>(sessionId.value);
    }
    if (activityId.present) {
      map['activity_id'] = Variable<int>(activityId.value);
    }
    if (position.present) {
      map['position'] = Variable<int>(position.value);
    }
    if (results.present) {
      map['results'] = Variable<String>(results.value);
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('SessionActivitiesCompanion(')
          ..write('id: $id, ')
          ..write('sessionId: $sessionId, ')
          ..write('activityId: $activityId, ')
          ..write('position: $position, ')
          ..write('results: $results, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $ActionsTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _titleMeta = const VerificationMeta('title');
  @override
  late final GeneratedColumn<String> title = GeneratedColumn<String>(
      'title', aliasedName, false,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64),
      type: DriftSqlType.string,
      requiredDuringInsert: true);
  static const VerificationMeta _descriptionMeta =
      const VerificationMeta('description');
  @override
  late final GeneratedColumn<String> description = GeneratedColumn<String>(
      'body', aliasedName, false,
      type: DriftSqlType.string, requiredDuringInsert: true);
  static const VerificationMeta _totalSetsMeta =
      const VerificationMeta('totalSets');
  @override
  late final GeneratedColumn<int> totalSets = GeneratedColumn<int>(
      'total_sets', aliasedName, false,
      type: DriftSqlType.int, requiredDuringInsert: true);
  static const VerificationMeta _totalRepsMeta =
      const VerificationMeta('totalReps');
  @override
  late final GeneratedColumn<String> totalReps = GeneratedColumn<String>(
      'total_reps', aliasedName, false,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32),
      type: DriftSqlType.string,
      requiredDuringInsert: true);
  static const VerificationMeta _restBeforeSetsMeta =
      const VerificationMeta('restBeforeSets');
  @override
  late final GeneratedColumn<int> restBeforeSets = GeneratedColumn<int>(
      'rest_before_sets', aliasedName, true,
      type: DriftSqlType.int, requiredDuringInsert: false);
  static const VerificationMeta _restBetweenSetsMeta =
      const VerificationMeta('restBetweenSets');
  @override
  late final GeneratedColumn<int> restBetweenSets = GeneratedColumn<int>(
      'rest_between_sets', aliasedName, true,
      type: DriftSqlType.int, requiredDuringInsert: false);
  static const VerificationMeta _restBetweenRepsMeta =
      const VerificationMeta('restBetweenReps');
  @override
  late final GeneratedColumn<int> restBetweenReps = GeneratedColumn<int>(
      'rest_between_reps', aliasedName, true,
      type: DriftSqlType.int, requiredDuringInsert: false);
  static const VerificationMeta _restAfterSetsMeta =
      const VerificationMeta('restAfterSets');
  @override
  late final GeneratedColumn<int> restAfterSets = GeneratedColumn<int>(
      'rest_after_sets', aliasedName, true,
      type: DriftSqlType.int, requiredDuringInsert: false);
  static const VerificationMeta _repTypeMeta =
      const VerificationMeta('repType');
  @override
  late final GeneratedColumnWithTypeConverter<RepType, String> repType =
      GeneratedColumn<String>('rep_type', aliasedName, false,
              type: DriftSqlType.string, requiredDuringInsert: true)
          .withConverter<RepType>($ActionsTable.$converterrepType);
  static const VerificationMeta _repLengthMeta =
      const VerificationMeta('repLength');
  @override
  late final GeneratedColumn<int> repLength = GeneratedColumn<int>(
      'rep_length', aliasedName, true,
      type: DriftSqlType.int, requiredDuringInsert: false);
  static const VerificationMeta _repWeightsMeta =
      const VerificationMeta('repWeights');
  @override
  late final GeneratedColumn<String> repWeights = GeneratedColumn<String>(
      'rep_weights', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _setWeightsMeta =
      const VerificationMeta('setWeights');
  @override
  late final GeneratedColumn<String> setWeights = GeneratedColumn<String>(
      'set_weights', aliasedName, true,
      type: DriftSqlType.string, requiredDuringInsert: false);
  static const VerificationMeta _isAlternatingMeta =
      const VerificationMeta('isAlternating');
  @override
  late final GeneratedColumn<bool> isAlternating = GeneratedColumn<bool>(
      'is_alternating', aliasedName, false,
      type: DriftSqlType.bool,
      requiredDuringInsert: false,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'CHECK ("is_alternating" IN (0, 1))'),
      defaultValue: Variable(false));
  static const VerificationMeta _tempoMeta = const VerificationMeta('tempo');
  @override
  late final GeneratedColumn<String> tempo = GeneratedColumn<String>(
      'tempo', aliasedName, true,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36),
      type: DriftSqlType.string,
      requiredDuringInsert: false);
  static const VerificationMeta _statusMeta = const VerificationMeta('status');
  @override
  late final GeneratedColumnWithTypeConverter<ActionStatus, String> status =
      GeneratedColumn<String>('status', aliasedName, false,
              type: DriftSqlType.string,
              requiredDuringInsert: false,
              defaultValue: Variable('pending'))
          .withConverter<ActionStatus>($ActionsTable.$converterstatus);
  static const VerificationMeta _stateMeta = const VerificationMeta('state');
  @override
  late final GeneratedColumn<String> state = GeneratedColumn<String>(
      'state', aliasedName, false,
      type: DriftSqlType.string,
      requiredDuringInsert: false,
      defaultValue: Variable(
          "{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}"));
  static const VerificationMeta _setMeta = const VerificationMeta('set');
  @override
  late final GeneratedColumn<String> set = GeneratedColumn<String>(
      'set', aliasedName, false,
      type: DriftSqlType.string, requiredDuringInsert: true);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns => [
        id,
        title,
        description,
        totalSets,
        totalReps,
        restBeforeSets,
        restBetweenSets,
        restBetweenReps,
        restAfterSets,
        repType,
        repLength,
        repWeights,
        setWeights,
        isAlternating,
        tempo,
        status,
        state,
        set,
        createdAt
      ];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'actions';
  @override
  VerificationContext validateIntegrity(Insertable<Action> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('title')) {
      context.handle(
          _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
    } else if (isInserting) {
      context.missing(_titleMeta);
    }
    if (data.containsKey('body')) {
      context.handle(_descriptionMeta,
          description.isAcceptableOrUnknown(data['body']!, _descriptionMeta));
    } else if (isInserting) {
      context.missing(_descriptionMeta);
    }
    if (data.containsKey('total_sets')) {
      context.handle(_totalSetsMeta,
          totalSets.isAcceptableOrUnknown(data['total_sets']!, _totalSetsMeta));
    } else if (isInserting) {
      context.missing(_totalSetsMeta);
    }
    if (data.containsKey('total_reps')) {
      context.handle(_totalRepsMeta,
          totalReps.isAcceptableOrUnknown(data['total_reps']!, _totalRepsMeta));
    } else if (isInserting) {
      context.missing(_totalRepsMeta);
    }
    if (data.containsKey('rest_before_sets')) {
      context.handle(
          _restBeforeSetsMeta,
          restBeforeSets.isAcceptableOrUnknown(
              data['rest_before_sets']!, _restBeforeSetsMeta));
    }
    if (data.containsKey('rest_between_sets')) {
      context.handle(
          _restBetweenSetsMeta,
          restBetweenSets.isAcceptableOrUnknown(
              data['rest_between_sets']!, _restBetweenSetsMeta));
    }
    if (data.containsKey('rest_between_reps')) {
      context.handle(
          _restBetweenRepsMeta,
          restBetweenReps.isAcceptableOrUnknown(
              data['rest_between_reps']!, _restBetweenRepsMeta));
    }
    if (data.containsKey('rest_after_sets')) {
      context.handle(
          _restAfterSetsMeta,
          restAfterSets.isAcceptableOrUnknown(
              data['rest_after_sets']!, _restAfterSetsMeta));
    }
    context.handle(_repTypeMeta, const VerificationResult.success());
    if (data.containsKey('rep_length')) {
      context.handle(_repLengthMeta,
          repLength.isAcceptableOrUnknown(data['rep_length']!, _repLengthMeta));
    }
    if (data.containsKey('rep_weights')) {
      context.handle(
          _repWeightsMeta,
          repWeights.isAcceptableOrUnknown(
              data['rep_weights']!, _repWeightsMeta));
    }
    if (data.containsKey('set_weights')) {
      context.handle(
          _setWeightsMeta,
          setWeights.isAcceptableOrUnknown(
              data['set_weights']!, _setWeightsMeta));
    }
    if (data.containsKey('is_alternating')) {
      context.handle(
          _isAlternatingMeta,
          isAlternating.isAcceptableOrUnknown(
              data['is_alternating']!, _isAlternatingMeta));
    }
    if (data.containsKey('tempo')) {
      context.handle(
          _tempoMeta, tempo.isAcceptableOrUnknown(data['tempo']!, _tempoMeta));
    }
    context.handle(_statusMeta, const VerificationResult.success());
    if (data.containsKey('state')) {
      context.handle(
          _stateMeta, state.isAcceptableOrUnknown(data['state']!, _stateMeta));
    }
    if (data.containsKey('set')) {
      context.handle(
          _setMeta, set.isAcceptableOrUnknown(data['set']!, _setMeta));
    } else if (isInserting) {
      context.missing(_setMeta);
    }
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  Action map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return Action(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      title: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}title'])!,
      description: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}body'])!,
      totalSets: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}total_sets'])!,
      totalReps: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}total_reps'])!,
      restBeforeSets: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}rest_before_sets']),
      restBetweenSets: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}rest_between_sets']),
      restBetweenReps: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}rest_between_reps']),
      restAfterSets: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}rest_after_sets']),
      repType: $ActionsTable.$converterrepType.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}rep_type'])!),
      repLength: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}rep_length']),
      repWeights: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}rep_weights']),
      setWeights: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}set_weights']),
      isAlternating: attachedDatabase.typeMapping
          .read(DriftSqlType.bool, data['${effectivePrefix}is_alternating'])!,
      tempo: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}tempo']),
      status: $ActionsTable.$converterstatus.fromSql(attachedDatabase
          .typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}status'])!),
      state: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}state'])!,
      set: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}set'])!,
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $ActionsTable createAlias(String alias) {
    return $ActionsTable(attachedDatabase, alias);
  }

  static JsonTypeConverter2<RepType, String, String> $converterrepType =
      const EnumNameConverter<RepType>(RepType.values);
  static JsonTypeConverter2<ActionStatus, String, String> $converterstatus =
      const EnumNameConverter<ActionStatus>(ActionStatus.values);
}

class Action extends DataClass implements Insertable<Action> {
  final int id;
  final String title;
  final String description;
  final int totalSets;
  final String totalReps;
  final int? restBeforeSets;
  final int? restBetweenSets;
  final int? restBetweenReps;
  final int? restAfterSets;
  final RepType repType;
  final int? repLength;
  final String? repWeights;
  final String? setWeights;
  final bool isAlternating;
  final String? tempo;
  final ActionStatus status;
  final String state;
  final String set;
  final DateTime createdAt;
  const Action(
      {required this.id,
      required this.title,
      required this.description,
      required this.totalSets,
      required this.totalReps,
      this.restBeforeSets,
      this.restBetweenSets,
      this.restBetweenReps,
      this.restAfterSets,
      required this.repType,
      this.repLength,
      this.repWeights,
      this.setWeights,
      required this.isAlternating,
      this.tempo,
      required this.status,
      required this.state,
      required this.set,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['title'] = Variable<String>(title);
    map['body'] = Variable<String>(description);
    map['total_sets'] = Variable<int>(totalSets);
    map['total_reps'] = Variable<String>(totalReps);
    if (!nullToAbsent || restBeforeSets != null) {
      map['rest_before_sets'] = Variable<int>(restBeforeSets);
    }
    if (!nullToAbsent || restBetweenSets != null) {
      map['rest_between_sets'] = Variable<int>(restBetweenSets);
    }
    if (!nullToAbsent || restBetweenReps != null) {
      map['rest_between_reps'] = Variable<int>(restBetweenReps);
    }
    if (!nullToAbsent || restAfterSets != null) {
      map['rest_after_sets'] = Variable<int>(restAfterSets);
    }
    {
      map['rep_type'] =
          Variable<String>($ActionsTable.$converterrepType.toSql(repType));
    }
    if (!nullToAbsent || repLength != null) {
      map['rep_length'] = Variable<int>(repLength);
    }
    if (!nullToAbsent || repWeights != null) {
      map['rep_weights'] = Variable<String>(repWeights);
    }
    if (!nullToAbsent || setWeights != null) {
      map['set_weights'] = Variable<String>(setWeights);
    }
    map['is_alternating'] = Variable<bool>(isAlternating);
    if (!nullToAbsent || tempo != null) {
      map['tempo'] = Variable<String>(tempo);
    }
    {
      map['status'] =
          Variable<String>($ActionsTable.$converterstatus.toSql(status));
    }
    map['state'] = Variable<String>(state);
    map['set'] = Variable<String>(set);
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  ActionsCompanion toCompanion(bool nullToAbsent) {
    return ActionsCompanion(
      id: Value(id),
      title: Value(title),
      description: Value(description),
      totalSets: Value(totalSets),
      totalReps: Value(totalReps),
      restBeforeSets: restBeforeSets == null && nullToAbsent
          ? const Value.absent()
          : Value(restBeforeSets),
      restBetweenSets: restBetweenSets == null && nullToAbsent
          ? const Value.absent()
          : Value(restBetweenSets),
      restBetweenReps: restBetweenReps == null && nullToAbsent
          ? const Value.absent()
          : Value(restBetweenReps),
      restAfterSets: restAfterSets == null && nullToAbsent
          ? const Value.absent()
          : Value(restAfterSets),
      repType: Value(repType),
      repLength: repLength == null && nullToAbsent
          ? const Value.absent()
          : Value(repLength),
      repWeights: repWeights == null && nullToAbsent
          ? const Value.absent()
          : Value(repWeights),
      setWeights: setWeights == null && nullToAbsent
          ? const Value.absent()
          : Value(setWeights),
      isAlternating: Value(isAlternating),
      tempo:
          tempo == null && nullToAbsent ? const Value.absent() : Value(tempo),
      status: Value(status),
      state: Value(state),
      set: Value(set),
      createdAt: Value(createdAt),
    );
  }

  factory Action.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return Action(
      id: serializer.fromJson<int>(json['id']),
      title: serializer.fromJson<String>(json['title']),
      description: serializer.fromJson<String>(json['description']),
      totalSets: serializer.fromJson<int>(json['totalSets']),
      totalReps: serializer.fromJson<String>(json['totalReps']),
      restBeforeSets: serializer.fromJson<int?>(json['restBeforeSets']),
      restBetweenSets: serializer.fromJson<int?>(json['restBetweenSets']),
      restBetweenReps: serializer.fromJson<int?>(json['restBetweenReps']),
      restAfterSets: serializer.fromJson<int?>(json['restAfterSets']),
      repType: $ActionsTable.$converterrepType
          .fromJson(serializer.fromJson<String>(json['repType'])),
      repLength: serializer.fromJson<int?>(json['repLength']),
      repWeights: serializer.fromJson<String?>(json['repWeights']),
      setWeights: serializer.fromJson<String?>(json['setWeights']),
      isAlternating: serializer.fromJson<bool>(json['isAlternating']),
      tempo: serializer.fromJson<String?>(json['tempo']),
      status: $ActionsTable.$converterstatus
          .fromJson(serializer.fromJson<String>(json['status'])),
      state: serializer.fromJson<String>(json['state']),
      set: serializer.fromJson<String>(json['set']),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'title': serializer.toJson<String>(title),
      'description': serializer.toJson<String>(description),
      'totalSets': serializer.toJson<int>(totalSets),
      'totalReps': serializer.toJson<String>(totalReps),
      'restBeforeSets': serializer.toJson<int?>(restBeforeSets),
      'restBetweenSets': serializer.toJson<int?>(restBetweenSets),
      'restBetweenReps': serializer.toJson<int?>(restBetweenReps),
      'restAfterSets': serializer.toJson<int?>(restAfterSets),
      'repType': serializer
          .toJson<String>($ActionsTable.$converterrepType.toJson(repType)),
      'repLength': serializer.toJson<int?>(repLength),
      'repWeights': serializer.toJson<String?>(repWeights),
      'setWeights': serializer.toJson<String?>(setWeights),
      'isAlternating': serializer.toJson<bool>(isAlternating),
      'tempo': serializer.toJson<String?>(tempo),
      'status': serializer
          .toJson<String>($ActionsTable.$converterstatus.toJson(status)),
      'state': serializer.toJson<String>(state),
      'set': serializer.toJson<String>(set),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  Action copyWith(
          {int? id,
          String? title,
          String? description,
          int? totalSets,
          String? totalReps,
          Value<int?> restBeforeSets = const Value.absent(),
          Value<int?> restBetweenSets = const Value.absent(),
          Value<int?> restBetweenReps = const Value.absent(),
          Value<int?> restAfterSets = const Value.absent(),
          RepType? repType,
          Value<int?> repLength = const Value.absent(),
          Value<String?> repWeights = const Value.absent(),
          Value<String?> setWeights = const Value.absent(),
          bool? isAlternating,
          Value<String?> tempo = const Value.absent(),
          ActionStatus? status,
          String? state,
          String? set,
          DateTime? createdAt}) =>
      Action(
        id: id ?? this.id,
        title: title ?? this.title,
        description: description ?? this.description,
        totalSets: totalSets ?? this.totalSets,
        totalReps: totalReps ?? this.totalReps,
        restBeforeSets:
            restBeforeSets.present ? restBeforeSets.value : this.restBeforeSets,
        restBetweenSets: restBetweenSets.present
            ? restBetweenSets.value
            : this.restBetweenSets,
        restBetweenReps: restBetweenReps.present
            ? restBetweenReps.value
            : this.restBetweenReps,
        restAfterSets:
            restAfterSets.present ? restAfterSets.value : this.restAfterSets,
        repType: repType ?? this.repType,
        repLength: repLength.present ? repLength.value : this.repLength,
        repWeights: repWeights.present ? repWeights.value : this.repWeights,
        setWeights: setWeights.present ? setWeights.value : this.setWeights,
        isAlternating: isAlternating ?? this.isAlternating,
        tempo: tempo.present ? tempo.value : this.tempo,
        status: status ?? this.status,
        state: state ?? this.state,
        set: set ?? this.set,
        createdAt: createdAt ?? this.createdAt,
      );
  Action copyWithCompanion(ActionsCompanion data) {
    return Action(
      id: data.id.present ? data.id.value : this.id,
      title: data.title.present ? data.title.value : this.title,
      description:
          data.description.present ? data.description.value : this.description,
      totalSets: data.totalSets.present ? data.totalSets.value : this.totalSets,
      totalReps: data.totalReps.present ? data.totalReps.value : this.totalReps,
      restBeforeSets: data.restBeforeSets.present
          ? data.restBeforeSets.value
          : this.restBeforeSets,
      restBetweenSets: data.restBetweenSets.present
          ? data.restBetweenSets.value
          : this.restBetweenSets,
      restBetweenReps: data.restBetweenReps.present
          ? data.restBetweenReps.value
          : this.restBetweenReps,
      restAfterSets: data.restAfterSets.present
          ? data.restAfterSets.value
          : this.restAfterSets,
      repType: data.repType.present ? data.repType.value : this.repType,
      repLength: data.repLength.present ? data.repLength.value : this.repLength,
      repWeights:
          data.repWeights.present ? data.repWeights.value : this.repWeights,
      setWeights:
          data.setWeights.present ? data.setWeights.value : this.setWeights,
      isAlternating: data.isAlternating.present
          ? data.isAlternating.value
          : this.isAlternating,
      tempo: data.tempo.present ? data.tempo.value : this.tempo,
      status: data.status.present ? data.status.value : this.status,
      state: data.state.present ? data.state.value : this.state,
      set: data.set.present ? data.set.value : this.set,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('Action(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('description: $description, ')
          ..write('totalSets: $totalSets, ')
          ..write('totalReps: $totalReps, ')
          ..write('restBeforeSets: $restBeforeSets, ')
          ..write('restBetweenSets: $restBetweenSets, ')
          ..write('restBetweenReps: $restBetweenReps, ')
          ..write('restAfterSets: $restAfterSets, ')
          ..write('repType: $repType, ')
          ..write('repLength: $repLength, ')
          ..write('repWeights: $repWeights, ')
          ..write('setWeights: $setWeights, ')
          ..write('isAlternating: $isAlternating, ')
          ..write('tempo: $tempo, ')
          ..write('status: $status, ')
          ..write('state: $state, ')
          ..write('set: $set, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode => Object.hash(
      id,
      title,
      description,
      totalSets,
      totalReps,
      restBeforeSets,
      restBetweenSets,
      restBetweenReps,
      restAfterSets,
      repType,
      repLength,
      repWeights,
      setWeights,
      isAlternating,
      tempo,
      status,
      state,
      set,
      createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is Action &&
          other.id == this.id &&
          other.title == this.title &&
          other.description == this.description &&
          other.totalSets == this.totalSets &&
          other.totalReps == this.totalReps &&
          other.restBeforeSets == this.restBeforeSets &&
          other.restBetweenSets == this.restBetweenSets &&
          other.restBetweenReps == this.restBetweenReps &&
          other.restAfterSets == this.restAfterSets &&
          other.repType == this.repType &&
          other.repLength == this.repLength &&
          other.repWeights == this.repWeights &&
          other.setWeights == this.setWeights &&
          other.isAlternating == this.isAlternating &&
          other.tempo == this.tempo &&
          other.status == this.status &&
          other.state == this.state &&
          other.set == this.set &&
          other.createdAt == this.createdAt);
}

class ActionsCompanion extends UpdateCompanion<Action> {
  final Value<int> id;
  final Value<String> title;
  final Value<String> description;
  final Value<int> totalSets;
  final Value<String> totalReps;
  final Value<int?> restBeforeSets;
  final Value<int?> restBetweenSets;
  final Value<int?> restBetweenReps;
  final Value<int?> restAfterSets;
  final Value<RepType> repType;
  final Value<int?> repLength;
  final Value<String?> repWeights;
  final Value<String?> setWeights;
  final Value<bool> isAlternating;
  final Value<String?> tempo;
  final Value<ActionStatus> status;
  final Value<String> state;
  final Value<String> set;
  final Value<DateTime> createdAt;
  const ActionsCompanion({
    this.id = const Value.absent(),
    this.title = const Value.absent(),
    this.description = const Value.absent(),
    this.totalSets = const Value.absent(),
    this.totalReps = const Value.absent(),
    this.restBeforeSets = const Value.absent(),
    this.restBetweenSets = const Value.absent(),
    this.restBetweenReps = const Value.absent(),
    this.restAfterSets = const Value.absent(),
    this.repType = const Value.absent(),
    this.repLength = const Value.absent(),
    this.repWeights = const Value.absent(),
    this.setWeights = const Value.absent(),
    this.isAlternating = const Value.absent(),
    this.tempo = const Value.absent(),
    this.status = const Value.absent(),
    this.state = const Value.absent(),
    this.set = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  ActionsCompanion.insert({
    this.id = const Value.absent(),
    required String title,
    required String description,
    required int totalSets,
    required String totalReps,
    this.restBeforeSets = const Value.absent(),
    this.restBetweenSets = const Value.absent(),
    this.restBetweenReps = const Value.absent(),
    this.restAfterSets = const Value.absent(),
    required RepType repType,
    this.repLength = const Value.absent(),
    this.repWeights = const Value.absent(),
    this.setWeights = const Value.absent(),
    this.isAlternating = const Value.absent(),
    this.tempo = const Value.absent(),
    this.status = const Value.absent(),
    this.state = const Value.absent(),
    required String set,
    this.createdAt = const Value.absent(),
  })  : title = Value(title),
        description = Value(description),
        totalSets = Value(totalSets),
        totalReps = Value(totalReps),
        repType = Value(repType),
        set = Value(set);
  static Insertable<Action> custom({
    Expression<int>? id,
    Expression<String>? title,
    Expression<String>? description,
    Expression<int>? totalSets,
    Expression<String>? totalReps,
    Expression<int>? restBeforeSets,
    Expression<int>? restBetweenSets,
    Expression<int>? restBetweenReps,
    Expression<int>? restAfterSets,
    Expression<String>? repType,
    Expression<int>? repLength,
    Expression<String>? repWeights,
    Expression<String>? setWeights,
    Expression<bool>? isAlternating,
    Expression<String>? tempo,
    Expression<String>? status,
    Expression<String>? state,
    Expression<String>? set,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (title != null) 'title': title,
      if (description != null) 'body': description,
      if (totalSets != null) 'total_sets': totalSets,
      if (totalReps != null) 'total_reps': totalReps,
      if (restBeforeSets != null) 'rest_before_sets': restBeforeSets,
      if (restBetweenSets != null) 'rest_between_sets': restBetweenSets,
      if (restBetweenReps != null) 'rest_between_reps': restBetweenReps,
      if (restAfterSets != null) 'rest_after_sets': restAfterSets,
      if (repType != null) 'rep_type': repType,
      if (repLength != null) 'rep_length': repLength,
      if (repWeights != null) 'rep_weights': repWeights,
      if (setWeights != null) 'set_weights': setWeights,
      if (isAlternating != null) 'is_alternating': isAlternating,
      if (tempo != null) 'tempo': tempo,
      if (status != null) 'status': status,
      if (state != null) 'state': state,
      if (set != null) 'set': set,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  ActionsCompanion copyWith(
      {Value<int>? id,
      Value<String>? title,
      Value<String>? description,
      Value<int>? totalSets,
      Value<String>? totalReps,
      Value<int?>? restBeforeSets,
      Value<int?>? restBetweenSets,
      Value<int?>? restBetweenReps,
      Value<int?>? restAfterSets,
      Value<RepType>? repType,
      Value<int?>? repLength,
      Value<String?>? repWeights,
      Value<String?>? setWeights,
      Value<bool>? isAlternating,
      Value<String?>? tempo,
      Value<ActionStatus>? status,
      Value<String>? state,
      Value<String>? set,
      Value<DateTime>? createdAt}) {
    return ActionsCompanion(
      id: id ?? this.id,
      title: title ?? this.title,
      description: description ?? this.description,
      totalSets: totalSets ?? this.totalSets,
      totalReps: totalReps ?? this.totalReps,
      restBeforeSets: restBeforeSets ?? this.restBeforeSets,
      restBetweenSets: restBetweenSets ?? this.restBetweenSets,
      restBetweenReps: restBetweenReps ?? this.restBetweenReps,
      restAfterSets: restAfterSets ?? this.restAfterSets,
      repType: repType ?? this.repType,
      repLength: repLength ?? this.repLength,
      repWeights: repWeights ?? this.repWeights,
      setWeights: setWeights ?? this.setWeights,
      isAlternating: isAlternating ?? this.isAlternating,
      tempo: tempo ?? this.tempo,
      status: status ?? this.status,
      state: state ?? this.state,
      set: set ?? this.set,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (title.present) {
      map['title'] = Variable<String>(title.value);
    }
    if (description.present) {
      map['body'] = Variable<String>(description.value);
    }
    if (totalSets.present) {
      map['total_sets'] = Variable<int>(totalSets.value);
    }
    if (totalReps.present) {
      map['total_reps'] = Variable<String>(totalReps.value);
    }
    if (restBeforeSets.present) {
      map['rest_before_sets'] = Variable<int>(restBeforeSets.value);
    }
    if (restBetweenSets.present) {
      map['rest_between_sets'] = Variable<int>(restBetweenSets.value);
    }
    if (restBetweenReps.present) {
      map['rest_between_reps'] = Variable<int>(restBetweenReps.value);
    }
    if (restAfterSets.present) {
      map['rest_after_sets'] = Variable<int>(restAfterSets.value);
    }
    if (repType.present) {
      map['rep_type'] = Variable<String>(
          $ActionsTable.$converterrepType.toSql(repType.value));
    }
    if (repLength.present) {
      map['rep_length'] = Variable<int>(repLength.value);
    }
    if (repWeights.present) {
      map['rep_weights'] = Variable<String>(repWeights.value);
    }
    if (setWeights.present) {
      map['set_weights'] = Variable<String>(setWeights.value);
    }
    if (isAlternating.present) {
      map['is_alternating'] = Variable<bool>(isAlternating.value);
    }
    if (tempo.present) {
      map['tempo'] = Variable<String>(tempo.value);
    }
    if (status.present) {
      map['status'] =
          Variable<String>($ActionsTable.$converterstatus.toSql(status.value));
    }
    if (state.present) {
      map['state'] = Variable<String>(state.value);
    }
    if (set.present) {
      map['set'] = Variable<String>(set.value);
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('ActionsCompanion(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('description: $description, ')
          ..write('totalSets: $totalSets, ')
          ..write('totalReps: $totalReps, ')
          ..write('restBeforeSets: $restBeforeSets, ')
          ..write('restBetweenSets: $restBetweenSets, ')
          ..write('restBetweenReps: $restBetweenReps, ')
          ..write('restAfterSets: $restAfterSets, ')
          ..write('repType: $repType, ')
          ..write('repLength: $repLength, ')
          ..write('repWeights: $repWeights, ')
          ..write('setWeights: $setWeights, ')
          ..write('isAlternating: $isAlternating, ')
          ..write('tempo: $tempo, ')
          ..write('status: $status, ')
          ..write('state: $state, ')
          ..write('set: $set, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $ActivityActionsTable extends ActivityActions
    with TableInfo<$ActivityActionsTable, ActivityAction> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $ActivityActionsTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _activityIdMeta =
      const VerificationMeta('activityId');
  @override
  late final GeneratedColumn<int> activityId = GeneratedColumn<int>(
      'activity_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES activities (id) ON DELETE CASCADE'));
  static const VerificationMeta _actionIdMeta =
      const VerificationMeta('actionId');
  @override
  late final GeneratedColumn<int> actionId = GeneratedColumn<int>(
      'action_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES actions (id) ON DELETE CASCADE'));
  static const VerificationMeta _sessionIdMeta =
      const VerificationMeta('sessionId');
  @override
  late final GeneratedColumn<int> sessionId = GeneratedColumn<int>(
      'session_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES sessions (id) ON DELETE CASCADE'));
  static const VerificationMeta _positionMeta =
      const VerificationMeta('position');
  @override
  late final GeneratedColumn<int> position = GeneratedColumn<int>(
      'position', aliasedName, false,
      type: DriftSqlType.int, requiredDuringInsert: true);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns =>
      [id, activityId, actionId, sessionId, position, createdAt];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'activity_actions';
  @override
  VerificationContext validateIntegrity(Insertable<ActivityAction> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('activity_id')) {
      context.handle(
          _activityIdMeta,
          activityId.isAcceptableOrUnknown(
              data['activity_id']!, _activityIdMeta));
    } else if (isInserting) {
      context.missing(_activityIdMeta);
    }
    if (data.containsKey('action_id')) {
      context.handle(_actionIdMeta,
          actionId.isAcceptableOrUnknown(data['action_id']!, _actionIdMeta));
    } else if (isInserting) {
      context.missing(_actionIdMeta);
    }
    if (data.containsKey('session_id')) {
      context.handle(_sessionIdMeta,
          sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta));
    } else if (isInserting) {
      context.missing(_sessionIdMeta);
    }
    if (data.containsKey('position')) {
      context.handle(_positionMeta,
          position.isAcceptableOrUnknown(data['position']!, _positionMeta));
    } else if (isInserting) {
      context.missing(_positionMeta);
    }
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  ActivityAction map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return ActivityAction(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      activityId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}activity_id'])!,
      actionId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}action_id'])!,
      sessionId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}session_id'])!,
      position: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}position'])!,
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $ActivityActionsTable createAlias(String alias) {
    return $ActivityActionsTable(attachedDatabase, alias);
  }
}

class ActivityAction extends DataClass implements Insertable<ActivityAction> {
  final int id;
  final int activityId;
  final int actionId;
  final int sessionId;
  final int position;
  final DateTime createdAt;
  const ActivityAction(
      {required this.id,
      required this.activityId,
      required this.actionId,
      required this.sessionId,
      required this.position,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['activity_id'] = Variable<int>(activityId);
    map['action_id'] = Variable<int>(actionId);
    map['session_id'] = Variable<int>(sessionId);
    map['position'] = Variable<int>(position);
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  ActivityActionsCompanion toCompanion(bool nullToAbsent) {
    return ActivityActionsCompanion(
      id: Value(id),
      activityId: Value(activityId),
      actionId: Value(actionId),
      sessionId: Value(sessionId),
      position: Value(position),
      createdAt: Value(createdAt),
    );
  }

  factory ActivityAction.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return ActivityAction(
      id: serializer.fromJson<int>(json['id']),
      activityId: serializer.fromJson<int>(json['activityId']),
      actionId: serializer.fromJson<int>(json['actionId']),
      sessionId: serializer.fromJson<int>(json['sessionId']),
      position: serializer.fromJson<int>(json['position']),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'activityId': serializer.toJson<int>(activityId),
      'actionId': serializer.toJson<int>(actionId),
      'sessionId': serializer.toJson<int>(sessionId),
      'position': serializer.toJson<int>(position),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  ActivityAction copyWith(
          {int? id,
          int? activityId,
          int? actionId,
          int? sessionId,
          int? position,
          DateTime? createdAt}) =>
      ActivityAction(
        id: id ?? this.id,
        activityId: activityId ?? this.activityId,
        actionId: actionId ?? this.actionId,
        sessionId: sessionId ?? this.sessionId,
        position: position ?? this.position,
        createdAt: createdAt ?? this.createdAt,
      );
  ActivityAction copyWithCompanion(ActivityActionsCompanion data) {
    return ActivityAction(
      id: data.id.present ? data.id.value : this.id,
      activityId:
          data.activityId.present ? data.activityId.value : this.activityId,
      actionId: data.actionId.present ? data.actionId.value : this.actionId,
      sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
      position: data.position.present ? data.position.value : this.position,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('ActivityAction(')
          ..write('id: $id, ')
          ..write('activityId: $activityId, ')
          ..write('actionId: $actionId, ')
          ..write('sessionId: $sessionId, ')
          ..write('position: $position, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode =>
      Object.hash(id, activityId, actionId, sessionId, position, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is ActivityAction &&
          other.id == this.id &&
          other.activityId == this.activityId &&
          other.actionId == this.actionId &&
          other.sessionId == this.sessionId &&
          other.position == this.position &&
          other.createdAt == this.createdAt);
}

class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
  final Value<int> id;
  final Value<int> activityId;
  final Value<int> actionId;
  final Value<int> sessionId;
  final Value<int> position;
  final Value<DateTime> createdAt;
  const ActivityActionsCompanion({
    this.id = const Value.absent(),
    this.activityId = const Value.absent(),
    this.actionId = const Value.absent(),
    this.sessionId = const Value.absent(),
    this.position = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  ActivityActionsCompanion.insert({
    this.id = const Value.absent(),
    required int activityId,
    required int actionId,
    required int sessionId,
    required int position,
    this.createdAt = const Value.absent(),
  })  : activityId = Value(activityId),
        actionId = Value(actionId),
        sessionId = Value(sessionId),
        position = Value(position);
  static Insertable<ActivityAction> custom({
    Expression<int>? id,
    Expression<int>? activityId,
    Expression<int>? actionId,
    Expression<int>? sessionId,
    Expression<int>? position,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (activityId != null) 'activity_id': activityId,
      if (actionId != null) 'action_id': actionId,
      if (sessionId != null) 'session_id': sessionId,
      if (position != null) 'position': position,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  ActivityActionsCompanion copyWith(
      {Value<int>? id,
      Value<int>? activityId,
      Value<int>? actionId,
      Value<int>? sessionId,
      Value<int>? position,
      Value<DateTime>? createdAt}) {
    return ActivityActionsCompanion(
      id: id ?? this.id,
      activityId: activityId ?? this.activityId,
      actionId: actionId ?? this.actionId,
      sessionId: sessionId ?? this.sessionId,
      position: position ?? this.position,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (activityId.present) {
      map['activity_id'] = Variable<int>(activityId.value);
    }
    if (actionId.present) {
      map['action_id'] = Variable<int>(actionId.value);
    }
    if (sessionId.present) {
      map['session_id'] = Variable<int>(sessionId.value);
    }
    if (position.present) {
      map['position'] = Variable<int>(position.value);
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('ActivityActionsCompanion(')
          ..write('id: $id, ')
          ..write('activityId: $activityId, ')
          ..write('actionId: $actionId, ')
          ..write('sessionId: $sessionId, ')
          ..write('position: $position, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $MediaItemsTable extends MediaItems
    with TableInfo<$MediaItemsTable, MediaItem> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $MediaItemsTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _titleMeta = const VerificationMeta('title');
  @override
  late final GeneratedColumn<String> title = GeneratedColumn<String>(
      'title', aliasedName, false,
      additionalChecks:
          GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64),
      type: DriftSqlType.string,
      requiredDuringInsert: true);
  static const VerificationMeta _descriptionMeta =
      const VerificationMeta('description');
  @override
  late final GeneratedColumn<String> description = GeneratedColumn<String>(
      'body', aliasedName, false,
      type: DriftSqlType.string, requiredDuringInsert: true);
  static const VerificationMeta _referenceMeta =
      const VerificationMeta('reference');
  @override
  late final GeneratedColumn<String> reference = GeneratedColumn<String>(
      'reference', aliasedName, false,
      type: DriftSqlType.string, requiredDuringInsert: true);
  static const VerificationMeta _typeMeta = const VerificationMeta('type');
  @override
  late final GeneratedColumnWithTypeConverter<MediaType, String> type =
      GeneratedColumn<String>('type', aliasedName, false,
              type: DriftSqlType.string, requiredDuringInsert: true)
          .withConverter<MediaType>($MediaItemsTable.$convertertype);
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns =>
      [id, title, description, reference, type, createdAt];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'media_items';
  @override
  VerificationContext validateIntegrity(Insertable<MediaItem> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('title')) {
      context.handle(
          _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
    } else if (isInserting) {
      context.missing(_titleMeta);
    }
    if (data.containsKey('body')) {
      context.handle(_descriptionMeta,
          description.isAcceptableOrUnknown(data['body']!, _descriptionMeta));
    } else if (isInserting) {
      context.missing(_descriptionMeta);
    }
    if (data.containsKey('reference')) {
      context.handle(_referenceMeta,
          reference.isAcceptableOrUnknown(data['reference']!, _referenceMeta));
    } else if (isInserting) {
      context.missing(_referenceMeta);
    }
    context.handle(_typeMeta, const VerificationResult.success());
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  MediaItem map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return MediaItem(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      title: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}title'])!,
      description: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}body'])!,
      reference: attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}reference'])!,
      type: $MediaItemsTable.$convertertype.fromSql(attachedDatabase.typeMapping
          .read(DriftSqlType.string, data['${effectivePrefix}type'])!),
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $MediaItemsTable createAlias(String alias) {
    return $MediaItemsTable(attachedDatabase, alias);
  }

  static JsonTypeConverter2<MediaType, String, String> $convertertype =
      const EnumNameConverter<MediaType>(MediaType.values);
}

class MediaItem extends DataClass implements Insertable<MediaItem> {
  final int id;
  final String title;
  final String description;
  final String reference;
  final MediaType type;
  final DateTime createdAt;
  const MediaItem(
      {required this.id,
      required this.title,
      required this.description,
      required this.reference,
      required this.type,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['title'] = Variable<String>(title);
    map['body'] = Variable<String>(description);
    map['reference'] = Variable<String>(reference);
    {
      map['type'] =
          Variable<String>($MediaItemsTable.$convertertype.toSql(type));
    }
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  MediaItemsCompanion toCompanion(bool nullToAbsent) {
    return MediaItemsCompanion(
      id: Value(id),
      title: Value(title),
      description: Value(description),
      reference: Value(reference),
      type: Value(type),
      createdAt: Value(createdAt),
    );
  }

  factory MediaItem.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return MediaItem(
      id: serializer.fromJson<int>(json['id']),
      title: serializer.fromJson<String>(json['title']),
      description: serializer.fromJson<String>(json['description']),
      reference: serializer.fromJson<String>(json['reference']),
      type: $MediaItemsTable.$convertertype
          .fromJson(serializer.fromJson<String>(json['type'])),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'title': serializer.toJson<String>(title),
      'description': serializer.toJson<String>(description),
      'reference': serializer.toJson<String>(reference),
      'type': serializer
          .toJson<String>($MediaItemsTable.$convertertype.toJson(type)),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  MediaItem copyWith(
          {int? id,
          String? title,
          String? description,
          String? reference,
          MediaType? type,
          DateTime? createdAt}) =>
      MediaItem(
        id: id ?? this.id,
        title: title ?? this.title,
        description: description ?? this.description,
        reference: reference ?? this.reference,
        type: type ?? this.type,
        createdAt: createdAt ?? this.createdAt,
      );
  MediaItem copyWithCompanion(MediaItemsCompanion data) {
    return MediaItem(
      id: data.id.present ? data.id.value : this.id,
      title: data.title.present ? data.title.value : this.title,
      description:
          data.description.present ? data.description.value : this.description,
      reference: data.reference.present ? data.reference.value : this.reference,
      type: data.type.present ? data.type.value : this.type,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('MediaItem(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('description: $description, ')
          ..write('reference: $reference, ')
          ..write('type: $type, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode =>
      Object.hash(id, title, description, reference, type, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is MediaItem &&
          other.id == this.id &&
          other.title == this.title &&
          other.description == this.description &&
          other.reference == this.reference &&
          other.type == this.type &&
          other.createdAt == this.createdAt);
}

class MediaItemsCompanion extends UpdateCompanion<MediaItem> {
  final Value<int> id;
  final Value<String> title;
  final Value<String> description;
  final Value<String> reference;
  final Value<MediaType> type;
  final Value<DateTime> createdAt;
  const MediaItemsCompanion({
    this.id = const Value.absent(),
    this.title = const Value.absent(),
    this.description = const Value.absent(),
    this.reference = const Value.absent(),
    this.type = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  MediaItemsCompanion.insert({
    this.id = const Value.absent(),
    required String title,
    required String description,
    required String reference,
    required MediaType type,
    this.createdAt = const Value.absent(),
  })  : title = Value(title),
        description = Value(description),
        reference = Value(reference),
        type = Value(type);
  static Insertable<MediaItem> custom({
    Expression<int>? id,
    Expression<String>? title,
    Expression<String>? description,
    Expression<String>? reference,
    Expression<String>? type,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (title != null) 'title': title,
      if (description != null) 'body': description,
      if (reference != null) 'reference': reference,
      if (type != null) 'type': type,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  MediaItemsCompanion copyWith(
      {Value<int>? id,
      Value<String>? title,
      Value<String>? description,
      Value<String>? reference,
      Value<MediaType>? type,
      Value<DateTime>? createdAt}) {
    return MediaItemsCompanion(
      id: id ?? this.id,
      title: title ?? this.title,
      description: description ?? this.description,
      reference: reference ?? this.reference,
      type: type ?? this.type,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (title.present) {
      map['title'] = Variable<String>(title.value);
    }
    if (description.present) {
      map['body'] = Variable<String>(description.value);
    }
    if (reference.present) {
      map['reference'] = Variable<String>(reference.value);
    }
    if (type.present) {
      map['type'] =
          Variable<String>($MediaItemsTable.$convertertype.toSql(type.value));
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('MediaItemsCompanion(')
          ..write('id: $id, ')
          ..write('title: $title, ')
          ..write('description: $description, ')
          ..write('reference: $reference, ')
          ..write('type: $type, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

class $ObjectMediaItemsTable extends ObjectMediaItems
    with TableInfo<$ObjectMediaItemsTable, ObjectMediaItem> {
  @override
  final GeneratedDatabase attachedDatabase;
  final String? _alias;
  $ObjectMediaItemsTable(this.attachedDatabase, [this._alias]);
  static const VerificationMeta _idMeta = const VerificationMeta('id');
  @override
  late final GeneratedColumn<int> id = GeneratedColumn<int>(
      'id', aliasedName, false,
      hasAutoIncrement: true,
      type: DriftSqlType.int,
      requiredDuringInsert: false,
      defaultConstraints:
          GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
  static const VerificationMeta _objectIdMeta =
      const VerificationMeta('objectId');
  @override
  late final GeneratedColumn<int> objectId = GeneratedColumn<int>(
      'object_id', aliasedName, false,
      type: DriftSqlType.int, requiredDuringInsert: true);
  static const VerificationMeta _objectTypeMeta =
      const VerificationMeta('objectType');
  @override
  late final GeneratedColumnWithTypeConverter<ObjectType, String> objectType =
      GeneratedColumn<String>('object_type', aliasedName, false,
              type: DriftSqlType.string, requiredDuringInsert: true)
          .withConverter<ObjectType>(
              $ObjectMediaItemsTable.$converterobjectType);
  static const VerificationMeta _mediaIdMeta =
      const VerificationMeta('mediaId');
  @override
  late final GeneratedColumn<int> mediaId = GeneratedColumn<int>(
      'media_id', aliasedName, false,
      type: DriftSqlType.int,
      requiredDuringInsert: true,
      defaultConstraints: GeneratedColumn.constraintIsAlways(
          'REFERENCES media_items (id) ON DELETE CASCADE'));
  static const VerificationMeta _createdAtMeta =
      const VerificationMeta('createdAt');
  @override
  late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
      'created_at', aliasedName, false,
      type: DriftSqlType.dateTime,
      requiredDuringInsert: false,
      defaultValue: Variable(DateTime.now()));
  @override
  List<GeneratedColumn> get $columns =>
      [id, objectId, objectType, mediaId, createdAt];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'object_media_items';
  @override
  VerificationContext validateIntegrity(Insertable<ObjectMediaItem> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('id')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
    }
    if (data.containsKey('object_id')) {
      context.handle(_objectIdMeta,
          objectId.isAcceptableOrUnknown(data['object_id']!, _objectIdMeta));
    } else if (isInserting) {
      context.missing(_objectIdMeta);
    }
    context.handle(_objectTypeMeta, const VerificationResult.success());
    if (data.containsKey('media_id')) {
      context.handle(_mediaIdMeta,
          mediaId.isAcceptableOrUnknown(data['media_id']!, _mediaIdMeta));
    } else if (isInserting) {
      context.missing(_mediaIdMeta);
    }
    if (data.containsKey('created_at')) {
      context.handle(_createdAtMeta,
          createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  ObjectMediaItem map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return ObjectMediaItem(
      id: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
      objectId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!,
      objectType: $ObjectMediaItemsTable.$converterobjectType.fromSql(
          attachedDatabase.typeMapping.read(
              DriftSqlType.string, data['${effectivePrefix}object_type'])!),
      mediaId: attachedDatabase.typeMapping
          .read(DriftSqlType.int, data['${effectivePrefix}media_id'])!,
      createdAt: attachedDatabase.typeMapping
          .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
    );
  }

  @override
  $ObjectMediaItemsTable createAlias(String alias) {
    return $ObjectMediaItemsTable(attachedDatabase, alias);
  }

  static JsonTypeConverter2<ObjectType, String, String> $converterobjectType =
      const EnumNameConverter<ObjectType>(ObjectType.values);
}

class ObjectMediaItem extends DataClass implements Insertable<ObjectMediaItem> {
  final int id;
  final int objectId;
  final ObjectType objectType;
  final int mediaId;
  final DateTime createdAt;
  const ObjectMediaItem(
      {required this.id,
      required this.objectId,
      required this.objectType,
      required this.mediaId,
      required this.createdAt});
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    map['id'] = Variable<int>(id);
    map['object_id'] = Variable<int>(objectId);
    {
      map['object_type'] = Variable<String>(
          $ObjectMediaItemsTable.$converterobjectType.toSql(objectType));
    }
    map['media_id'] = Variable<int>(mediaId);
    map['created_at'] = Variable<DateTime>(createdAt);
    return map;
  }

  ObjectMediaItemsCompanion toCompanion(bool nullToAbsent) {
    return ObjectMediaItemsCompanion(
      id: Value(id),
      objectId: Value(objectId),
      objectType: Value(objectType),
      mediaId: Value(mediaId),
      createdAt: Value(createdAt),
    );
  }

  factory ObjectMediaItem.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return ObjectMediaItem(
      id: serializer.fromJson<int>(json['id']),
      objectId: serializer.fromJson<int>(json['objectId']),
      objectType: $ObjectMediaItemsTable.$converterobjectType
          .fromJson(serializer.fromJson<String>(json['objectType'])),
      mediaId: serializer.fromJson<int>(json['mediaId']),
      createdAt: serializer.fromJson<DateTime>(json['createdAt']),
    );
  }
  @override
  Map<String, dynamic> toJson({ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return <String, dynamic>{
      'id': serializer.toJson<int>(id),
      'objectId': serializer.toJson<int>(objectId),
      'objectType': serializer.toJson<String>(
          $ObjectMediaItemsTable.$converterobjectType.toJson(objectType)),
      'mediaId': serializer.toJson<int>(mediaId),
      'createdAt': serializer.toJson<DateTime>(createdAt),
    };
  }

  ObjectMediaItem copyWith(
          {int? id,
          int? objectId,
          ObjectType? objectType,
          int? mediaId,
          DateTime? createdAt}) =>
      ObjectMediaItem(
        id: id ?? this.id,
        objectId: objectId ?? this.objectId,
        objectType: objectType ?? this.objectType,
        mediaId: mediaId ?? this.mediaId,
        createdAt: createdAt ?? this.createdAt,
      );
  ObjectMediaItem copyWithCompanion(ObjectMediaItemsCompanion data) {
    return ObjectMediaItem(
      id: data.id.present ? data.id.value : this.id,
      objectId: data.objectId.present ? data.objectId.value : this.objectId,
      objectType:
          data.objectType.present ? data.objectType.value : this.objectType,
      mediaId: data.mediaId.present ? data.mediaId.value : this.mediaId,
      createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
    );
  }

  @override
  String toString() {
    return (StringBuffer('ObjectMediaItem(')
          ..write('id: $id, ')
          ..write('objectId: $objectId, ')
          ..write('objectType: $objectType, ')
          ..write('mediaId: $mediaId, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }

  @override
  int get hashCode => Object.hash(id, objectId, objectType, mediaId, createdAt);
  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is ObjectMediaItem &&
          other.id == this.id &&
          other.objectId == this.objectId &&
          other.objectType == this.objectType &&
          other.mediaId == this.mediaId &&
          other.createdAt == this.createdAt);
}

class ObjectMediaItemsCompanion extends UpdateCompanion<ObjectMediaItem> {
  final Value<int> id;
  final Value<int> objectId;
  final Value<ObjectType> objectType;
  final Value<int> mediaId;
  final Value<DateTime> createdAt;
  const ObjectMediaItemsCompanion({
    this.id = const Value.absent(),
    this.objectId = const Value.absent(),
    this.objectType = const Value.absent(),
    this.mediaId = const Value.absent(),
    this.createdAt = const Value.absent(),
  });
  ObjectMediaItemsCompanion.insert({
    this.id = const Value.absent(),
    required int objectId,
    required ObjectType objectType,
    required int mediaId,
    this.createdAt = const Value.absent(),
  })  : objectId = Value(objectId),
        objectType = Value(objectType),
        mediaId = Value(mediaId);
  static Insertable<ObjectMediaItem> custom({
    Expression<int>? id,
    Expression<int>? objectId,
    Expression<String>? objectType,
    Expression<int>? mediaId,
    Expression<DateTime>? createdAt,
  }) {
    return RawValuesInsertable({
      if (id != null) 'id': id,
      if (objectId != null) 'object_id': objectId,
      if (objectType != null) 'object_type': objectType,
      if (mediaId != null) 'media_id': mediaId,
      if (createdAt != null) 'created_at': createdAt,
    });
  }

  ObjectMediaItemsCompanion copyWith(
      {Value<int>? id,
      Value<int>? objectId,
      Value<ObjectType>? objectType,
      Value<int>? mediaId,
      Value<DateTime>? createdAt}) {
    return ObjectMediaItemsCompanion(
      id: id ?? this.id,
      objectId: objectId ?? this.objectId,
      objectType: objectType ?? this.objectType,
      mediaId: mediaId ?? this.mediaId,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (id.present) {
      map['id'] = Variable<int>(id.value);
    }
    if (objectId.present) {
      map['object_id'] = Variable<int>(objectId.value);
    }
    if (objectType.present) {
      map['object_type'] = Variable<String>(
          $ObjectMediaItemsTable.$converterobjectType.toSql(objectType.value));
    }
    if (mediaId.present) {
      map['media_id'] = Variable<int>(mediaId.value);
    }
    if (createdAt.present) {
      map['created_at'] = Variable<DateTime>(createdAt.value);
    }
    return map;
  }

  @override
  String toString() {
    return (StringBuffer('ObjectMediaItemsCompanion(')
          ..write('id: $id, ')
          ..write('objectId: $objectId, ')
          ..write('objectType: $objectType, ')
          ..write('mediaId: $mediaId, ')
          ..write('createdAt: $createdAt')
          ..write(')'))
        .toString();
  }
}

abstract class _$AppDatabase extends GeneratedDatabase {
  _$AppDatabase(QueryExecutor e) : super(e);
  $AppDatabaseManager get managers => $AppDatabaseManager(this);
  late final $SessionsTable sessions = $SessionsTable(this);
  late final $ActivitiesTable activities = $ActivitiesTable(this);
  late final $SessionActivitiesTable sessionActivities =
      $SessionActivitiesTable(this);
  late final $ActionsTable actions = $ActionsTable(this);
  late final $ActivityActionsTable activityActions =
      $ActivityActionsTable(this);
  late final $MediaItemsTable mediaItems = $MediaItemsTable(this);
  late final $ObjectMediaItemsTable objectMediaItems =
      $ObjectMediaItemsTable(this);
  late final SessionsDao sessionsDao = SessionsDao(this as AppDatabase);
  late final ActivitiesDao activitiesDao = ActivitiesDao(this as AppDatabase);
  late final MediaItemsDao mediaItemsDao = MediaItemsDao(this as AppDatabase);
  late final ObjectMediaItemsDao objectMediaItemsDao =
      ObjectMediaItemsDao(this as AppDatabase);
  late final SessionActivitiesDao sessionActivitiesDao =
      SessionActivitiesDao(this as AppDatabase);
  late final ActivityActionsDao activityActionsDao =
      ActivityActionsDao(this as AppDatabase);
  late final ActionsDao actionsDao = ActionsDao(this as AppDatabase);
  @override
  Iterable<TableInfo<Table, Object?>> get allTables =>
      allSchemaEntities.whereType<TableInfo<Table, Object?>>();
  @override
  List<DatabaseSchemaEntity> get allSchemaEntities => [
        sessions,
        activities,
        sessionActivities,
        actions,
        activityActions,
        mediaItems,
        objectMediaItems
      ];
  @override
  StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules(
        [
          WritePropagation(
            on: TableUpdateQuery.onTableName('sessions',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('session_activities', kind: UpdateKind.delete),
            ],
          ),
          WritePropagation(
            on: TableUpdateQuery.onTableName('activities',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('session_activities', kind: UpdateKind.delete),
            ],
          ),
          WritePropagation(
            on: TableUpdateQuery.onTableName('activities',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('activity_actions', kind: UpdateKind.delete),
            ],
          ),
          WritePropagation(
            on: TableUpdateQuery.onTableName('actions',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('activity_actions', kind: UpdateKind.delete),
            ],
          ),
          WritePropagation(
            on: TableUpdateQuery.onTableName('sessions',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('activity_actions', kind: UpdateKind.delete),
            ],
          ),
          WritePropagation(
            on: TableUpdateQuery.onTableName('media_items',
                limitUpdateKind: UpdateKind.delete),
            result: [
              TableUpdate('object_media_items', kind: UpdateKind.delete),
            ],
          ),
        ],
      );
}

typedef $$SessionsTableCreateCompanionBuilder = SessionsCompanion Function({
  Value<int> id,
  required String title,
  required String content,
  required SessionStatus status,
  Value<String?> achievements,
  Value<String?> address,
  Value<DateTime?> date,
  Value<DateTime> createdAt,
});
typedef $$SessionsTableUpdateCompanionBuilder = SessionsCompanion Function({
  Value<int> id,
  Value<String> title,
  Value<String> content,
  Value<SessionStatus> status,
  Value<String?> achievements,
  Value<String?> address,
  Value<DateTime?> date,
  Value<DateTime> createdAt,
});

final class $$SessionsTableReferences
    extends BaseReferences<_$AppDatabase, $SessionsTable, Session> {
  $$SessionsTableReferences(super.$_db, super.$_table, super.$_typedResult);

  static MultiTypedResultKey<$SessionActivitiesTable, List<SessionActivity>>
      _sessionActivitiesRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.sessionActivities,
              aliasName: $_aliasNameGenerator(
                  db.sessions.id, db.sessionActivities.sessionId));

  $$SessionActivitiesTableProcessedTableManager get sessionActivitiesRefs {
    final manager =
        $$SessionActivitiesTableTableManager($_db, $_db.sessionActivities)
            .filter((f) => f.sessionId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_sessionActivitiesRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }

  static MultiTypedResultKey<$ActivityActionsTable, List<ActivityAction>>
      _activityActionsRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.activityActions,
              aliasName: $_aliasNameGenerator(
                  db.sessions.id, db.activityActions.sessionId));

  $$ActivityActionsTableProcessedTableManager get activityActionsRefs {
    final manager =
        $$ActivityActionsTableTableManager($_db, $_db.activityActions)
            .filter((f) => f.sessionId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_activityActionsRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }
}

class $$SessionsTableFilterComposer
    extends Composer<_$AppDatabase, $SessionsTable> {
  $$SessionsTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get content => $composableBuilder(
      column: $table.content, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<SessionStatus, SessionStatus, String>
      get status => $composableBuilder(
          column: $table.status,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<String> get achievements => $composableBuilder(
      column: $table.achievements, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get address => $composableBuilder(
      column: $table.address, builder: (column) => ColumnFilters(column));

  ColumnFilters<DateTime> get date => $composableBuilder(
      column: $table.date, builder: (column) => ColumnFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  Expression<bool> sessionActivitiesRefs(
      Expression<bool> Function($$SessionActivitiesTableFilterComposer f) f) {
    final $$SessionActivitiesTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.sessionActivities,
        getReferencedColumn: (t) => t.sessionId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionActivitiesTableFilterComposer(
              $db: $db,
              $table: $db.sessionActivities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }

  Expression<bool> activityActionsRefs(
      Expression<bool> Function($$ActivityActionsTableFilterComposer f) f) {
    final $$ActivityActionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.sessionId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableFilterComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$SessionsTableOrderingComposer
    extends Composer<_$AppDatabase, $SessionsTable> {
  $$SessionsTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get content => $composableBuilder(
      column: $table.content, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get status => $composableBuilder(
      column: $table.status, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get achievements => $composableBuilder(
      column: $table.achievements,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get address => $composableBuilder(
      column: $table.address, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get date => $composableBuilder(
      column: $table.date, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));
}

class $$SessionsTableAnnotationComposer
    extends Composer<_$AppDatabase, $SessionsTable> {
  $$SessionsTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<String> get title =>
      $composableBuilder(column: $table.title, builder: (column) => column);

  GeneratedColumn<String> get content =>
      $composableBuilder(column: $table.content, builder: (column) => column);

  GeneratedColumnWithTypeConverter<SessionStatus, String> get status =>
      $composableBuilder(column: $table.status, builder: (column) => column);

  GeneratedColumn<String> get achievements => $composableBuilder(
      column: $table.achievements, builder: (column) => column);

  GeneratedColumn<String> get address =>
      $composableBuilder(column: $table.address, builder: (column) => column);

  GeneratedColumn<DateTime> get date =>
      $composableBuilder(column: $table.date, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  Expression<T> sessionActivitiesRefs<T extends Object>(
      Expression<T> Function($$SessionActivitiesTableAnnotationComposer a) f) {
    final $$SessionActivitiesTableAnnotationComposer composer =
        $composerBuilder(
            composer: this,
            getCurrentColumn: (t) => t.id,
            referencedTable: $db.sessionActivities,
            getReferencedColumn: (t) => t.sessionId,
            builder: (joinBuilder,
                    {$addJoinBuilderToRootComposer,
                    $removeJoinBuilderFromRootComposer}) =>
                $$SessionActivitiesTableAnnotationComposer(
                  $db: $db,
                  $table: $db.sessionActivities,
                  $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
                  joinBuilder: joinBuilder,
                  $removeJoinBuilderFromRootComposer:
                      $removeJoinBuilderFromRootComposer,
                ));
    return f(composer);
  }

  Expression<T> activityActionsRefs<T extends Object>(
      Expression<T> Function($$ActivityActionsTableAnnotationComposer a) f) {
    final $$ActivityActionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.sessionId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableAnnotationComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$SessionsTableTableManager extends RootTableManager<
    _$AppDatabase,
    $SessionsTable,
    Session,
    $$SessionsTableFilterComposer,
    $$SessionsTableOrderingComposer,
    $$SessionsTableAnnotationComposer,
    $$SessionsTableCreateCompanionBuilder,
    $$SessionsTableUpdateCompanionBuilder,
    (Session, $$SessionsTableReferences),
    Session,
    PrefetchHooks Function(
        {bool sessionActivitiesRefs, bool activityActionsRefs})> {
  $$SessionsTableTableManager(_$AppDatabase db, $SessionsTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$SessionsTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$SessionsTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$SessionsTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<String> title = const Value.absent(),
            Value<String> content = const Value.absent(),
            Value<SessionStatus> status = const Value.absent(),
            Value<String?> achievements = const Value.absent(),
            Value<String?> address = const Value.absent(),
            Value<DateTime?> date = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              SessionsCompanion(
            id: id,
            title: title,
            content: content,
            status: status,
            achievements: achievements,
            address: address,
            date: date,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required String title,
            required String content,
            required SessionStatus status,
            Value<String?> achievements = const Value.absent(),
            Value<String?> address = const Value.absent(),
            Value<DateTime?> date = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              SessionsCompanion.insert(
            id: id,
            title: title,
            content: content,
            status: status,
            achievements: achievements,
            address: address,
            date: date,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) =>
                  (e.readTable(table), $$SessionsTableReferences(db, table, e)))
              .toList(),
          prefetchHooksCallback: (
              {sessionActivitiesRefs = false, activityActionsRefs = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [
                if (sessionActivitiesRefs) db.sessionActivities,
                if (activityActionsRefs) db.activityActions
              ],
              addJoins: null,
              getPrefetchedDataCallback: (items) async {
                return [
                  if (sessionActivitiesRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$SessionsTableReferences
                            ._sessionActivitiesRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$SessionsTableReferences(db, table, p0)
                                .sessionActivitiesRefs,
                        referencedItemsForCurrentItem:
                            (item, referencedItems) => referencedItems
                                .where((e) => e.sessionId == item.id),
                        typedResults: items),
                  if (activityActionsRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$SessionsTableReferences
                            ._activityActionsRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$SessionsTableReferences(db, table, p0)
                                .activityActionsRefs,
                        referencedItemsForCurrentItem:
                            (item, referencedItems) => referencedItems
                                .where((e) => e.sessionId == item.id),
                        typedResults: items)
                ];
              },
            );
          },
        ));
}

typedef $$SessionsTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $SessionsTable,
    Session,
    $$SessionsTableFilterComposer,
    $$SessionsTableOrderingComposer,
    $$SessionsTableAnnotationComposer,
    $$SessionsTableCreateCompanionBuilder,
    $$SessionsTableUpdateCompanionBuilder,
    (Session, $$SessionsTableReferences),
    Session,
    PrefetchHooks Function(
        {bool sessionActivitiesRefs, bool activityActionsRefs})>;
typedef $$ActivitiesTableCreateCompanionBuilder = ActivitiesCompanion Function({
  Value<int> id,
  required String title,
  Value<ActivityType?> type,
  Value<String?> description,
  Value<ActivityCategories?> category,
  Value<String?> force,
  Value<ActivityLevel?> level,
  Value<ActivityMechanic?> mechanic,
  Value<ActivityEquipment?> equipment,
  Value<ActivityMuscle?> primaryMuscles,
  Value<ActivityMuscle?> secondaryMuscles,
  Value<DateTime> createdAt,
});
typedef $$ActivitiesTableUpdateCompanionBuilder = ActivitiesCompanion Function({
  Value<int> id,
  Value<String> title,
  Value<ActivityType?> type,
  Value<String?> description,
  Value<ActivityCategories?> category,
  Value<String?> force,
  Value<ActivityLevel?> level,
  Value<ActivityMechanic?> mechanic,
  Value<ActivityEquipment?> equipment,
  Value<ActivityMuscle?> primaryMuscles,
  Value<ActivityMuscle?> secondaryMuscles,
  Value<DateTime> createdAt,
});

final class $$ActivitiesTableReferences
    extends BaseReferences<_$AppDatabase, $ActivitiesTable, Activity> {
  $$ActivitiesTableReferences(super.$_db, super.$_table, super.$_typedResult);

  static MultiTypedResultKey<$SessionActivitiesTable, List<SessionActivity>>
      _sessionActivitiesRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.sessionActivities,
              aliasName: $_aliasNameGenerator(
                  db.activities.id, db.sessionActivities.activityId));

  $$SessionActivitiesTableProcessedTableManager get sessionActivitiesRefs {
    final manager =
        $$SessionActivitiesTableTableManager($_db, $_db.sessionActivities)
            .filter((f) => f.activityId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_sessionActivitiesRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }

  static MultiTypedResultKey<$ActivityActionsTable, List<ActivityAction>>
      _activityActionsRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.activityActions,
              aliasName: $_aliasNameGenerator(
                  db.activities.id, db.activityActions.activityId));

  $$ActivityActionsTableProcessedTableManager get activityActionsRefs {
    final manager =
        $$ActivityActionsTableTableManager($_db, $_db.activityActions)
            .filter((f) => f.activityId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_activityActionsRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }
}

class $$ActivitiesTableFilterComposer
    extends Composer<_$AppDatabase, $ActivitiesTable> {
  $$ActivitiesTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<ActivityType?, ActivityType, String>
      get type => $composableBuilder(
          column: $table.type,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<ActivityCategories?, ActivityCategories,
          String>
      get category => $composableBuilder(
          column: $table.category,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<String> get force => $composableBuilder(
      column: $table.force, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<ActivityLevel?, ActivityLevel, String>
      get level => $composableBuilder(
          column: $table.level,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnWithTypeConverterFilters<ActivityMechanic?, ActivityMechanic, String>
      get mechanic => $composableBuilder(
          column: $table.mechanic,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnWithTypeConverterFilters<ActivityEquipment?, ActivityEquipment, String>
      get equipment => $composableBuilder(
          column: $table.equipment,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnWithTypeConverterFilters<ActivityMuscle?, ActivityMuscle, String>
      get primaryMuscles => $composableBuilder(
          column: $table.primaryMuscles,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnWithTypeConverterFilters<ActivityMuscle?, ActivityMuscle, String>
      get secondaryMuscles => $composableBuilder(
          column: $table.secondaryMuscles,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  Expression<bool> sessionActivitiesRefs(
      Expression<bool> Function($$SessionActivitiesTableFilterComposer f) f) {
    final $$SessionActivitiesTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.sessionActivities,
        getReferencedColumn: (t) => t.activityId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionActivitiesTableFilterComposer(
              $db: $db,
              $table: $db.sessionActivities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }

  Expression<bool> activityActionsRefs(
      Expression<bool> Function($$ActivityActionsTableFilterComposer f) f) {
    final $$ActivityActionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.activityId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableFilterComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$ActivitiesTableOrderingComposer
    extends Composer<_$AppDatabase, $ActivitiesTable> {
  $$ActivitiesTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get type => $composableBuilder(
      column: $table.type, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get category => $composableBuilder(
      column: $table.category, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get force => $composableBuilder(
      column: $table.force, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get level => $composableBuilder(
      column: $table.level, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get mechanic => $composableBuilder(
      column: $table.mechanic, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get equipment => $composableBuilder(
      column: $table.equipment, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get primaryMuscles => $composableBuilder(
      column: $table.primaryMuscles,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get secondaryMuscles => $composableBuilder(
      column: $table.secondaryMuscles,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));
}

class $$ActivitiesTableAnnotationComposer
    extends Composer<_$AppDatabase, $ActivitiesTable> {
  $$ActivitiesTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<String> get title =>
      $composableBuilder(column: $table.title, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityType?, String> get type =>
      $composableBuilder(column: $table.type, builder: (column) => column);

  GeneratedColumn<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityCategories?, String> get category =>
      $composableBuilder(column: $table.category, builder: (column) => column);

  GeneratedColumn<String> get force =>
      $composableBuilder(column: $table.force, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityLevel?, String> get level =>
      $composableBuilder(column: $table.level, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityMechanic?, String> get mechanic =>
      $composableBuilder(column: $table.mechanic, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityEquipment?, String> get equipment =>
      $composableBuilder(column: $table.equipment, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityMuscle?, String>
      get primaryMuscles => $composableBuilder(
          column: $table.primaryMuscles, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActivityMuscle?, String>
      get secondaryMuscles => $composableBuilder(
          column: $table.secondaryMuscles, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  Expression<T> sessionActivitiesRefs<T extends Object>(
      Expression<T> Function($$SessionActivitiesTableAnnotationComposer a) f) {
    final $$SessionActivitiesTableAnnotationComposer composer =
        $composerBuilder(
            composer: this,
            getCurrentColumn: (t) => t.id,
            referencedTable: $db.sessionActivities,
            getReferencedColumn: (t) => t.activityId,
            builder: (joinBuilder,
                    {$addJoinBuilderToRootComposer,
                    $removeJoinBuilderFromRootComposer}) =>
                $$SessionActivitiesTableAnnotationComposer(
                  $db: $db,
                  $table: $db.sessionActivities,
                  $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
                  joinBuilder: joinBuilder,
                  $removeJoinBuilderFromRootComposer:
                      $removeJoinBuilderFromRootComposer,
                ));
    return f(composer);
  }

  Expression<T> activityActionsRefs<T extends Object>(
      Expression<T> Function($$ActivityActionsTableAnnotationComposer a) f) {
    final $$ActivityActionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.activityId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableAnnotationComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$ActivitiesTableTableManager extends RootTableManager<
    _$AppDatabase,
    $ActivitiesTable,
    Activity,
    $$ActivitiesTableFilterComposer,
    $$ActivitiesTableOrderingComposer,
    $$ActivitiesTableAnnotationComposer,
    $$ActivitiesTableCreateCompanionBuilder,
    $$ActivitiesTableUpdateCompanionBuilder,
    (Activity, $$ActivitiesTableReferences),
    Activity,
    PrefetchHooks Function(
        {bool sessionActivitiesRefs, bool activityActionsRefs})> {
  $$ActivitiesTableTableManager(_$AppDatabase db, $ActivitiesTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$ActivitiesTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$ActivitiesTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$ActivitiesTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<String> title = const Value.absent(),
            Value<ActivityType?> type = const Value.absent(),
            Value<String?> description = const Value.absent(),
            Value<ActivityCategories?> category = const Value.absent(),
            Value<String?> force = const Value.absent(),
            Value<ActivityLevel?> level = const Value.absent(),
            Value<ActivityMechanic?> mechanic = const Value.absent(),
            Value<ActivityEquipment?> equipment = const Value.absent(),
            Value<ActivityMuscle?> primaryMuscles = const Value.absent(),
            Value<ActivityMuscle?> secondaryMuscles = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActivitiesCompanion(
            id: id,
            title: title,
            type: type,
            description: description,
            category: category,
            force: force,
            level: level,
            mechanic: mechanic,
            equipment: equipment,
            primaryMuscles: primaryMuscles,
            secondaryMuscles: secondaryMuscles,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required String title,
            Value<ActivityType?> type = const Value.absent(),
            Value<String?> description = const Value.absent(),
            Value<ActivityCategories?> category = const Value.absent(),
            Value<String?> force = const Value.absent(),
            Value<ActivityLevel?> level = const Value.absent(),
            Value<ActivityMechanic?> mechanic = const Value.absent(),
            Value<ActivityEquipment?> equipment = const Value.absent(),
            Value<ActivityMuscle?> primaryMuscles = const Value.absent(),
            Value<ActivityMuscle?> secondaryMuscles = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActivitiesCompanion.insert(
            id: id,
            title: title,
            type: type,
            description: description,
            category: category,
            force: force,
            level: level,
            mechanic: mechanic,
            equipment: equipment,
            primaryMuscles: primaryMuscles,
            secondaryMuscles: secondaryMuscles,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) => (
                    e.readTable(table),
                    $$ActivitiesTableReferences(db, table, e)
                  ))
              .toList(),
          prefetchHooksCallback: (
              {sessionActivitiesRefs = false, activityActionsRefs = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [
                if (sessionActivitiesRefs) db.sessionActivities,
                if (activityActionsRefs) db.activityActions
              ],
              addJoins: null,
              getPrefetchedDataCallback: (items) async {
                return [
                  if (sessionActivitiesRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$ActivitiesTableReferences
                            ._sessionActivitiesRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$ActivitiesTableReferences(db, table, p0)
                                .sessionActivitiesRefs,
                        referencedItemsForCurrentItem:
                            (item, referencedItems) => referencedItems
                                .where((e) => e.activityId == item.id),
                        typedResults: items),
                  if (activityActionsRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$ActivitiesTableReferences
                            ._activityActionsRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$ActivitiesTableReferences(db, table, p0)
                                .activityActionsRefs,
                        referencedItemsForCurrentItem:
                            (item, referencedItems) => referencedItems
                                .where((e) => e.activityId == item.id),
                        typedResults: items)
                ];
              },
            );
          },
        ));
}

typedef $$ActivitiesTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $ActivitiesTable,
    Activity,
    $$ActivitiesTableFilterComposer,
    $$ActivitiesTableOrderingComposer,
    $$ActivitiesTableAnnotationComposer,
    $$ActivitiesTableCreateCompanionBuilder,
    $$ActivitiesTableUpdateCompanionBuilder,
    (Activity, $$ActivitiesTableReferences),
    Activity,
    PrefetchHooks Function(
        {bool sessionActivitiesRefs, bool activityActionsRefs})>;
typedef $$SessionActivitiesTableCreateCompanionBuilder
    = SessionActivitiesCompanion Function({
  Value<int> id,
  required int sessionId,
  required int activityId,
  required int position,
  Value<String?> results,
  Value<DateTime> createdAt,
});
typedef $$SessionActivitiesTableUpdateCompanionBuilder
    = SessionActivitiesCompanion Function({
  Value<int> id,
  Value<int> sessionId,
  Value<int> activityId,
  Value<int> position,
  Value<String?> results,
  Value<DateTime> createdAt,
});

final class $$SessionActivitiesTableReferences extends BaseReferences<
    _$AppDatabase, $SessionActivitiesTable, SessionActivity> {
  $$SessionActivitiesTableReferences(
      super.$_db, super.$_table, super.$_typedResult);

  static $SessionsTable _sessionIdTable(_$AppDatabase db) =>
      db.sessions.createAlias(
          $_aliasNameGenerator(db.sessionActivities.sessionId, db.sessions.id));

  $$SessionsTableProcessedTableManager get sessionId {
    final manager = $$SessionsTableTableManager($_db, $_db.sessions)
        .filter((f) => f.id($_item.sessionId!));
    final item = $_typedResult.readTableOrNull(_sessionIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }

  static $ActivitiesTable _activityIdTable(_$AppDatabase db) =>
      db.activities.createAlias($_aliasNameGenerator(
          db.sessionActivities.activityId, db.activities.id));

  $$ActivitiesTableProcessedTableManager get activityId {
    final manager = $$ActivitiesTableTableManager($_db, $_db.activities)
        .filter((f) => f.id($_item.activityId!));
    final item = $_typedResult.readTableOrNull(_activityIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }
}

class $$SessionActivitiesTableFilterComposer
    extends Composer<_$AppDatabase, $SessionActivitiesTable> {
  $$SessionActivitiesTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get position => $composableBuilder(
      column: $table.position, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get results => $composableBuilder(
      column: $table.results, builder: (column) => ColumnFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  $$SessionsTableFilterComposer get sessionId {
    final $$SessionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableFilterComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActivitiesTableFilterComposer get activityId {
    final $$ActivitiesTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableFilterComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$SessionActivitiesTableOrderingComposer
    extends Composer<_$AppDatabase, $SessionActivitiesTable> {
  $$SessionActivitiesTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get position => $composableBuilder(
      column: $table.position, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get results => $composableBuilder(
      column: $table.results, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));

  $$SessionsTableOrderingComposer get sessionId {
    final $$SessionsTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableOrderingComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActivitiesTableOrderingComposer get activityId {
    final $$ActivitiesTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableOrderingComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$SessionActivitiesTableAnnotationComposer
    extends Composer<_$AppDatabase, $SessionActivitiesTable> {
  $$SessionActivitiesTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<int> get position =>
      $composableBuilder(column: $table.position, builder: (column) => column);

  GeneratedColumn<String> get results =>
      $composableBuilder(column: $table.results, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  $$SessionsTableAnnotationComposer get sessionId {
    final $$SessionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableAnnotationComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActivitiesTableAnnotationComposer get activityId {
    final $$ActivitiesTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableAnnotationComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$SessionActivitiesTableTableManager extends RootTableManager<
    _$AppDatabase,
    $SessionActivitiesTable,
    SessionActivity,
    $$SessionActivitiesTableFilterComposer,
    $$SessionActivitiesTableOrderingComposer,
    $$SessionActivitiesTableAnnotationComposer,
    $$SessionActivitiesTableCreateCompanionBuilder,
    $$SessionActivitiesTableUpdateCompanionBuilder,
    (SessionActivity, $$SessionActivitiesTableReferences),
    SessionActivity,
    PrefetchHooks Function({bool sessionId, bool activityId})> {
  $$SessionActivitiesTableTableManager(
      _$AppDatabase db, $SessionActivitiesTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$SessionActivitiesTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$SessionActivitiesTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$SessionActivitiesTableAnnotationComposer(
                  $db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<int> sessionId = const Value.absent(),
            Value<int> activityId = const Value.absent(),
            Value<int> position = const Value.absent(),
            Value<String?> results = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              SessionActivitiesCompanion(
            id: id,
            sessionId: sessionId,
            activityId: activityId,
            position: position,
            results: results,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required int sessionId,
            required int activityId,
            required int position,
            Value<String?> results = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              SessionActivitiesCompanion.insert(
            id: id,
            sessionId: sessionId,
            activityId: activityId,
            position: position,
            results: results,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) => (
                    e.readTable(table),
                    $$SessionActivitiesTableReferences(db, table, e)
                  ))
              .toList(),
          prefetchHooksCallback: ({sessionId = false, activityId = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [],
              addJoins: <
                  T extends TableManagerState<
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic>>(state) {
                if (sessionId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.sessionId,
                    referencedTable:
                        $$SessionActivitiesTableReferences._sessionIdTable(db),
                    referencedColumn: $$SessionActivitiesTableReferences
                        ._sessionIdTable(db)
                        .id,
                  ) as T;
                }
                if (activityId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.activityId,
                    referencedTable:
                        $$SessionActivitiesTableReferences._activityIdTable(db),
                    referencedColumn: $$SessionActivitiesTableReferences
                        ._activityIdTable(db)
                        .id,
                  ) as T;
                }

                return state;
              },
              getPrefetchedDataCallback: (items) async {
                return [];
              },
            );
          },
        ));
}

typedef $$SessionActivitiesTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $SessionActivitiesTable,
    SessionActivity,
    $$SessionActivitiesTableFilterComposer,
    $$SessionActivitiesTableOrderingComposer,
    $$SessionActivitiesTableAnnotationComposer,
    $$SessionActivitiesTableCreateCompanionBuilder,
    $$SessionActivitiesTableUpdateCompanionBuilder,
    (SessionActivity, $$SessionActivitiesTableReferences),
    SessionActivity,
    PrefetchHooks Function({bool sessionId, bool activityId})>;
typedef $$ActionsTableCreateCompanionBuilder = ActionsCompanion Function({
  Value<int> id,
  required String title,
  required String description,
  required int totalSets,
  required String totalReps,
  Value<int?> restBeforeSets,
  Value<int?> restBetweenSets,
  Value<int?> restBetweenReps,
  Value<int?> restAfterSets,
  required RepType repType,
  Value<int?> repLength,
  Value<String?> repWeights,
  Value<String?> setWeights,
  Value<bool> isAlternating,
  Value<String?> tempo,
  Value<ActionStatus> status,
  Value<String> state,
  required String set,
  Value<DateTime> createdAt,
});
typedef $$ActionsTableUpdateCompanionBuilder = ActionsCompanion Function({
  Value<int> id,
  Value<String> title,
  Value<String> description,
  Value<int> totalSets,
  Value<String> totalReps,
  Value<int?> restBeforeSets,
  Value<int?> restBetweenSets,
  Value<int?> restBetweenReps,
  Value<int?> restAfterSets,
  Value<RepType> repType,
  Value<int?> repLength,
  Value<String?> repWeights,
  Value<String?> setWeights,
  Value<bool> isAlternating,
  Value<String?> tempo,
  Value<ActionStatus> status,
  Value<String> state,
  Value<String> set,
  Value<DateTime> createdAt,
});

final class $$ActionsTableReferences
    extends BaseReferences<_$AppDatabase, $ActionsTable, Action> {
  $$ActionsTableReferences(super.$_db, super.$_table, super.$_typedResult);

  static MultiTypedResultKey<$ActivityActionsTable, List<ActivityAction>>
      _activityActionsRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.activityActions,
              aliasName: $_aliasNameGenerator(
                  db.actions.id, db.activityActions.actionId));

  $$ActivityActionsTableProcessedTableManager get activityActionsRefs {
    final manager =
        $$ActivityActionsTableTableManager($_db, $_db.activityActions)
            .filter((f) => f.actionId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_activityActionsRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }
}

class $$ActionsTableFilterComposer
    extends Composer<_$AppDatabase, $ActionsTable> {
  $$ActionsTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get totalSets => $composableBuilder(
      column: $table.totalSets, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get totalReps => $composableBuilder(
      column: $table.totalReps, builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get restBeforeSets => $composableBuilder(
      column: $table.restBeforeSets,
      builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get restBetweenSets => $composableBuilder(
      column: $table.restBetweenSets,
      builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get restBetweenReps => $composableBuilder(
      column: $table.restBetweenReps,
      builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get restAfterSets => $composableBuilder(
      column: $table.restAfterSets, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<RepType, RepType, String> get repType =>
      $composableBuilder(
          column: $table.repType,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<int> get repLength => $composableBuilder(
      column: $table.repLength, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get repWeights => $composableBuilder(
      column: $table.repWeights, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get setWeights => $composableBuilder(
      column: $table.setWeights, builder: (column) => ColumnFilters(column));

  ColumnFilters<bool> get isAlternating => $composableBuilder(
      column: $table.isAlternating, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get tempo => $composableBuilder(
      column: $table.tempo, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<ActionStatus, ActionStatus, String>
      get status => $composableBuilder(
          column: $table.status,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<String> get state => $composableBuilder(
      column: $table.state, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get set => $composableBuilder(
      column: $table.set, builder: (column) => ColumnFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  Expression<bool> activityActionsRefs(
      Expression<bool> Function($$ActivityActionsTableFilterComposer f) f) {
    final $$ActivityActionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.actionId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableFilterComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$ActionsTableOrderingComposer
    extends Composer<_$AppDatabase, $ActionsTable> {
  $$ActionsTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get totalSets => $composableBuilder(
      column: $table.totalSets, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get totalReps => $composableBuilder(
      column: $table.totalReps, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get restBeforeSets => $composableBuilder(
      column: $table.restBeforeSets,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get restBetweenSets => $composableBuilder(
      column: $table.restBetweenSets,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get restBetweenReps => $composableBuilder(
      column: $table.restBetweenReps,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get restAfterSets => $composableBuilder(
      column: $table.restAfterSets,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get repType => $composableBuilder(
      column: $table.repType, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get repLength => $composableBuilder(
      column: $table.repLength, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get repWeights => $composableBuilder(
      column: $table.repWeights, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get setWeights => $composableBuilder(
      column: $table.setWeights, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<bool> get isAlternating => $composableBuilder(
      column: $table.isAlternating,
      builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get tempo => $composableBuilder(
      column: $table.tempo, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get status => $composableBuilder(
      column: $table.status, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get state => $composableBuilder(
      column: $table.state, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get set => $composableBuilder(
      column: $table.set, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));
}

class $$ActionsTableAnnotationComposer
    extends Composer<_$AppDatabase, $ActionsTable> {
  $$ActionsTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<String> get title =>
      $composableBuilder(column: $table.title, builder: (column) => column);

  GeneratedColumn<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => column);

  GeneratedColumn<int> get totalSets =>
      $composableBuilder(column: $table.totalSets, builder: (column) => column);

  GeneratedColumn<String> get totalReps =>
      $composableBuilder(column: $table.totalReps, builder: (column) => column);

  GeneratedColumn<int> get restBeforeSets => $composableBuilder(
      column: $table.restBeforeSets, builder: (column) => column);

  GeneratedColumn<int> get restBetweenSets => $composableBuilder(
      column: $table.restBetweenSets, builder: (column) => column);

  GeneratedColumn<int> get restBetweenReps => $composableBuilder(
      column: $table.restBetweenReps, builder: (column) => column);

  GeneratedColumn<int> get restAfterSets => $composableBuilder(
      column: $table.restAfterSets, builder: (column) => column);

  GeneratedColumnWithTypeConverter<RepType, String> get repType =>
      $composableBuilder(column: $table.repType, builder: (column) => column);

  GeneratedColumn<int> get repLength =>
      $composableBuilder(column: $table.repLength, builder: (column) => column);

  GeneratedColumn<String> get repWeights => $composableBuilder(
      column: $table.repWeights, builder: (column) => column);

  GeneratedColumn<String> get setWeights => $composableBuilder(
      column: $table.setWeights, builder: (column) => column);

  GeneratedColumn<bool> get isAlternating => $composableBuilder(
      column: $table.isAlternating, builder: (column) => column);

  GeneratedColumn<String> get tempo =>
      $composableBuilder(column: $table.tempo, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ActionStatus, String> get status =>
      $composableBuilder(column: $table.status, builder: (column) => column);

  GeneratedColumn<String> get state =>
      $composableBuilder(column: $table.state, builder: (column) => column);

  GeneratedColumn<String> get set =>
      $composableBuilder(column: $table.set, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  Expression<T> activityActionsRefs<T extends Object>(
      Expression<T> Function($$ActivityActionsTableAnnotationComposer a) f) {
    final $$ActivityActionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.activityActions,
        getReferencedColumn: (t) => t.actionId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivityActionsTableAnnotationComposer(
              $db: $db,
              $table: $db.activityActions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$ActionsTableTableManager extends RootTableManager<
    _$AppDatabase,
    $ActionsTable,
    Action,
    $$ActionsTableFilterComposer,
    $$ActionsTableOrderingComposer,
    $$ActionsTableAnnotationComposer,
    $$ActionsTableCreateCompanionBuilder,
    $$ActionsTableUpdateCompanionBuilder,
    (Action, $$ActionsTableReferences),
    Action,
    PrefetchHooks Function({bool activityActionsRefs})> {
  $$ActionsTableTableManager(_$AppDatabase db, $ActionsTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$ActionsTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$ActionsTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$ActionsTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<String> title = const Value.absent(),
            Value<String> description = const Value.absent(),
            Value<int> totalSets = const Value.absent(),
            Value<String> totalReps = const Value.absent(),
            Value<int?> restBeforeSets = const Value.absent(),
            Value<int?> restBetweenSets = const Value.absent(),
            Value<int?> restBetweenReps = const Value.absent(),
            Value<int?> restAfterSets = const Value.absent(),
            Value<RepType> repType = const Value.absent(),
            Value<int?> repLength = const Value.absent(),
            Value<String?> repWeights = const Value.absent(),
            Value<String?> setWeights = const Value.absent(),
            Value<bool> isAlternating = const Value.absent(),
            Value<String?> tempo = const Value.absent(),
            Value<ActionStatus> status = const Value.absent(),
            Value<String> state = const Value.absent(),
            Value<String> set = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActionsCompanion(
            id: id,
            title: title,
            description: description,
            totalSets: totalSets,
            totalReps: totalReps,
            restBeforeSets: restBeforeSets,
            restBetweenSets: restBetweenSets,
            restBetweenReps: restBetweenReps,
            restAfterSets: restAfterSets,
            repType: repType,
            repLength: repLength,
            repWeights: repWeights,
            setWeights: setWeights,
            isAlternating: isAlternating,
            tempo: tempo,
            status: status,
            state: state,
            set: set,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required String title,
            required String description,
            required int totalSets,
            required String totalReps,
            Value<int?> restBeforeSets = const Value.absent(),
            Value<int?> restBetweenSets = const Value.absent(),
            Value<int?> restBetweenReps = const Value.absent(),
            Value<int?> restAfterSets = const Value.absent(),
            required RepType repType,
            Value<int?> repLength = const Value.absent(),
            Value<String?> repWeights = const Value.absent(),
            Value<String?> setWeights = const Value.absent(),
            Value<bool> isAlternating = const Value.absent(),
            Value<String?> tempo = const Value.absent(),
            Value<ActionStatus> status = const Value.absent(),
            Value<String> state = const Value.absent(),
            required String set,
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActionsCompanion.insert(
            id: id,
            title: title,
            description: description,
            totalSets: totalSets,
            totalReps: totalReps,
            restBeforeSets: restBeforeSets,
            restBetweenSets: restBetweenSets,
            restBetweenReps: restBetweenReps,
            restAfterSets: restAfterSets,
            repType: repType,
            repLength: repLength,
            repWeights: repWeights,
            setWeights: setWeights,
            isAlternating: isAlternating,
            tempo: tempo,
            status: status,
            state: state,
            set: set,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) =>
                  (e.readTable(table), $$ActionsTableReferences(db, table, e)))
              .toList(),
          prefetchHooksCallback: ({activityActionsRefs = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [
                if (activityActionsRefs) db.activityActions
              ],
              addJoins: null,
              getPrefetchedDataCallback: (items) async {
                return [
                  if (activityActionsRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$ActionsTableReferences
                            ._activityActionsRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$ActionsTableReferences(db, table, p0)
                                .activityActionsRefs,
                        referencedItemsForCurrentItem: (item,
                                referencedItems) =>
                            referencedItems.where((e) => e.actionId == item.id),
                        typedResults: items)
                ];
              },
            );
          },
        ));
}

typedef $$ActionsTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $ActionsTable,
    Action,
    $$ActionsTableFilterComposer,
    $$ActionsTableOrderingComposer,
    $$ActionsTableAnnotationComposer,
    $$ActionsTableCreateCompanionBuilder,
    $$ActionsTableUpdateCompanionBuilder,
    (Action, $$ActionsTableReferences),
    Action,
    PrefetchHooks Function({bool activityActionsRefs})>;
typedef $$ActivityActionsTableCreateCompanionBuilder = ActivityActionsCompanion
    Function({
  Value<int> id,
  required int activityId,
  required int actionId,
  required int sessionId,
  required int position,
  Value<DateTime> createdAt,
});
typedef $$ActivityActionsTableUpdateCompanionBuilder = ActivityActionsCompanion
    Function({
  Value<int> id,
  Value<int> activityId,
  Value<int> actionId,
  Value<int> sessionId,
  Value<int> position,
  Value<DateTime> createdAt,
});

final class $$ActivityActionsTableReferences extends BaseReferences<
    _$AppDatabase, $ActivityActionsTable, ActivityAction> {
  $$ActivityActionsTableReferences(
      super.$_db, super.$_table, super.$_typedResult);

  static $ActivitiesTable _activityIdTable(_$AppDatabase db) =>
      db.activities.createAlias($_aliasNameGenerator(
          db.activityActions.activityId, db.activities.id));

  $$ActivitiesTableProcessedTableManager get activityId {
    final manager = $$ActivitiesTableTableManager($_db, $_db.activities)
        .filter((f) => f.id($_item.activityId!));
    final item = $_typedResult.readTableOrNull(_activityIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }

  static $ActionsTable _actionIdTable(_$AppDatabase db) =>
      db.actions.createAlias(
          $_aliasNameGenerator(db.activityActions.actionId, db.actions.id));

  $$ActionsTableProcessedTableManager get actionId {
    final manager = $$ActionsTableTableManager($_db, $_db.actions)
        .filter((f) => f.id($_item.actionId!));
    final item = $_typedResult.readTableOrNull(_actionIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }

  static $SessionsTable _sessionIdTable(_$AppDatabase db) =>
      db.sessions.createAlias(
          $_aliasNameGenerator(db.activityActions.sessionId, db.sessions.id));

  $$SessionsTableProcessedTableManager get sessionId {
    final manager = $$SessionsTableTableManager($_db, $_db.sessions)
        .filter((f) => f.id($_item.sessionId!));
    final item = $_typedResult.readTableOrNull(_sessionIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }
}

class $$ActivityActionsTableFilterComposer
    extends Composer<_$AppDatabase, $ActivityActionsTable> {
  $$ActivityActionsTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get position => $composableBuilder(
      column: $table.position, builder: (column) => ColumnFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  $$ActivitiesTableFilterComposer get activityId {
    final $$ActivitiesTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableFilterComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActionsTableFilterComposer get actionId {
    final $$ActionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.actionId,
        referencedTable: $db.actions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActionsTableFilterComposer(
              $db: $db,
              $table: $db.actions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$SessionsTableFilterComposer get sessionId {
    final $$SessionsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableFilterComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ActivityActionsTableOrderingComposer
    extends Composer<_$AppDatabase, $ActivityActionsTable> {
  $$ActivityActionsTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get position => $composableBuilder(
      column: $table.position, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));

  $$ActivitiesTableOrderingComposer get activityId {
    final $$ActivitiesTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableOrderingComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActionsTableOrderingComposer get actionId {
    final $$ActionsTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.actionId,
        referencedTable: $db.actions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActionsTableOrderingComposer(
              $db: $db,
              $table: $db.actions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$SessionsTableOrderingComposer get sessionId {
    final $$SessionsTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableOrderingComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ActivityActionsTableAnnotationComposer
    extends Composer<_$AppDatabase, $ActivityActionsTable> {
  $$ActivityActionsTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<int> get position =>
      $composableBuilder(column: $table.position, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  $$ActivitiesTableAnnotationComposer get activityId {
    final $$ActivitiesTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.activityId,
        referencedTable: $db.activities,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActivitiesTableAnnotationComposer(
              $db: $db,
              $table: $db.activities,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$ActionsTableAnnotationComposer get actionId {
    final $$ActionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.actionId,
        referencedTable: $db.actions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ActionsTableAnnotationComposer(
              $db: $db,
              $table: $db.actions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }

  $$SessionsTableAnnotationComposer get sessionId {
    final $$SessionsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.sessionId,
        referencedTable: $db.sessions,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$SessionsTableAnnotationComposer(
              $db: $db,
              $table: $db.sessions,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ActivityActionsTableTableManager extends RootTableManager<
    _$AppDatabase,
    $ActivityActionsTable,
    ActivityAction,
    $$ActivityActionsTableFilterComposer,
    $$ActivityActionsTableOrderingComposer,
    $$ActivityActionsTableAnnotationComposer,
    $$ActivityActionsTableCreateCompanionBuilder,
    $$ActivityActionsTableUpdateCompanionBuilder,
    (ActivityAction, $$ActivityActionsTableReferences),
    ActivityAction,
    PrefetchHooks Function({bool activityId, bool actionId, bool sessionId})> {
  $$ActivityActionsTableTableManager(
      _$AppDatabase db, $ActivityActionsTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$ActivityActionsTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$ActivityActionsTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$ActivityActionsTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<int> activityId = const Value.absent(),
            Value<int> actionId = const Value.absent(),
            Value<int> sessionId = const Value.absent(),
            Value<int> position = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActivityActionsCompanion(
            id: id,
            activityId: activityId,
            actionId: actionId,
            sessionId: sessionId,
            position: position,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required int activityId,
            required int actionId,
            required int sessionId,
            required int position,
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ActivityActionsCompanion.insert(
            id: id,
            activityId: activityId,
            actionId: actionId,
            sessionId: sessionId,
            position: position,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) => (
                    e.readTable(table),
                    $$ActivityActionsTableReferences(db, table, e)
                  ))
              .toList(),
          prefetchHooksCallback: (
              {activityId = false, actionId = false, sessionId = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [],
              addJoins: <
                  T extends TableManagerState<
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic>>(state) {
                if (activityId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.activityId,
                    referencedTable:
                        $$ActivityActionsTableReferences._activityIdTable(db),
                    referencedColumn: $$ActivityActionsTableReferences
                        ._activityIdTable(db)
                        .id,
                  ) as T;
                }
                if (actionId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.actionId,
                    referencedTable:
                        $$ActivityActionsTableReferences._actionIdTable(db),
                    referencedColumn:
                        $$ActivityActionsTableReferences._actionIdTable(db).id,
                  ) as T;
                }
                if (sessionId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.sessionId,
                    referencedTable:
                        $$ActivityActionsTableReferences._sessionIdTable(db),
                    referencedColumn:
                        $$ActivityActionsTableReferences._sessionIdTable(db).id,
                  ) as T;
                }

                return state;
              },
              getPrefetchedDataCallback: (items) async {
                return [];
              },
            );
          },
        ));
}

typedef $$ActivityActionsTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $ActivityActionsTable,
    ActivityAction,
    $$ActivityActionsTableFilterComposer,
    $$ActivityActionsTableOrderingComposer,
    $$ActivityActionsTableAnnotationComposer,
    $$ActivityActionsTableCreateCompanionBuilder,
    $$ActivityActionsTableUpdateCompanionBuilder,
    (ActivityAction, $$ActivityActionsTableReferences),
    ActivityAction,
    PrefetchHooks Function({bool activityId, bool actionId, bool sessionId})>;
typedef $$MediaItemsTableCreateCompanionBuilder = MediaItemsCompanion Function({
  Value<int> id,
  required String title,
  required String description,
  required String reference,
  required MediaType type,
  Value<DateTime> createdAt,
});
typedef $$MediaItemsTableUpdateCompanionBuilder = MediaItemsCompanion Function({
  Value<int> id,
  Value<String> title,
  Value<String> description,
  Value<String> reference,
  Value<MediaType> type,
  Value<DateTime> createdAt,
});

final class $$MediaItemsTableReferences
    extends BaseReferences<_$AppDatabase, $MediaItemsTable, MediaItem> {
  $$MediaItemsTableReferences(super.$_db, super.$_table, super.$_typedResult);

  static MultiTypedResultKey<$ObjectMediaItemsTable, List<ObjectMediaItem>>
      _objectMediaItemsRefsTable(_$AppDatabase db) =>
          MultiTypedResultKey.fromTable(db.objectMediaItems,
              aliasName: $_aliasNameGenerator(
                  db.mediaItems.id, db.objectMediaItems.mediaId));

  $$ObjectMediaItemsTableProcessedTableManager get objectMediaItemsRefs {
    final manager =
        $$ObjectMediaItemsTableTableManager($_db, $_db.objectMediaItems)
            .filter((f) => f.mediaId.id($_item.id));

    final cache =
        $_typedResult.readTableOrNull(_objectMediaItemsRefsTable($_db));
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: cache));
  }
}

class $$MediaItemsTableFilterComposer
    extends Composer<_$AppDatabase, $MediaItemsTable> {
  $$MediaItemsTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnFilters(column));

  ColumnFilters<String> get reference => $composableBuilder(
      column: $table.reference, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<MediaType, MediaType, String> get type =>
      $composableBuilder(
          column: $table.type,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  Expression<bool> objectMediaItemsRefs(
      Expression<bool> Function($$ObjectMediaItemsTableFilterComposer f) f) {
    final $$ObjectMediaItemsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.objectMediaItems,
        getReferencedColumn: (t) => t.mediaId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ObjectMediaItemsTableFilterComposer(
              $db: $db,
              $table: $db.objectMediaItems,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$MediaItemsTableOrderingComposer
    extends Composer<_$AppDatabase, $MediaItemsTable> {
  $$MediaItemsTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get title => $composableBuilder(
      column: $table.title, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get reference => $composableBuilder(
      column: $table.reference, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get type => $composableBuilder(
      column: $table.type, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));
}

class $$MediaItemsTableAnnotationComposer
    extends Composer<_$AppDatabase, $MediaItemsTable> {
  $$MediaItemsTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<String> get title =>
      $composableBuilder(column: $table.title, builder: (column) => column);

  GeneratedColumn<String> get description => $composableBuilder(
      column: $table.description, builder: (column) => column);

  GeneratedColumn<String> get reference =>
      $composableBuilder(column: $table.reference, builder: (column) => column);

  GeneratedColumnWithTypeConverter<MediaType, String> get type =>
      $composableBuilder(column: $table.type, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  Expression<T> objectMediaItemsRefs<T extends Object>(
      Expression<T> Function($$ObjectMediaItemsTableAnnotationComposer a) f) {
    final $$ObjectMediaItemsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.id,
        referencedTable: $db.objectMediaItems,
        getReferencedColumn: (t) => t.mediaId,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$ObjectMediaItemsTableAnnotationComposer(
              $db: $db,
              $table: $db.objectMediaItems,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return f(composer);
  }
}

class $$MediaItemsTableTableManager extends RootTableManager<
    _$AppDatabase,
    $MediaItemsTable,
    MediaItem,
    $$MediaItemsTableFilterComposer,
    $$MediaItemsTableOrderingComposer,
    $$MediaItemsTableAnnotationComposer,
    $$MediaItemsTableCreateCompanionBuilder,
    $$MediaItemsTableUpdateCompanionBuilder,
    (MediaItem, $$MediaItemsTableReferences),
    MediaItem,
    PrefetchHooks Function({bool objectMediaItemsRefs})> {
  $$MediaItemsTableTableManager(_$AppDatabase db, $MediaItemsTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$MediaItemsTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$MediaItemsTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$MediaItemsTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<String> title = const Value.absent(),
            Value<String> description = const Value.absent(),
            Value<String> reference = const Value.absent(),
            Value<MediaType> type = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              MediaItemsCompanion(
            id: id,
            title: title,
            description: description,
            reference: reference,
            type: type,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required String title,
            required String description,
            required String reference,
            required MediaType type,
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              MediaItemsCompanion.insert(
            id: id,
            title: title,
            description: description,
            reference: reference,
            type: type,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) => (
                    e.readTable(table),
                    $$MediaItemsTableReferences(db, table, e)
                  ))
              .toList(),
          prefetchHooksCallback: ({objectMediaItemsRefs = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [
                if (objectMediaItemsRefs) db.objectMediaItems
              ],
              addJoins: null,
              getPrefetchedDataCallback: (items) async {
                return [
                  if (objectMediaItemsRefs)
                    await $_getPrefetchedData(
                        currentTable: table,
                        referencedTable: $$MediaItemsTableReferences
                            ._objectMediaItemsRefsTable(db),
                        managerFromTypedResult: (p0) =>
                            $$MediaItemsTableReferences(db, table, p0)
                                .objectMediaItemsRefs,
                        referencedItemsForCurrentItem: (item,
                                referencedItems) =>
                            referencedItems.where((e) => e.mediaId == item.id),
                        typedResults: items)
                ];
              },
            );
          },
        ));
}

typedef $$MediaItemsTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $MediaItemsTable,
    MediaItem,
    $$MediaItemsTableFilterComposer,
    $$MediaItemsTableOrderingComposer,
    $$MediaItemsTableAnnotationComposer,
    $$MediaItemsTableCreateCompanionBuilder,
    $$MediaItemsTableUpdateCompanionBuilder,
    (MediaItem, $$MediaItemsTableReferences),
    MediaItem,
    PrefetchHooks Function({bool objectMediaItemsRefs})>;
typedef $$ObjectMediaItemsTableCreateCompanionBuilder
    = ObjectMediaItemsCompanion Function({
  Value<int> id,
  required int objectId,
  required ObjectType objectType,
  required int mediaId,
  Value<DateTime> createdAt,
});
typedef $$ObjectMediaItemsTableUpdateCompanionBuilder
    = ObjectMediaItemsCompanion Function({
  Value<int> id,
  Value<int> objectId,
  Value<ObjectType> objectType,
  Value<int> mediaId,
  Value<DateTime> createdAt,
});

final class $$ObjectMediaItemsTableReferences extends BaseReferences<
    _$AppDatabase, $ObjectMediaItemsTable, ObjectMediaItem> {
  $$ObjectMediaItemsTableReferences(
      super.$_db, super.$_table, super.$_typedResult);

  static $MediaItemsTable _mediaIdTable(_$AppDatabase db) =>
      db.mediaItems.createAlias(
          $_aliasNameGenerator(db.objectMediaItems.mediaId, db.mediaItems.id));

  $$MediaItemsTableProcessedTableManager get mediaId {
    final manager = $$MediaItemsTableTableManager($_db, $_db.mediaItems)
        .filter((f) => f.id($_item.mediaId!));
    final item = $_typedResult.readTableOrNull(_mediaIdTable($_db));
    if (item == null) return manager;
    return ProcessedTableManager(
        manager.$state.copyWith(prefetchedData: [item]));
  }
}

class $$ObjectMediaItemsTableFilterComposer
    extends Composer<_$AppDatabase, $ObjectMediaItemsTable> {
  $$ObjectMediaItemsTableFilterComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnFilters<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnFilters(column));

  ColumnFilters<int> get objectId => $composableBuilder(
      column: $table.objectId, builder: (column) => ColumnFilters(column));

  ColumnWithTypeConverterFilters<ObjectType, ObjectType, String>
      get objectType => $composableBuilder(
          column: $table.objectType,
          builder: (column) => ColumnWithTypeConverterFilters(column));

  ColumnFilters<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnFilters(column));

  $$MediaItemsTableFilterComposer get mediaId {
    final $$MediaItemsTableFilterComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.mediaId,
        referencedTable: $db.mediaItems,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$MediaItemsTableFilterComposer(
              $db: $db,
              $table: $db.mediaItems,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ObjectMediaItemsTableOrderingComposer
    extends Composer<_$AppDatabase, $ObjectMediaItemsTable> {
  $$ObjectMediaItemsTableOrderingComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  ColumnOrderings<int> get id => $composableBuilder(
      column: $table.id, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<int> get objectId => $composableBuilder(
      column: $table.objectId, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<String> get objectType => $composableBuilder(
      column: $table.objectType, builder: (column) => ColumnOrderings(column));

  ColumnOrderings<DateTime> get createdAt => $composableBuilder(
      column: $table.createdAt, builder: (column) => ColumnOrderings(column));

  $$MediaItemsTableOrderingComposer get mediaId {
    final $$MediaItemsTableOrderingComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.mediaId,
        referencedTable: $db.mediaItems,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$MediaItemsTableOrderingComposer(
              $db: $db,
              $table: $db.mediaItems,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ObjectMediaItemsTableAnnotationComposer
    extends Composer<_$AppDatabase, $ObjectMediaItemsTable> {
  $$ObjectMediaItemsTableAnnotationComposer({
    required super.$db,
    required super.$table,
    super.joinBuilder,
    super.$addJoinBuilderToRootComposer,
    super.$removeJoinBuilderFromRootComposer,
  });
  GeneratedColumn<int> get id =>
      $composableBuilder(column: $table.id, builder: (column) => column);

  GeneratedColumn<int> get objectId =>
      $composableBuilder(column: $table.objectId, builder: (column) => column);

  GeneratedColumnWithTypeConverter<ObjectType, String> get objectType =>
      $composableBuilder(
          column: $table.objectType, builder: (column) => column);

  GeneratedColumn<DateTime> get createdAt =>
      $composableBuilder(column: $table.createdAt, builder: (column) => column);

  $$MediaItemsTableAnnotationComposer get mediaId {
    final $$MediaItemsTableAnnotationComposer composer = $composerBuilder(
        composer: this,
        getCurrentColumn: (t) => t.mediaId,
        referencedTable: $db.mediaItems,
        getReferencedColumn: (t) => t.id,
        builder: (joinBuilder,
                {$addJoinBuilderToRootComposer,
                $removeJoinBuilderFromRootComposer}) =>
            $$MediaItemsTableAnnotationComposer(
              $db: $db,
              $table: $db.mediaItems,
              $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
              joinBuilder: joinBuilder,
              $removeJoinBuilderFromRootComposer:
                  $removeJoinBuilderFromRootComposer,
            ));
    return composer;
  }
}

class $$ObjectMediaItemsTableTableManager extends RootTableManager<
    _$AppDatabase,
    $ObjectMediaItemsTable,
    ObjectMediaItem,
    $$ObjectMediaItemsTableFilterComposer,
    $$ObjectMediaItemsTableOrderingComposer,
    $$ObjectMediaItemsTableAnnotationComposer,
    $$ObjectMediaItemsTableCreateCompanionBuilder,
    $$ObjectMediaItemsTableUpdateCompanionBuilder,
    (ObjectMediaItem, $$ObjectMediaItemsTableReferences),
    ObjectMediaItem,
    PrefetchHooks Function({bool mediaId})> {
  $$ObjectMediaItemsTableTableManager(
      _$AppDatabase db, $ObjectMediaItemsTable table)
      : super(TableManagerState(
          db: db,
          table: table,
          createFilteringComposer: () =>
              $$ObjectMediaItemsTableFilterComposer($db: db, $table: table),
          createOrderingComposer: () =>
              $$ObjectMediaItemsTableOrderingComposer($db: db, $table: table),
          createComputedFieldComposer: () =>
              $$ObjectMediaItemsTableAnnotationComposer($db: db, $table: table),
          updateCompanionCallback: ({
            Value<int> id = const Value.absent(),
            Value<int> objectId = const Value.absent(),
            Value<ObjectType> objectType = const Value.absent(),
            Value<int> mediaId = const Value.absent(),
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ObjectMediaItemsCompanion(
            id: id,
            objectId: objectId,
            objectType: objectType,
            mediaId: mediaId,
            createdAt: createdAt,
          ),
          createCompanionCallback: ({
            Value<int> id = const Value.absent(),
            required int objectId,
            required ObjectType objectType,
            required int mediaId,
            Value<DateTime> createdAt = const Value.absent(),
          }) =>
              ObjectMediaItemsCompanion.insert(
            id: id,
            objectId: objectId,
            objectType: objectType,
            mediaId: mediaId,
            createdAt: createdAt,
          ),
          withReferenceMapper: (p0) => p0
              .map((e) => (
                    e.readTable(table),
                    $$ObjectMediaItemsTableReferences(db, table, e)
                  ))
              .toList(),
          prefetchHooksCallback: ({mediaId = false}) {
            return PrefetchHooks(
              db: db,
              explicitlyWatchedTables: [],
              addJoins: <
                  T extends TableManagerState<
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic,
                      dynamic>>(state) {
                if (mediaId) {
                  state = state.withJoin(
                    currentTable: table,
                    currentColumn: table.mediaId,
                    referencedTable:
                        $$ObjectMediaItemsTableReferences._mediaIdTable(db),
                    referencedColumn:
                        $$ObjectMediaItemsTableReferences._mediaIdTable(db).id,
                  ) as T;
                }

                return state;
              },
              getPrefetchedDataCallback: (items) async {
                return [];
              },
            );
          },
        ));
}

typedef $$ObjectMediaItemsTableProcessedTableManager = ProcessedTableManager<
    _$AppDatabase,
    $ObjectMediaItemsTable,
    ObjectMediaItem,
    $$ObjectMediaItemsTableFilterComposer,
    $$ObjectMediaItemsTableOrderingComposer,
    $$ObjectMediaItemsTableAnnotationComposer,
    $$ObjectMediaItemsTableCreateCompanionBuilder,
    $$ObjectMediaItemsTableUpdateCompanionBuilder,
    (ObjectMediaItem, $$ObjectMediaItemsTableReferences),
    ObjectMediaItem,
    PrefetchHooks Function({bool mediaId})>;

class $AppDatabaseManager {
  final _$AppDatabase _db;
  $AppDatabaseManager(this._db);
  $$SessionsTableTableManager get sessions =>
      $$SessionsTableTableManager(_db, _db.sessions);
  $$ActivitiesTableTableManager get activities =>
      $$ActivitiesTableTableManager(_db, _db.activities);
  $$SessionActivitiesTableTableManager get sessionActivities =>
      $$SessionActivitiesTableTableManager(_db, _db.sessionActivities);
  $$ActionsTableTableManager get actions =>
      $$ActionsTableTableManager(_db, _db.actions);
  $$ActivityActionsTableTableManager get activityActions =>
      $$ActivityActionsTableTableManager(_db, _db.activityActions);
  $$MediaItemsTableTableManager get mediaItems =>
      $$MediaItemsTableTableManager(_db, _db.mediaItems);
  $$ObjectMediaItemsTableTableManager get objectMediaItems =>
      $$ObjectMediaItemsTableTableManager(_db, _db.objectMediaItems);
}
