From 10274398481c6f0a5b405c4606b81b1d3bf102da Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Tue, 7 Jan 2025 15:55:30 -0500 Subject: [PATCH 1/5] remove activity junk --- lib/widgets/activities/activity_view.dart | 78 ----------------------- 1 file changed, 78 deletions(-) diff --git a/lib/widgets/activities/activity_view.dart b/lib/widgets/activities/activity_view.dart index b15770d..d1c5d94 100644 --- a/lib/widgets/activities/activity_view.dart +++ b/lib/widgets/activities/activity_view.dart @@ -280,84 +280,6 @@ class _ActivityViewState extends State { fontSize: 20, fontWeight: FontWeight.bold), 'Actions')), - - // Padding( - // padding: const EdgeInsets.only(left: 10, right: 10), - // child: Card( - // clipBehavior: Clip.antiAlias, - // shape: const RoundedRectangleBorder( - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(10), - // topRight: Radius.circular(10)), - // ), - // color: Theme.of(context).colorScheme.onPrimary, - // child: Row(children: [ - // Ink( - // width: 70, - // color: Theme.of(context) - // .colorScheme - // .primaryContainer, - // child: Consumer( - // builder: (context, atm, child) { - // return IconButton( - // alignment: - // AlignmentDirectional.center, - // icon: atm.isActive - // ? const Icon( - // Icons.pause_rounded) - // : const Icon( - // Icons.play_arrow_rounded), - // onPressed: () => { - // atm.isActive - // ? atm.pause() - // : atm.start() - // }); - // }, - // )), - // Expanded( - // flex: 1, - // child: Stack( - // alignment: Alignment.center, - // children: [ - // Container( - // alignment: Alignment.center, - // child: Consumer( - // builder: (context, atm, child) { - // return Text( - // style: const TextStyle( - // fontSize: 20), - // textAlign: TextAlign.center, - // '${atm.actionCount} ${atm.currentAction['type']}' - // .toTitleCase()); - // }, - // ), - // ), - // Container( - // alignment: Alignment.centerRight, - // padding: - // EdgeInsets.only(right: 15), - // child: - // Consumer( - // builder: (context, atm, - // child) { - // return Text( - // style: const TextStyle( - // fontSize: 12), - // textAlign: TextAlign.right, - // '${atm.currentAction['actionID'] + 1} of ${atm.totalActions()}'); - // })), - // ])), - // ]))), - // Padding( - // padding: EdgeInsets.only(left: 14, right: 14), - // child: Consumer( - // builder: (context, atm, child) { - // return LinearProgressIndicator( - // value: atm.progress, - // semanticsLabel: 'Activity Progress', - // ); - // })), - // ActivityActionView(actions: actions), ] + action(actions))); } else { -- 2.47.2 From 2288cba78ed30806ba306d0740b6087858806fd7 Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Tue, 7 Jan 2025 15:56:51 -0500 Subject: [PATCH 2/5] actvity card spacing --- lib/widgets/activities/activity_view_categories.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/activities/activity_view_categories.dart b/lib/widgets/activities/activity_view_categories.dart index 97d8ee6..dcb1b35 100644 --- a/lib/widgets/activities/activity_view_categories.dart +++ b/lib/widgets/activities/activity_view_categories.dart @@ -21,7 +21,7 @@ class ActivityViewCategories> extends StatelessWidget { itemCount: object.length, itemBuilder: (BuildContext context, int index) { return Padding( - padding: EdgeInsets.only(right: 10), + padding: EdgeInsets.only(right: 5), child: ActionChip( visualDensity: VisualDensity.compact, avatar: icon, -- 2.47.2 From 0cf62ec4b4708caa31439ea8029c4d5726f6ee53 Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Tue, 7 Jan 2025 18:41:50 -0500 Subject: [PATCH 3/5] add new db fields to action --- lib/database/database.dart | 17 +- lib/database/database.g.dart | 727 ++++- lib/database/database.steps.dart | 437 +++ .../sendtrain/drift_schema_v21.json | 1 + .../sendtrain/drift_schema_v22.json | 1 + lib/database/seed.dart | 11 + test/drift/sendtrain/generated/schema.dart | 10 +- .../drift/sendtrain/generated/schema_v21.dart | 2604 ++++++++++++++++ .../drift/sendtrain/generated/schema_v22.dart | 2639 +++++++++++++++++ 9 files changed, 6440 insertions(+), 7 deletions(-) create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v21.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v22.json create mode 100644 test/drift/sendtrain/generated/schema_v21.dart create mode 100644 test/drift/sendtrain/generated/schema_v22.dart diff --git a/lib/database/database.dart b/lib/database/database.dart index 5aee3f1..4d7bacb 100644 --- a/lib/database/database.dart +++ b/lib/database/database.dart @@ -35,7 +35,7 @@ class AppDatabase extends _$AppDatabase { AppDatabase() : super(_openConnection()); @override - int get schemaVersion => 20; + int get schemaVersion => 22; @override MigrationStrategy get migration { @@ -164,10 +164,23 @@ class ActivityActions extends Table { dateTime().withDefault(Variable(DateTime.now()))(); } +enum RepType { time, count } class Actions extends Table { IntColumn get id => integer().autoIncrement()(); - TextColumn get title => text().withLength(min: 3, max: 32)(); + TextColumn get title => text().withLength(min: 3, max: 64)(); TextColumn get description => text().named('body')(); + IntColumn get totalSets => integer()(); + TextColumn get totalReps => text().withLength(min: 1, max: 32)(); + IntColumn get restBeforeSets => integer().nullable()(); + IntColumn get restBetweenSets => integer().nullable()(); + IntColumn get restBetweenReps => integer().nullable()(); + IntColumn get restAfterSets => integer().nullable()(); + TextColumn get repType => textEnum()(); + IntColumn get repLength => integer().nullable()(); + TextColumn get repWeights => text().nullable()(); + TextColumn get setWeights => text().nullable()(); + BoolColumn get isAlternating => boolean().withDefault(Variable(false))(); + TextColumn get tempo => text().withLength(min: 6, max: 36).nullable()(); TextColumn get set => text()(); DateTimeColumn get createdAt => dateTime().withDefault(Variable(DateTime.now()))(); diff --git a/lib/database/database.g.dart b/lib/database/database.g.dart index c247680..8a68ef0 100644 --- a/lib/database/database.g.dart +++ b/lib/database/database.g.dart @@ -1441,7 +1441,7 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, additionalChecks: - GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _descriptionMeta = @@ -1450,6 +1450,88 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { late final GeneratedColumn description = GeneratedColumn( 'body', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); + static const VerificationMeta _totalSetsMeta = + const VerificationMeta('totalSets'); + @override + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + static const VerificationMeta _totalRepsMeta = + const VerificationMeta('totalReps'); + @override + late final GeneratedColumn totalReps = GeneratedColumn( + '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 restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + static const VerificationMeta _restBetweenSetsMeta = + const VerificationMeta('restBetweenSets'); + @override + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + static const VerificationMeta _restBetweenRepsMeta = + const VerificationMeta('restBetweenReps'); + @override + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + static const VerificationMeta _restAfterSetsMeta = + const VerificationMeta('restAfterSets'); + @override + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + static const VerificationMeta _repTypeMeta = + const VerificationMeta('repType'); + @override + late final GeneratedColumnWithTypeConverter repType = + GeneratedColumn('rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true) + .withConverter($ActionsTable.$converterrepType); + static const VerificationMeta _repLengthMeta = + const VerificationMeta('repLength'); + @override + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + static const VerificationMeta _repWeightsMeta = + const VerificationMeta('repWeights'); + @override + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + static const VerificationMeta _setWeightsMeta = + const VerificationMeta('setWeights'); + @override + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + static const VerificationMeta _isAlternatingMeta = + const VerificationMeta('isAlternating'); + @override + late final GeneratedColumn isAlternating = GeneratedColumn( + '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 tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); static const VerificationMeta _setMeta = const VerificationMeta('set'); @override late final GeneratedColumn set = GeneratedColumn( @@ -1464,8 +1546,25 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { requiredDuringInsert: false, defaultValue: Variable(DateTime.now())); @override - List get $columns => - [id, title, description, set, createdAt]; + List get $columns => [ + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeights, + setWeights, + isAlternating, + tempo, + set, + createdAt + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -1491,6 +1590,69 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { } 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)); + } if (data.containsKey('set')) { context.handle( _setMeta, set.isAcceptableOrUnknown(data['set']!, _setMeta)); @@ -1516,6 +1678,31 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { .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']), set: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}set'])!, createdAt: attachedDatabase.typeMapping @@ -1527,18 +1714,45 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { $ActionsTable createAlias(String alias) { return $ActionsTable(attachedDatabase, alias); } + + static JsonTypeConverter2 $converterrepType = + const EnumNameConverter(RepType.values); } class Action extends DataClass implements Insertable { 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 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.set, required this.createdAt}); @override @@ -1547,6 +1761,37 @@ class Action extends DataClass implements Insertable { map['id'] = Variable(id); map['title'] = Variable(title); map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + { + map['rep_type'] = + Variable($ActionsTable.$converterrepType.toSql(repType)); + } + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } map['set'] = Variable(set); map['created_at'] = Variable(createdAt); return map; @@ -1557,6 +1802,33 @@ class Action extends DataClass implements Insertable { 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), set: Value(set), createdAt: Value(createdAt), ); @@ -1569,6 +1841,19 @@ class Action extends DataClass implements Insertable { id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: $ActionsTable.$converterrepType + .fromJson(serializer.fromJson(json['repType'])), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), set: serializer.fromJson(json['set']), createdAt: serializer.fromJson(json['createdAt']), ); @@ -1580,6 +1865,19 @@ class Action extends DataClass implements Insertable { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer + .toJson($ActionsTable.$converterrepType.toJson(repType)), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), 'set': serializer.toJson(set), 'createdAt': serializer.toJson(createdAt), }; @@ -1589,12 +1887,42 @@ class Action extends DataClass implements Insertable { {int? id, String? title, String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + RepType? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), 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, set: set ?? this.set, createdAt: createdAt ?? this.createdAt, ); @@ -1604,6 +1932,30 @@ class Action extends DataClass implements Insertable { 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, set: data.set.present ? data.set.value : this.set, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); @@ -1615,6 +1967,18 @@ class Action extends DataClass implements Insertable { ..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('set: $set, ') ..write('createdAt: $createdAt') ..write(')')) @@ -1622,7 +1986,24 @@ class Action extends DataClass implements Insertable { } @override - int get hashCode => Object.hash(id, title, description, set, createdAt); + int get hashCode => Object.hash( + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeights, + setWeights, + isAlternating, + tempo, + set, + createdAt); @override bool operator ==(Object other) => identical(this, other) || @@ -1630,6 +2011,18 @@ class Action extends DataClass implements Insertable { 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.set == this.set && other.createdAt == this.createdAt); } @@ -1638,12 +2031,36 @@ class ActionsCompanion extends UpdateCompanion { final Value id; final Value title; final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; final Value set; final Value 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.set = const Value.absent(), this.createdAt = const Value.absent(), }); @@ -1651,15 +2068,42 @@ class ActionsCompanion extends UpdateCompanion { 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(), 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 custom({ Expression? id, Expression? title, Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, Expression? set, Expression? createdAt, }) { @@ -1667,6 +2111,18 @@ class ActionsCompanion extends UpdateCompanion { 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 (set != null) 'set': set, if (createdAt != null) 'created_at': createdAt, }); @@ -1676,12 +2132,36 @@ class ActionsCompanion extends UpdateCompanion { {Value? id, Value? title, Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, Value? set, Value? 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, set: set ?? this.set, createdAt: createdAt ?? this.createdAt, ); @@ -1699,6 +2179,43 @@ class ActionsCompanion extends UpdateCompanion { if (description.present) { map['body'] = Variable(description.value); } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable( + $ActionsTable.$converterrepType.toSql(repType.value)); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } if (set.present) { map['set'] = Variable(set.value); } @@ -1714,6 +2231,18 @@ class ActionsCompanion extends UpdateCompanion { ..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('set: $set, ') ..write('createdAt: $createdAt') ..write(')')) @@ -3871,6 +4400,18 @@ typedef $$ActionsTableCreateCompanionBuilder = ActionsCompanion Function({ Value id, required String title, required String description, + required int totalSets, + required String totalReps, + Value restBeforeSets, + Value restBetweenSets, + Value restBetweenReps, + Value restAfterSets, + required RepType repType, + Value repLength, + Value repWeights, + Value setWeights, + Value isAlternating, + Value tempo, required String set, Value createdAt, }); @@ -3878,6 +4419,18 @@ typedef $$ActionsTableUpdateCompanionBuilder = ActionsCompanion Function({ Value id, Value title, Value description, + Value totalSets, + Value totalReps, + Value restBeforeSets, + Value restBetweenSets, + Value restBetweenReps, + Value restAfterSets, + Value repType, + Value repLength, + Value repWeights, + Value setWeights, + Value isAlternating, + Value tempo, Value set, Value createdAt, }); @@ -3922,6 +4475,47 @@ class $$ActionsTableFilterComposer ColumnFilters get description => $composableBuilder( column: $table.description, builder: (column) => ColumnFilters(column)); + ColumnFilters get totalSets => $composableBuilder( + column: $table.totalSets, builder: (column) => ColumnFilters(column)); + + ColumnFilters get totalReps => $composableBuilder( + column: $table.totalReps, builder: (column) => ColumnFilters(column)); + + ColumnFilters get restBeforeSets => $composableBuilder( + column: $table.restBeforeSets, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get restBetweenSets => $composableBuilder( + column: $table.restBetweenSets, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get restBetweenReps => $composableBuilder( + column: $table.restBetweenReps, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get restAfterSets => $composableBuilder( + column: $table.restAfterSets, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters get repType => + $composableBuilder( + column: $table.repType, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get repLength => $composableBuilder( + column: $table.repLength, builder: (column) => ColumnFilters(column)); + + ColumnFilters get repWeights => $composableBuilder( + column: $table.repWeights, builder: (column) => ColumnFilters(column)); + + ColumnFilters get setWeights => $composableBuilder( + column: $table.setWeights, builder: (column) => ColumnFilters(column)); + + ColumnFilters get isAlternating => $composableBuilder( + column: $table.isAlternating, builder: (column) => ColumnFilters(column)); + + ColumnFilters get tempo => $composableBuilder( + column: $table.tempo, builder: (column) => ColumnFilters(column)); + ColumnFilters get set => $composableBuilder( column: $table.set, builder: (column) => ColumnFilters(column)); @@ -3968,6 +4562,47 @@ class $$ActionsTableOrderingComposer ColumnOrderings get description => $composableBuilder( column: $table.description, builder: (column) => ColumnOrderings(column)); + ColumnOrderings get totalSets => $composableBuilder( + column: $table.totalSets, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get totalReps => $composableBuilder( + column: $table.totalReps, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get restBeforeSets => $composableBuilder( + column: $table.restBeforeSets, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get restBetweenSets => $composableBuilder( + column: $table.restBetweenSets, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get restBetweenReps => $composableBuilder( + column: $table.restBetweenReps, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get restAfterSets => $composableBuilder( + column: $table.restAfterSets, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get repType => $composableBuilder( + column: $table.repType, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get repLength => $composableBuilder( + column: $table.repLength, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get repWeights => $composableBuilder( + column: $table.repWeights, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get setWeights => $composableBuilder( + column: $table.setWeights, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get isAlternating => $composableBuilder( + column: $table.isAlternating, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get tempo => $composableBuilder( + column: $table.tempo, builder: (column) => ColumnOrderings(column)); + ColumnOrderings get set => $composableBuilder( column: $table.set, builder: (column) => ColumnOrderings(column)); @@ -3993,6 +4628,42 @@ class $$ActionsTableAnnotationComposer GeneratedColumn get description => $composableBuilder( column: $table.description, builder: (column) => column); + GeneratedColumn get totalSets => + $composableBuilder(column: $table.totalSets, builder: (column) => column); + + GeneratedColumn get totalReps => + $composableBuilder(column: $table.totalReps, builder: (column) => column); + + GeneratedColumn get restBeforeSets => $composableBuilder( + column: $table.restBeforeSets, builder: (column) => column); + + GeneratedColumn get restBetweenSets => $composableBuilder( + column: $table.restBetweenSets, builder: (column) => column); + + GeneratedColumn get restBetweenReps => $composableBuilder( + column: $table.restBetweenReps, builder: (column) => column); + + GeneratedColumn get restAfterSets => $composableBuilder( + column: $table.restAfterSets, builder: (column) => column); + + GeneratedColumnWithTypeConverter get repType => + $composableBuilder(column: $table.repType, builder: (column) => column); + + GeneratedColumn get repLength => + $composableBuilder(column: $table.repLength, builder: (column) => column); + + GeneratedColumn get repWeights => $composableBuilder( + column: $table.repWeights, builder: (column) => column); + + GeneratedColumn get setWeights => $composableBuilder( + column: $table.setWeights, builder: (column) => column); + + GeneratedColumn get isAlternating => $composableBuilder( + column: $table.isAlternating, builder: (column) => column); + + GeneratedColumn get tempo => + $composableBuilder(column: $table.tempo, builder: (column) => column); + GeneratedColumn get set => $composableBuilder(column: $table.set, builder: (column) => column); @@ -4047,6 +4718,18 @@ class $$ActionsTableTableManager extends RootTableManager< Value id = const Value.absent(), Value title = const Value.absent(), Value description = const Value.absent(), + Value totalSets = const Value.absent(), + Value totalReps = const Value.absent(), + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + Value repType = const Value.absent(), + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + Value isAlternating = const Value.absent(), + Value tempo = const Value.absent(), Value set = const Value.absent(), Value createdAt = const Value.absent(), }) => @@ -4054,6 +4737,18 @@ class $$ActionsTableTableManager extends RootTableManager< 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, set: set, createdAt: createdAt, ), @@ -4061,6 +4756,18 @@ class $$ActionsTableTableManager extends RootTableManager< Value id = const Value.absent(), required String title, required String description, + required int totalSets, + required String totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + required RepType repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + Value isAlternating = const Value.absent(), + Value tempo = const Value.absent(), required String set, Value createdAt = const Value.absent(), }) => @@ -4068,6 +4775,18 @@ class $$ActionsTableTableManager extends RootTableManager< 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, set: set, createdAt: createdAt, ), diff --git a/lib/database/database.steps.dart b/lib/database/database.steps.dart index 86b18c6..7f6840a 100644 --- a/lib/database/database.steps.dart +++ b/lib/database/database.steps.dart @@ -3073,6 +3073,427 @@ i1.GeneratedColumn _column_41(String aliasedName) => additionalChecks: i1.GeneratedColumn.checkTextLength( minTextLength: 3, maxTextLength: 64), type: i1.DriftSqlType.string); + +final class Schema21 extends i0.VersionedSchema { + Schema21({required super.database}) : super(version: 21); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape18 actions = Shape18( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_50, + _column_51, + _column_52, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +class Shape18 extends i0.VersionedTable { + Shape18({required super.source, required super.alias}) : super.aliased(); + i1.GeneratedColumn get id => + columnsByName['id']! as i1.GeneratedColumn; + i1.GeneratedColumn get title => + columnsByName['title']! as i1.GeneratedColumn; + i1.GeneratedColumn get description => + columnsByName['body']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalSets => + columnsByName['total_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalReps => + columnsByName['total_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBeforeSets => + columnsByName['rest_before_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenSets => + columnsByName['rest_between_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenReps => + columnsByName['rest_between_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restAfterSets => + columnsByName['rest_after_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get repType => + columnsByName['rep_type']! as i1.GeneratedColumn; + i1.GeneratedColumn get repLength => + columnsByName['rep_length']! as i1.GeneratedColumn; + i1.GeneratedColumn get repWeight => + columnsByName['rep_weight']! as i1.GeneratedColumn; + i1.GeneratedColumn get isAlternating => + columnsByName['is_alternating']! as i1.GeneratedColumn; + i1.GeneratedColumn get tempo => + columnsByName['tempo']! as i1.GeneratedColumn; + i1.GeneratedColumn get set => + columnsByName['set']! as i1.GeneratedColumn; + i1.GeneratedColumn get createdAt => + columnsByName['created_at']! as i1.GeneratedColumn; +} + +i1.GeneratedColumn _column_42(String aliasedName) => + i1.GeneratedColumn('total_sets', aliasedName, false, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_43(String aliasedName) => + i1.GeneratedColumn('total_reps', aliasedName, false, + additionalChecks: i1.GeneratedColumn.checkTextLength( + minTextLength: 1, maxTextLength: 32), + type: i1.DriftSqlType.string); +i1.GeneratedColumn _column_44(String aliasedName) => + i1.GeneratedColumn('rest_before_sets', aliasedName, true, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_45(String aliasedName) => + i1.GeneratedColumn('rest_between_sets', aliasedName, true, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_46(String aliasedName) => + i1.GeneratedColumn('rest_between_reps', aliasedName, true, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_47(String aliasedName) => + i1.GeneratedColumn('rest_after_sets', aliasedName, true, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_48(String aliasedName) => + i1.GeneratedColumn('rep_type', aliasedName, false, + type: i1.DriftSqlType.string); +i1.GeneratedColumn _column_49(String aliasedName) => + i1.GeneratedColumn('rep_length', aliasedName, true, + type: i1.DriftSqlType.int); +i1.GeneratedColumn _column_50(String aliasedName) => + i1.GeneratedColumn('rep_weight', aliasedName, true, + type: i1.DriftSqlType.string); +i1.GeneratedColumn _column_51(String aliasedName) => + i1.GeneratedColumn('is_alternating', aliasedName, false, + type: i1.DriftSqlType.bool, + defaultConstraints: i1.GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); +i1.GeneratedColumn _column_52(String aliasedName) => + i1.GeneratedColumn('tempo', aliasedName, true, + additionalChecks: i1.GeneratedColumn.checkTextLength( + minTextLength: 6, maxTextLength: 36), + type: i1.DriftSqlType.string); + +final class Schema22 extends i0.VersionedSchema { + Schema22({required super.database}) : super(version: 22); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape19 actions = Shape19( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +class Shape19 extends i0.VersionedTable { + Shape19({required super.source, required super.alias}) : super.aliased(); + i1.GeneratedColumn get id => + columnsByName['id']! as i1.GeneratedColumn; + i1.GeneratedColumn get title => + columnsByName['title']! as i1.GeneratedColumn; + i1.GeneratedColumn get description => + columnsByName['body']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalSets => + columnsByName['total_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalReps => + columnsByName['total_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBeforeSets => + columnsByName['rest_before_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenSets => + columnsByName['rest_between_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenReps => + columnsByName['rest_between_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restAfterSets => + columnsByName['rest_after_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get repType => + columnsByName['rep_type']! as i1.GeneratedColumn; + i1.GeneratedColumn get repLength => + columnsByName['rep_length']! as i1.GeneratedColumn; + i1.GeneratedColumn get repWeights => + columnsByName['rep_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get setWeights => + columnsByName['set_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get isAlternating => + columnsByName['is_alternating']! as i1.GeneratedColumn; + i1.GeneratedColumn get tempo => + columnsByName['tempo']! as i1.GeneratedColumn; + i1.GeneratedColumn get set => + columnsByName['set']! as i1.GeneratedColumn; + i1.GeneratedColumn get createdAt => + columnsByName['created_at']! as i1.GeneratedColumn; +} + +i1.GeneratedColumn _column_53(String aliasedName) => + i1.GeneratedColumn('rep_weights', aliasedName, true, + type: i1.DriftSqlType.string); +i1.GeneratedColumn _column_54(String aliasedName) => + i1.GeneratedColumn('set_weights', aliasedName, true, + type: i1.DriftSqlType.string); i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, @@ -3093,6 +3514,8 @@ i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema18 schema) from17To18, required Future Function(i1.Migrator m, Schema19 schema) from18To19, required Future Function(i1.Migrator m, Schema20 schema) from19To20, + required Future Function(i1.Migrator m, Schema21 schema) from20To21, + required Future Function(i1.Migrator m, Schema22 schema) from21To22, }) { return (currentVersion, database) async { switch (currentVersion) { @@ -3191,6 +3614,16 @@ i0.MigrationStepWithVersion migrationSteps({ final migrator = i1.Migrator(database, schema); await from19To20(migrator, schema); return 20; + case 20: + final schema = Schema21(database: database); + final migrator = i1.Migrator(database, schema); + await from20To21(migrator, schema); + return 21; + case 21: + final schema = Schema22(database: database); + final migrator = i1.Migrator(database, schema); + await from21To22(migrator, schema); + return 22; default: throw ArgumentError.value('Unknown migration from $currentVersion'); } @@ -3217,6 +3650,8 @@ i1.OnUpgrade stepByStep({ required Future Function(i1.Migrator m, Schema18 schema) from17To18, required Future Function(i1.Migrator m, Schema19 schema) from18To19, required Future Function(i1.Migrator m, Schema20 schema) from19To20, + required Future Function(i1.Migrator m, Schema21 schema) from20To21, + required Future Function(i1.Migrator m, Schema22 schema) from21To22, }) => i0.VersionedSchema.stepByStepHelper( step: migrationSteps( @@ -3239,4 +3674,6 @@ i1.OnUpgrade stepByStep({ from17To18: from17To18, from18To19: from18To19, from19To20: from19To20, + from20To21: from20To21, + from21To22: from21To22, )); diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v21.json b/lib/database/drift_schemas/sendtrain/drift_schema_v21.json new file mode 100644 index 0000000..6d507ea --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v21.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weight","getter_name":"repWeight","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v22.json b/lib/database/drift_schemas/sendtrain/drift_schema_v22.json new file mode 100644 index 0000000..57d2014 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v22.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/seed.dart b/lib/database/seed.dart index 26318f4..142e5bc 100644 --- a/lib/database/seed.dart +++ b/lib/database/seed.dart @@ -182,6 +182,17 @@ Future seedDb(AppDatabase database) async { title: 'Test action $k', description: '$k Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.', + totalSets: 5, + totalReps: "[5]", + restBeforeSets: Value(30000), + restBetweenSets: Value(300000), + restBetweenReps: Value(15000), + restAfterSets: Value(300000), + repType: RepType.time, + repLength: Value(10000), + repWeights: Value("[110]"), + setWeights: Value("[1]"), + isAlternating: Value(true), set: actionTypes[random.nextInt(actionTypes.length)])) .then((actionId) async { // add activity action association diff --git a/test/drift/sendtrain/generated/schema.dart b/test/drift/sendtrain/generated/schema.dart index 8558e69..3333477 100644 --- a/test/drift/sendtrain/generated/schema.dart +++ b/test/drift/sendtrain/generated/schema.dart @@ -23,6 +23,8 @@ import 'schema_v7.dart' as v7; import 'schema_v8.dart' as v8; import 'schema_v9.dart' as v9; import 'schema_v20.dart' as v20; +import 'schema_v21.dart' as v21; +import 'schema_v22.dart' as v22; class GeneratedHelper implements SchemaInstantiationHelper { @override @@ -68,6 +70,10 @@ class GeneratedHelper implements SchemaInstantiationHelper { return v9.DatabaseAtV9(db); case 20: return v20.DatabaseAtV20(db); + case 21: + return v21.DatabaseAtV21(db); + case 22: + return v22.DatabaseAtV22(db); default: throw MissingSchemaException(version, versions); } @@ -93,6 +99,8 @@ class GeneratedHelper implements SchemaInstantiationHelper { 17, 18, 19, - 20 + 20, + 21, + 22 ]; } diff --git a/test/drift/sendtrain/generated/schema_v21.dart b/test/drift/sendtrain/generated/schema_v21.dart new file mode 100644 index 0000000..ffe5e0e --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v21.dart @@ -0,0 +1,2604 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeight = GeneratedColumn( + 'rep_weight', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => [ + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeight, + isAlternating, + tempo, + set, + createdAt + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'actions'; + @override + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}rep_type'])!, + repLength: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}rep_length']), + repWeight: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}rep_weight']), + isAlternating: attachedDatabase.typeMapping + .read(DriftSqlType.bool, data['${effectivePrefix}is_alternating'])!, + tempo: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}tempo']), + set: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}set'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeight; + final bool isAlternating; + final String? tempo; + final String set; + final DateTime createdAt; + const ActionsData( + {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.repWeight, + required this.isAlternating, + this.tempo, + required this.set, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeight != null) { + map['rep_weight'] = Variable(repWeight); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['set'] = Variable(set); + map['created_at'] = Variable(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), + repWeight: repWeight == null && nullToAbsent + ? const Value.absent() + : Value(repWeight), + isAlternating: Value(isAlternating), + tempo: + tempo == null && nullToAbsent ? const Value.absent() : Value(tempo), + set: Value(set), + createdAt: Value(createdAt), + ); + } + + factory ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeight: serializer.fromJson(json['repWeight']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeight': serializer.toJson(repWeight), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeight = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + repWeight: repWeight.present ? repWeight.value : this.repWeight, + isAlternating: isAlternating ?? this.isAlternating, + tempo: tempo.present ? tempo.value : this.tempo, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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, + repWeight: data.repWeight.present ? data.repWeight.value : this.repWeight, + isAlternating: data.isAlternating.present + ? data.isAlternating.value + : this.isAlternating, + tempo: data.tempo.present ? data.tempo.value : this.tempo, + set: data.set.present ? data.set.value : this.set, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActionsData(') + ..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('repWeight: $repWeight, ') + ..write('isAlternating: $isAlternating, ') + ..write('tempo: $tempo, ') + ..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, + repWeight, + isAlternating, + tempo, + set, + createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActionsData && + 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.repWeight == this.repWeight && + other.isAlternating == this.isAlternating && + other.tempo == this.tempo && + other.set == this.set && + other.createdAt == this.createdAt); +} + +class ActionsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeight; + final Value isAlternating; + final Value tempo; + final Value set; + final Value 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.repWeight = const Value.absent(), + this.isAlternating = const Value.absent(), + this.tempo = 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 String repType, + this.repLength = const Value.absent(), + this.repWeight = const Value.absent(), + this.isAlternating = const Value.absent(), + this.tempo = 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeight, + Expression? isAlternating, + Expression? tempo, + Expression? set, + Expression? 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 (repWeight != null) 'rep_weight': repWeight, + if (isAlternating != null) 'is_alternating': isAlternating, + if (tempo != null) 'tempo': tempo, + if (set != null) 'set': set, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActionsCompanion copyWith( + {Value? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeight, + Value? isAlternating, + Value? tempo, + Value? set, + Value? 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, + repWeight: repWeight ?? this.repWeight, + isAlternating: isAlternating ?? this.isAlternating, + tempo: tempo ?? this.tempo, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeight.present) { + map['rep_weight'] = Variable(repWeight.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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('repWeight: $repWeight, ') + ..write('isAlternating: $isAlternating, ') + ..write('tempo: $tempo, ') + ..write('set: $set, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV21 extends GeneratedDatabase { + DatabaseAtV21(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 21; +} diff --git a/test/drift/sendtrain/generated/schema_v22.dart b/test/drift/sendtrain/generated/schema_v22.dart new file mode 100644 index 0000000..02ce890 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v22.dart @@ -0,0 +1,2639 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => [ + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeights, + setWeights, + isAlternating, + tempo, + set, + createdAt + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'actions'; + @override + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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']), + set: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}set'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String set; + final DateTime createdAt; + const ActionsData( + {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.set, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['set'] = Variable(set); + map['created_at'] = Variable(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), + set: Value(set), + createdAt: Value(createdAt), + ); + } + + factory ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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, + set: data.set.present ? data.set.value : this.set, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActionsData(') + ..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('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, + set, + createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActionsData && + 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.set == this.set && + other.createdAt == this.createdAt); +} + +class ActionsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value set; + final Value 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.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 String 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(), + 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? set, + Expression? 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 (set != null) 'set': set, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActionsCompanion copyWith( + {Value? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? set, + Value? 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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('set: $set, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV22 extends GeneratedDatabase { + DatabaseAtV22(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 22; +} -- 2.47.2 From 60bc5719872772ab4b9635e2a4dfc589850c00d6 Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Fri, 24 Jan 2025 16:15:22 -0500 Subject: [PATCH 4/5] action display, and full display, started action editor --- lib/daos/actions_dao.dart | 2 + lib/database/database.dart | 9 +- lib/database/database.g.dart | 114 + lib/database/database.steps.dart | 1881 ++++++++++++ .../sendtrain/drift_schema_v23.json | 1 + .../sendtrain/drift_schema_v24.json | 1 + .../sendtrain/drift_schema_v25.json | 1 + .../sendtrain/drift_schema_v26.json | 1 + .../sendtrain/drift_schema_v27.json | 1 + .../sendtrain/drift_schema_v28.json | 1 + .../sendtrain/drift_schema_v29.json | 1 + .../sendtrain/drift_schema_v30.json | 1 + .../sendtrain/drift_schema_v31.json | 1 + .../sendtrain/drift_schema_v32.json | 1 + .../sendtrain/drift_schema_v33.json | 1 + lib/database/seed.dart | 2 +- lib/helpers/date_time_helpers.dart | 5 + lib/helpers/widget_helpers.dart | 24 +- lib/main.dart | 7 +- lib/models/action_model.dart | 259 ++ lib/providers/action_timer.dart | 173 ++ .../activities/activity_action_editor.dart | 39 + .../activities/activity_action_view.dart | 277 +- lib/widgets/activities/activity_view.dart | 221 +- lib/widgets/builders/dialogs.dart | 50 + .../generic/elements/form_search_input.dart | 52 +- pubspec.yaml | 1 + test/drift/sendtrain/generated/schema.dart | 46 +- .../drift/sendtrain/generated/schema_v23.dart | 2669 ++++++++++++++++ .../drift/sendtrain/generated/schema_v24.dart | 2670 ++++++++++++++++ .../drift/sendtrain/generated/schema_v25.dart | 2702 +++++++++++++++++ .../drift/sendtrain/generated/schema_v26.dart | 2701 ++++++++++++++++ .../drift/sendtrain/generated/schema_v27.dart | 2701 ++++++++++++++++ .../drift/sendtrain/generated/schema_v28.dart | 2701 ++++++++++++++++ .../drift/sendtrain/generated/schema_v29.dart | 2702 +++++++++++++++++ .../drift/sendtrain/generated/schema_v30.dart | 2702 +++++++++++++++++ .../drift/sendtrain/generated/schema_v31.dart | 2702 +++++++++++++++++ .../drift/sendtrain/generated/schema_v32.dart | 2702 +++++++++++++++++ .../drift/sendtrain/generated/schema_v33.dart | 2702 +++++++++++++++++ 39 files changed, 32576 insertions(+), 251 deletions(-) create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v23.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v24.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v25.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v26.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v27.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v28.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v29.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v30.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v31.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v32.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v33.json create mode 100644 lib/models/action_model.dart create mode 100644 lib/providers/action_timer.dart create mode 100644 lib/widgets/activities/activity_action_editor.dart create mode 100644 test/drift/sendtrain/generated/schema_v23.dart create mode 100644 test/drift/sendtrain/generated/schema_v24.dart create mode 100644 test/drift/sendtrain/generated/schema_v25.dart create mode 100644 test/drift/sendtrain/generated/schema_v26.dart create mode 100644 test/drift/sendtrain/generated/schema_v27.dart create mode 100644 test/drift/sendtrain/generated/schema_v28.dart create mode 100644 test/drift/sendtrain/generated/schema_v29.dart create mode 100644 test/drift/sendtrain/generated/schema_v30.dart create mode 100644 test/drift/sendtrain/generated/schema_v31.dart create mode 100644 test/drift/sendtrain/generated/schema_v32.dart create mode 100644 test/drift/sendtrain/generated/schema_v33.dart diff --git a/lib/daos/actions_dao.dart b/lib/daos/actions_dao.dart index 0911766..dbdbffe 100644 --- a/lib/daos/actions_dao.dart +++ b/lib/daos/actions_dao.dart @@ -32,4 +32,6 @@ class ActionsDao extends DatabaseAccessor with _$ActionsDaoMixin { return actions; } + + Future createOrUpdate(ActionsCompanion action) => into(actions).insertOnConflictUpdate(action); } diff --git a/lib/database/database.dart b/lib/database/database.dart index 4d7bacb..382581a 100644 --- a/lib/database/database.dart +++ b/lib/database/database.dart @@ -35,7 +35,7 @@ class AppDatabase extends _$AppDatabase { AppDatabase() : super(_openConnection()); @override - int get schemaVersion => 22; + int get schemaVersion => 33; @override MigrationStrategy get migration { @@ -165,6 +165,9 @@ class ActivityActions extends Table { } enum RepType { time, count } + +enum ActionStatus { pending, started, paused, complete } + class Actions extends Table { IntColumn get id => integer().autoIncrement()(); TextColumn get title => text().withLength(min: 3, max: 64)(); @@ -181,6 +184,10 @@ class Actions extends Table { TextColumn get setWeights => text().nullable()(); BoolColumn get isAlternating => boolean().withDefault(Variable(false))(); TextColumn get tempo => text().withLength(min: 6, max: 36).nullable()(); + TextColumn get status => + textEnum().withDefault(Variable('pending'))(); + TextColumn get state => text().withDefault(Variable( + "{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}"))(); TextColumn get set => text()(); DateTimeColumn get createdAt => dateTime().withDefault(Variable(DateTime.now()))(); diff --git a/lib/database/database.g.dart b/lib/database/database.g.dart index 8a68ef0..19f07ce 100644 --- a/lib/database/database.g.dart +++ b/lib/database/database.g.dart @@ -1532,6 +1532,22 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), type: DriftSqlType.string, requiredDuringInsert: false); + static const VerificationMeta _statusMeta = const VerificationMeta('status'); + @override + late final GeneratedColumnWithTypeConverter status = + GeneratedColumn('status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')) + .withConverter($ActionsTable.$converterstatus); + static const VerificationMeta _stateMeta = const VerificationMeta('state'); + @override + late final GeneratedColumn state = GeneratedColumn( + '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 set = GeneratedColumn( @@ -1562,6 +1578,8 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { setWeights, isAlternating, tempo, + status, + state, set, createdAt ]; @@ -1653,6 +1671,11 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { 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)); @@ -1703,6 +1726,11 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { .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 @@ -1717,6 +1745,8 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> { static JsonTypeConverter2 $converterrepType = const EnumNameConverter(RepType.values); + static JsonTypeConverter2 $converterstatus = + const EnumNameConverter(ActionStatus.values); } class Action extends DataClass implements Insertable { @@ -1735,6 +1765,8 @@ class Action extends DataClass implements Insertable { final String? setWeights; final bool isAlternating; final String? tempo; + final ActionStatus status; + final String state; final String set; final DateTime createdAt; const Action( @@ -1753,6 +1785,8 @@ class Action extends DataClass implements Insertable { this.setWeights, required this.isAlternating, this.tempo, + required this.status, + required this.state, required this.set, required this.createdAt}); @override @@ -1792,6 +1826,11 @@ class Action extends DataClass implements Insertable { if (!nullToAbsent || tempo != null) { map['tempo'] = Variable(tempo); } + { + map['status'] = + Variable($ActionsTable.$converterstatus.toSql(status)); + } + map['state'] = Variable(state); map['set'] = Variable(set); map['created_at'] = Variable(createdAt); return map; @@ -1829,6 +1868,8 @@ class Action extends DataClass implements Insertable { isAlternating: Value(isAlternating), tempo: tempo == null && nullToAbsent ? const Value.absent() : Value(tempo), + status: Value(status), + state: Value(state), set: Value(set), createdAt: Value(createdAt), ); @@ -1854,6 +1895,9 @@ class Action extends DataClass implements Insertable { setWeights: serializer.fromJson(json['setWeights']), isAlternating: serializer.fromJson(json['isAlternating']), tempo: serializer.fromJson(json['tempo']), + status: $ActionsTable.$converterstatus + .fromJson(serializer.fromJson(json['status'])), + state: serializer.fromJson(json['state']), set: serializer.fromJson(json['set']), createdAt: serializer.fromJson(json['createdAt']), ); @@ -1878,6 +1922,9 @@ class Action extends DataClass implements Insertable { 'setWeights': serializer.toJson(setWeights), 'isAlternating': serializer.toJson(isAlternating), 'tempo': serializer.toJson(tempo), + 'status': serializer + .toJson($ActionsTable.$converterstatus.toJson(status)), + 'state': serializer.toJson(state), 'set': serializer.toJson(set), 'createdAt': serializer.toJson(createdAt), }; @@ -1899,6 +1946,8 @@ class Action extends DataClass implements Insertable { Value setWeights = const Value.absent(), bool? isAlternating, Value tempo = const Value.absent(), + ActionStatus? status, + String? state, String? set, DateTime? createdAt}) => Action( @@ -1923,6 +1972,8 @@ class Action extends DataClass implements Insertable { 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, ); @@ -1956,6 +2007,8 @@ class Action extends DataClass implements Insertable { ? 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, ); @@ -1979,6 +2032,8 @@ class Action extends DataClass implements Insertable { ..write('setWeights: $setWeights, ') ..write('isAlternating: $isAlternating, ') ..write('tempo: $tempo, ') + ..write('status: $status, ') + ..write('state: $state, ') ..write('set: $set, ') ..write('createdAt: $createdAt') ..write(')')) @@ -2002,6 +2057,8 @@ class Action extends DataClass implements Insertable { setWeights, isAlternating, tempo, + status, + state, set, createdAt); @override @@ -2023,6 +2080,8 @@ class Action extends DataClass implements Insertable { 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); } @@ -2043,6 +2102,8 @@ class ActionsCompanion extends UpdateCompanion { final Value setWeights; final Value isAlternating; final Value tempo; + final Value status; + final Value state; final Value set; final Value createdAt; const ActionsCompanion({ @@ -2061,6 +2122,8 @@ class ActionsCompanion extends UpdateCompanion { 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(), }); @@ -2080,6 +2143,8 @@ class ActionsCompanion extends UpdateCompanion { 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), @@ -2104,6 +2169,8 @@ class ActionsCompanion extends UpdateCompanion { Expression? setWeights, Expression? isAlternating, Expression? tempo, + Expression? status, + Expression? state, Expression? set, Expression? createdAt, }) { @@ -2123,6 +2190,8 @@ class ActionsCompanion extends UpdateCompanion { 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, }); @@ -2144,6 +2213,8 @@ class ActionsCompanion extends UpdateCompanion { Value? setWeights, Value? isAlternating, Value? tempo, + Value? status, + Value? state, Value? set, Value? createdAt}) { return ActionsCompanion( @@ -2162,6 +2233,8 @@ class ActionsCompanion extends UpdateCompanion { 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, ); @@ -2216,6 +2289,13 @@ class ActionsCompanion extends UpdateCompanion { if (tempo.present) { map['tempo'] = Variable(tempo.value); } + if (status.present) { + map['status'] = + Variable($ActionsTable.$converterstatus.toSql(status.value)); + } + if (state.present) { + map['state'] = Variable(state.value); + } if (set.present) { map['set'] = Variable(set.value); } @@ -2243,6 +2323,8 @@ class ActionsCompanion extends UpdateCompanion { ..write('setWeights: $setWeights, ') ..write('isAlternating: $isAlternating, ') ..write('tempo: $tempo, ') + ..write('status: $status, ') + ..write('state: $state, ') ..write('set: $set, ') ..write('createdAt: $createdAt') ..write(')')) @@ -4412,6 +4494,8 @@ typedef $$ActionsTableCreateCompanionBuilder = ActionsCompanion Function({ Value setWeights, Value isAlternating, Value tempo, + Value status, + Value state, required String set, Value createdAt, }); @@ -4431,6 +4515,8 @@ typedef $$ActionsTableUpdateCompanionBuilder = ActionsCompanion Function({ Value setWeights, Value isAlternating, Value tempo, + Value status, + Value state, Value set, Value createdAt, }); @@ -4516,6 +4602,14 @@ class $$ActionsTableFilterComposer ColumnFilters get tempo => $composableBuilder( column: $table.tempo, builder: (column) => ColumnFilters(column)); + ColumnWithTypeConverterFilters + get status => $composableBuilder( + column: $table.status, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnFilters(column)); + ColumnFilters get set => $composableBuilder( column: $table.set, builder: (column) => ColumnFilters(column)); @@ -4603,6 +4697,12 @@ class $$ActionsTableOrderingComposer ColumnOrderings get tempo => $composableBuilder( column: $table.tempo, builder: (column) => ColumnOrderings(column)); + ColumnOrderings get status => $composableBuilder( + column: $table.status, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnOrderings(column)); + ColumnOrderings get set => $composableBuilder( column: $table.set, builder: (column) => ColumnOrderings(column)); @@ -4664,6 +4764,12 @@ class $$ActionsTableAnnotationComposer GeneratedColumn get tempo => $composableBuilder(column: $table.tempo, builder: (column) => column); + GeneratedColumnWithTypeConverter get status => + $composableBuilder(column: $table.status, builder: (column) => column); + + GeneratedColumn get state => + $composableBuilder(column: $table.state, builder: (column) => column); + GeneratedColumn get set => $composableBuilder(column: $table.set, builder: (column) => column); @@ -4730,6 +4836,8 @@ class $$ActionsTableTableManager extends RootTableManager< Value setWeights = const Value.absent(), Value isAlternating = const Value.absent(), Value tempo = const Value.absent(), + Value status = const Value.absent(), + Value state = const Value.absent(), Value set = const Value.absent(), Value createdAt = const Value.absent(), }) => @@ -4749,6 +4857,8 @@ class $$ActionsTableTableManager extends RootTableManager< setWeights: setWeights, isAlternating: isAlternating, tempo: tempo, + status: status, + state: state, set: set, createdAt: createdAt, ), @@ -4768,6 +4878,8 @@ class $$ActionsTableTableManager extends RootTableManager< Value setWeights = const Value.absent(), Value isAlternating = const Value.absent(), Value tempo = const Value.absent(), + Value status = const Value.absent(), + Value state = const Value.absent(), required String set, Value createdAt = const Value.absent(), }) => @@ -4787,6 +4899,8 @@ class $$ActionsTableTableManager extends RootTableManager< setWeights: setWeights, isAlternating: isAlternating, tempo: tempo, + status: status, + state: state, set: set, createdAt: createdAt, ), diff --git a/lib/database/database.steps.dart b/lib/database/database.steps.dart index 7f6840a..a3ea27d 100644 --- a/lib/database/database.steps.dart +++ b/lib/database/database.steps.dart @@ -3494,6 +3494,1799 @@ i1.GeneratedColumn _column_53(String aliasedName) => i1.GeneratedColumn _column_54(String aliasedName) => i1.GeneratedColumn('set_weights', aliasedName, true, type: i1.DriftSqlType.string); + +final class Schema23 extends i0.VersionedSchema { + Schema23({required super.database}) : super(version: 23); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape20 actions = Shape20( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_3, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +class Shape20 extends i0.VersionedTable { + Shape20({required super.source, required super.alias}) : super.aliased(); + i1.GeneratedColumn get id => + columnsByName['id']! as i1.GeneratedColumn; + i1.GeneratedColumn get title => + columnsByName['title']! as i1.GeneratedColumn; + i1.GeneratedColumn get description => + columnsByName['body']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalSets => + columnsByName['total_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalReps => + columnsByName['total_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBeforeSets => + columnsByName['rest_before_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenSets => + columnsByName['rest_between_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenReps => + columnsByName['rest_between_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restAfterSets => + columnsByName['rest_after_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get repType => + columnsByName['rep_type']! as i1.GeneratedColumn; + i1.GeneratedColumn get repLength => + columnsByName['rep_length']! as i1.GeneratedColumn; + i1.GeneratedColumn get repWeights => + columnsByName['rep_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get setWeights => + columnsByName['set_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get isAlternating => + columnsByName['is_alternating']! as i1.GeneratedColumn; + i1.GeneratedColumn get tempo => + columnsByName['tempo']! as i1.GeneratedColumn; + i1.GeneratedColumn get status => + columnsByName['status']! as i1.GeneratedColumn; + i1.GeneratedColumn get set => + columnsByName['set']! as i1.GeneratedColumn; + i1.GeneratedColumn get createdAt => + columnsByName['created_at']! as i1.GeneratedColumn; +} + +final class Schema24 extends i0.VersionedSchema { + Schema24({required super.database}) : super(version: 24); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape20 actions = Shape20( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_55, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_55(String aliasedName) => + i1.GeneratedColumn('status', aliasedName, false, + type: i1.DriftSqlType.string, + defaultValue: Variable(ActionStatus.pending.toString())); + +final class Schema25 extends i0.VersionedSchema { + Schema25({required super.database}) : super(version: 25); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_55, + _column_56, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +class Shape21 extends i0.VersionedTable { + Shape21({required super.source, required super.alias}) : super.aliased(); + i1.GeneratedColumn get id => + columnsByName['id']! as i1.GeneratedColumn; + i1.GeneratedColumn get title => + columnsByName['title']! as i1.GeneratedColumn; + i1.GeneratedColumn get description => + columnsByName['body']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalSets => + columnsByName['total_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get totalReps => + columnsByName['total_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBeforeSets => + columnsByName['rest_before_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenSets => + columnsByName['rest_between_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get restBetweenReps => + columnsByName['rest_between_reps']! as i1.GeneratedColumn; + i1.GeneratedColumn get restAfterSets => + columnsByName['rest_after_sets']! as i1.GeneratedColumn; + i1.GeneratedColumn get repType => + columnsByName['rep_type']! as i1.GeneratedColumn; + i1.GeneratedColumn get repLength => + columnsByName['rep_length']! as i1.GeneratedColumn; + i1.GeneratedColumn get repWeights => + columnsByName['rep_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get setWeights => + columnsByName['set_weights']! as i1.GeneratedColumn; + i1.GeneratedColumn get isAlternating => + columnsByName['is_alternating']! as i1.GeneratedColumn; + i1.GeneratedColumn get tempo => + columnsByName['tempo']! as i1.GeneratedColumn; + i1.GeneratedColumn get status => + columnsByName['status']! as i1.GeneratedColumn; + i1.GeneratedColumn get state => + columnsByName['state']! as i1.GeneratedColumn; + i1.GeneratedColumn get set => + columnsByName['set']! as i1.GeneratedColumn; + i1.GeneratedColumn get createdAt => + columnsByName['created_at']! as i1.GeneratedColumn; +} + +i1.GeneratedColumn _column_56(String aliasedName) => + i1.GeneratedColumn('state', aliasedName, true, + type: i1.DriftSqlType.string); + +final class Schema26 extends i0.VersionedSchema { + Schema26({required super.database}) : super(version: 26); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_55, + _column_57, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_57(String aliasedName) => + i1.GeneratedColumn('state', aliasedName, false, + type: i1.DriftSqlType.string, defaultValue: Variable("{}")); + +final class Schema27 extends i0.VersionedSchema { + Schema27({required super.database}) : super(version: 27); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_57, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_58(String aliasedName) => + i1.GeneratedColumn('status', aliasedName, false, + type: i1.DriftSqlType.string, defaultValue: Variable('pending')); + +final class Schema28 extends i0.VersionedSchema { + Schema28({required super.database}) : super(version: 28); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_57, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +final class Schema29 extends i0.VersionedSchema { + Schema29({required super.database}) : super(version: 29); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_59, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_59(String aliasedName) => + i1.GeneratedColumn('state', aliasedName, false, + type: i1.DriftSqlType.string, + defaultValue: + Variable("{'currentSet': 1, 'currentRep': 1, 'currentTime': 0}")); + +final class Schema30 extends i0.VersionedSchema { + Schema30({required super.database}) : super(version: 30); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_59, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +final class Schema31 extends i0.VersionedSchema { + Schema31({required super.database}) : super(version: 31); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_60, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_60(String aliasedName) => + i1.GeneratedColumn('state', aliasedName, false, + type: i1.DriftSqlType.string, + defaultValue: Variable( + "{\"currentSet\": 1, \"currentRep\": 1, \"currentTime\": 0}")); + +final class Schema32 extends i0.VersionedSchema { + Schema32({required super.database}) : super(version: 32); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_61, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_61(String aliasedName) => i1.GeneratedColumn< + String>('state', aliasedName, false, + type: i1.DriftSqlType.string, + defaultValue: Variable( + "{\"currentSet\": 1, \"currentRep\": 1, \"currentTime\": 0, \"currentAction\": 0}")); + +final class Schema33 extends i0.VersionedSchema { + Schema33({required super.database}) : super(version: 33); + @override + late final List entities = [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems, + ]; + late final Shape12 sessions = Shape12( + source: i0.VersionedTable( + entityName: 'sessions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_11, + _column_20, + _column_4, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape17 activities = Shape17( + source: i0.VersionedTable( + entityName: 'activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_40, + _column_36, + _column_37, + _column_38, + _column_27, + _column_28, + _column_29, + _column_35, + _column_31, + _column_32, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape13 sessionActivities = Shape13( + source: i0.VersionedTable( + entityName: 'session_activities', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_21, + _column_22, + _column_19, + _column_10, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape21 actions = Shape21( + source: i0.VersionedTable( + entityName: 'actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_42, + _column_43, + _column_44, + _column_45, + _column_46, + _column_47, + _column_48, + _column_49, + _column_53, + _column_54, + _column_51, + _column_52, + _column_58, + _column_62, + _column_12, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape10 activityActions = Shape10( + source: i0.VersionedTable( + entityName: 'activity_actions', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_22, + _column_23, + _column_19, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape5 mediaItems = Shape5( + source: i0.VersionedTable( + entityName: 'media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_41, + _column_2, + _column_25, + _column_6, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); + late final Shape6 objectMediaItems = Shape6( + source: i0.VersionedTable( + entityName: 'object_media_items', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [ + _column_0, + _column_15, + _column_16, + _column_24, + _column_5, + ], + attachedDatabase: database, + ), + alias: null); +} + +i1.GeneratedColumn _column_62(String aliasedName) => i1.GeneratedColumn< + String>('state', aliasedName, false, + type: i1.DriftSqlType.string, + defaultValue: Variable( + "{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}")); i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, @@ -3516,6 +5309,17 @@ i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema20 schema) from19To20, required Future Function(i1.Migrator m, Schema21 schema) from20To21, required Future Function(i1.Migrator m, Schema22 schema) from21To22, + required Future Function(i1.Migrator m, Schema23 schema) from22To23, + required Future Function(i1.Migrator m, Schema24 schema) from23To24, + required Future Function(i1.Migrator m, Schema25 schema) from24To25, + required Future Function(i1.Migrator m, Schema26 schema) from25To26, + required Future Function(i1.Migrator m, Schema27 schema) from26To27, + required Future Function(i1.Migrator m, Schema28 schema) from27To28, + required Future Function(i1.Migrator m, Schema29 schema) from28To29, + required Future Function(i1.Migrator m, Schema30 schema) from29To30, + required Future Function(i1.Migrator m, Schema31 schema) from30To31, + required Future Function(i1.Migrator m, Schema32 schema) from31To32, + required Future Function(i1.Migrator m, Schema33 schema) from32To33, }) { return (currentVersion, database) async { switch (currentVersion) { @@ -3624,6 +5428,61 @@ i0.MigrationStepWithVersion migrationSteps({ final migrator = i1.Migrator(database, schema); await from21To22(migrator, schema); return 22; + case 22: + final schema = Schema23(database: database); + final migrator = i1.Migrator(database, schema); + await from22To23(migrator, schema); + return 23; + case 23: + final schema = Schema24(database: database); + final migrator = i1.Migrator(database, schema); + await from23To24(migrator, schema); + return 24; + case 24: + final schema = Schema25(database: database); + final migrator = i1.Migrator(database, schema); + await from24To25(migrator, schema); + return 25; + case 25: + final schema = Schema26(database: database); + final migrator = i1.Migrator(database, schema); + await from25To26(migrator, schema); + return 26; + case 26: + final schema = Schema27(database: database); + final migrator = i1.Migrator(database, schema); + await from26To27(migrator, schema); + return 27; + case 27: + final schema = Schema28(database: database); + final migrator = i1.Migrator(database, schema); + await from27To28(migrator, schema); + return 28; + case 28: + final schema = Schema29(database: database); + final migrator = i1.Migrator(database, schema); + await from28To29(migrator, schema); + return 29; + case 29: + final schema = Schema30(database: database); + final migrator = i1.Migrator(database, schema); + await from29To30(migrator, schema); + return 30; + case 30: + final schema = Schema31(database: database); + final migrator = i1.Migrator(database, schema); + await from30To31(migrator, schema); + return 31; + case 31: + final schema = Schema32(database: database); + final migrator = i1.Migrator(database, schema); + await from31To32(migrator, schema); + return 32; + case 32: + final schema = Schema33(database: database); + final migrator = i1.Migrator(database, schema); + await from32To33(migrator, schema); + return 33; default: throw ArgumentError.value('Unknown migration from $currentVersion'); } @@ -3652,6 +5511,17 @@ i1.OnUpgrade stepByStep({ required Future Function(i1.Migrator m, Schema20 schema) from19To20, required Future Function(i1.Migrator m, Schema21 schema) from20To21, required Future Function(i1.Migrator m, Schema22 schema) from21To22, + required Future Function(i1.Migrator m, Schema23 schema) from22To23, + required Future Function(i1.Migrator m, Schema24 schema) from23To24, + required Future Function(i1.Migrator m, Schema25 schema) from24To25, + required Future Function(i1.Migrator m, Schema26 schema) from25To26, + required Future Function(i1.Migrator m, Schema27 schema) from26To27, + required Future Function(i1.Migrator m, Schema28 schema) from27To28, + required Future Function(i1.Migrator m, Schema29 schema) from28To29, + required Future Function(i1.Migrator m, Schema30 schema) from29To30, + required Future Function(i1.Migrator m, Schema31 schema) from30To31, + required Future Function(i1.Migrator m, Schema32 schema) from31To32, + required Future Function(i1.Migrator m, Schema33 schema) from32To33, }) => i0.VersionedSchema.stepByStepHelper( step: migrationSteps( @@ -3676,4 +5546,15 @@ i1.OnUpgrade stepByStep({ from19To20: from19To20, from20To21: from20To21, from21To22: from21To22, + from22To23: from22To23, + from23To24: from23To24, + from24To25: from24To25, + from25To26: from25To26, + from26To27: from26To27, + from27To28: from27To28, + from28To29: from28To29, + from29To30: from29To30, + from30To31: from30To31, + from31To32: from31To32, + from32To33: from32To33, )); diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v23.json b/lib/database/drift_schemas/sendtrain/drift_schema_v23.json new file mode 100644 index 0000000..b184cbd --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v23.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v24.json b/lib/database/drift_schemas/sendtrain/drift_schema_v24.json new file mode 100644 index 0000000..7c541e0 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v24.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(ActionStatus.pending.toString())","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v25.json b/lib/database/drift_schemas/sendtrain/drift_schema_v25.json new file mode 100644 index 0000000..aef1999 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v25.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(ActionStatus.pending.toString())","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v26.json b/lib/database/drift_schemas/sendtrain/drift_schema_v26.json new file mode 100644 index 0000000..94060a6 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v26.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(ActionStatus.pending.toString())","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v27.json b/lib/database/drift_schemas/sendtrain/drift_schema_v27.json new file mode 100644 index 0000000..675545c --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v27.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v28.json b/lib/database/drift_schemas/sendtrain/drift_schema_v28.json new file mode 100644 index 0000000..675545c --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v28.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v29.json b/lib/database/drift_schemas/sendtrain/drift_schema_v29.json new file mode 100644 index 0000000..69d38bb --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v29.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{'currentSet': 1, 'currentRep': 1, 'currentTime': 0}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v30.json b/lib/database/drift_schemas/sendtrain/drift_schema_v30.json new file mode 100644 index 0000000..69d38bb --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v30.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{'currentSet': 1, 'currentRep': 1, 'currentTime': 0}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v31.json b/lib/database/drift_schemas/sendtrain/drift_schema_v31.json new file mode 100644 index 0000000..bd770cb --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v31.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{\\\"currentSet\\\": 1, \\\"currentRep\\\": 1, \\\"currentTime\\\": 0}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v32.json b/lib/database/drift_schemas/sendtrain/drift_schema_v32.json new file mode 100644 index 0000000..e8da237 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v32.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{\\\"currentSet\\\": 1, \\\"currentRep\\\": 1, \\\"currentTime\\\": 0, \\\"currentAction\\\": 0}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/drift_schemas/sendtrain/drift_schema_v33.json b/lib/database/drift_schemas/sendtrain/drift_schema_v33.json new file mode 100644 index 0000000..d5cb7b9 --- /dev/null +++ b/lib/database/drift_schemas/sendtrain/drift_schema_v33.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sessions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":32}}]},{"name":"body","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SessionStatus.values)","dart_type_name":"SessionStatus"}},{"name":"achievements","getter_name":"achievements","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":256}}]},{"name":"date","getter_name":"date","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":100}}]},{"name":"type","getter_name":"type","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityType.values)","dart_type_name":"ActivityType"}},{"name":"body","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"category","getter_name":"category","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityCategories.values)","dart_type_name":"ActivityCategories"}},{"name":"force","getter_name":"force","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"level","getter_name":"level","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityLevel.values)","dart_type_name":"ActivityLevel"}},{"name":"mechanic","getter_name":"mechanic","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMechanic.values)","dart_type_name":"ActivityMechanic"}},{"name":"equipment","getter_name":"equipment","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityEquipment.values)","dart_type_name":"ActivityEquipment"}},{"name":"primary_muscles","getter_name":"primaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"secondary_muscles","getter_name":"secondaryMuscles","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActivityMuscle.values)","dart_type_name":"ActivityMuscle"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[0,1],"type":"table","data":{"name":"session_activities","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"session_id","getter_name":"sessionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES sessions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES sessions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"results","getter_name":"results","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_sets","getter_name":"totalSets","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"total_reps","getter_name":"totalReps","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":1,"max":32}}]},{"name":"rest_before_sets","getter_name":"restBeforeSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_sets","getter_name":"restBetweenSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_between_reps","getter_name":"restBetweenReps","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rest_after_sets","getter_name":"restAfterSets","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_type","getter_name":"repType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RepType.values)","dart_type_name":"RepType"}},{"name":"rep_length","getter_name":"repLength","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rep_weights","getter_name":"repWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"set_weights","getter_name":"setWeights","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_alternating","getter_name":"isAlternating","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_alternating\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_alternating\" IN (0, 1))"},"default_dart":"Variable(false)","default_client_dart":null,"dsl_features":[]},{"name":"tempo","getter_name":"tempo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":6,"max":36}}]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable('pending')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ActionStatus.values)","dart_type_name":"ActionStatus"}},{"name":"state","getter_name":"state","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Variable(\"{\\\"currentSet\\\": 0, \\\"currentRep\\\": 0, \\\"currentActionType\\\": 0, \\\"currentTime\\\": 0, \\\"currentAction\\\": 0}\")","default_client_dart":null,"dsl_features":[]},{"name":"set","getter_name":"set","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[1,3],"type":"table","data":{"name":"activity_actions","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"activity_id","getter_name":"activityId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES activities (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES activities (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"action_id","getter_name":"actionId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES actions (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES actions (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"position","getter_name":"position","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[{"allowed-lengths":{"min":3,"max":64}}]},{"name":"body","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(MediaType.values)","dart_type_name":"MediaType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[5],"type":"table","data":{"name":"object_media_items","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"object_id","getter_name":"objectId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"object_type","getter_name":"objectType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ObjectType.values)","dart_type_name":"ObjectType"}},{"name":"media_id","getter_name":"mediaId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES media_items (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES media_items (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"Variable(DateTime.now())","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} \ No newline at end of file diff --git a/lib/database/seed.dart b/lib/database/seed.dart index 142e5bc..cccc790 100644 --- a/lib/database/seed.dart +++ b/lib/database/seed.dart @@ -183,7 +183,7 @@ Future seedDb(AppDatabase database) async { description: '$k Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.', totalSets: 5, - totalReps: "[5]", + totalReps: "[1]", restBeforeSets: Value(30000), restBetweenSets: Value(300000), restBetweenReps: Value(15000), diff --git a/lib/helpers/date_time_helpers.dart b/lib/helpers/date_time_helpers.dart index 14422f3..980c871 100644 --- a/lib/helpers/date_time_helpers.dart +++ b/lib/helpers/date_time_helpers.dart @@ -9,3 +9,8 @@ String formattedTime(int timeInSecond) { String second = sec.toString().length <= 1 ? "0$sec" : "$sec"; return "$minute:$second"; } + +int toSeconds(int milliseconds) { + int sec = (milliseconds / 1000).floor(); + return sec; +} diff --git a/lib/helpers/widget_helpers.dart b/lib/helpers/widget_helpers.dart index bb6483f..9eb87b8 100644 --- a/lib/helpers/widget_helpers.dart +++ b/lib/helpers/widget_helpers.dart @@ -6,8 +6,12 @@ showMediaDetailWidget(BuildContext context, MediaItem media) { showEditorSheet(context, MediaDetails(media: media)); } -showGenericSheet(BuildContext context, Widget widget) { +showGenericSheet(BuildContext context, Widget widget, + [Color? backgroundColor]) { + backgroundColor ??= Theme.of(context).colorScheme.surfaceBright; + showModalBottomSheet( + backgroundColor: backgroundColor, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), @@ -26,15 +30,15 @@ showEditorSheet(BuildContext context, Widget widget) { } String jsonToDescription(List text) { - String content = ''; + String content = ''; - for (int i = 0; i < text.length; i++) { - if (content.isEmpty) { - content = text[i]; - } else { - content = "$content\n\n${text[i]}"; - } + for (int i = 0; i < text.length; i++) { + if (content.isEmpty) { + content = text[i]; + } else { + content = "$content\n\n${text[i]}"; } - - return content; } + + return content; +} diff --git a/lib/main.dart b/lib/main.dart index f354271..6ffd377 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'package:provider/provider.dart'; import 'package:sendtrain/database/database.dart'; import 'package:sendtrain/helpers/widget_helpers.dart'; import 'package:sendtrain/models/activity_timer_model.dart'; +import 'package:sendtrain/providers/action_timer.dart'; import 'package:sendtrain/widgets/screens/activities_screen.dart'; import 'package:sendtrain/widgets/screens/sessions_screen.dart'; // ignore: unused_import @@ -111,12 +112,14 @@ class _AppState extends State { } void main() { + var db = AppDatabase(); runApp(MultiProvider( providers: [ - ChangeNotifierProvider(create: (context) => ActivityTimerModel()), Provider( - create: (context) => AppDatabase(), + create: (context) => db, dispose: (context, db) => db.close()), + ChangeNotifierProvider(create: (context) => ActivityTimerModel()), + ChangeNotifierProvider(create: (context) => ActionTimer()), ], child: const SendTrain(), )); diff --git a/lib/models/action_model.dart b/lib/models/action_model.dart new file mode 100644 index 0000000..733ea1d --- /dev/null +++ b/lib/models/action_model.dart @@ -0,0 +1,259 @@ +import 'dart:convert'; + +import 'package:sendtrain/daos/actions_dao.dart'; +import 'package:sendtrain/database/database.dart'; +import 'package:sendtrain/helpers/date_time_helpers.dart'; + +class ActionModel { + final ActionsDao dao; + List items; + Action action; + + ActionModel({required this.action, required AppDatabase db}) + : dao = ActionsDao(db), + items = _generateItems(action); + + int get id => action.id; + ActionStatus get status => action.status; + Map get state => json.decode(action.state); + List get sets => items.whereType().toList(); + List get allItems => _flattenedItems(); + int get totalTime { + int time = 0; + for (int i = 0; i < allItems.length; i++) { + Item item = allItems[i]; + time += item.time ?? 0; + } + + return toSeconds(time); + } + + List _flattenedItems() { + List items = []; + + for (int i = 0; i < this.items.length; i++) { + Item item = this.items[i]; + if (item.runtimeType == Set) { + Set setItem = item as Set; + for (int j = 0; j < setItem.items.length; j++) { + items.add(setItem.items[j]); + } + } else { + items.add(item); + } + } + + return items; + } + + static List _generateItems(Action action) { + int totalItems = 0; + int setItems = 0; + List items = []; + final List setReps = json.decode(action.totalReps); + + if (action.restBeforeSets != null) { + items.add(Rest( + id: totalItems, + position: totalItems, + action: action, + time: action.restBeforeSets!, + name: 'prepare')); + } + + for (int i = 0; i < action.totalSets; i++) { + final int totalReps; + + if (setReps.length == 1) { + totalReps = setReps.first; + } else { + totalReps = setReps[i]; + } + + totalItems += 1; + items.add(Set( + id: totalItems, + setOrder: setItems++, + position: totalItems, + action: action, + totalReps: totalReps)); + + if (action.restBetweenSets != null && i < action.totalSets - 1) { + totalItems += 1; + items.add(Rest( + id: totalItems, + position: totalItems, + action: action, + time: action.restBetweenSets!, + name: 'rest')); + } + } + + if (action.restAfterSets != null && totalItems != items.length) { + totalItems += 1; + items.add(Rest( + id: totalItems, + position: totalItems, + action: action, + time: action.restAfterSets!, + name: 'rest')); + } + + return items; + } + + Future updateStatus(ActionStatus status) async { + Action newAction = action.copyWith(id: action.id, status: status); + await dao.createOrUpdate(newAction.toCompanion(true)); + action = newAction; + return newAction; + } + + Future updateState(String state) async { + Action newAction = action.copyWith(id: action.id, state: state); + await dao.createOrUpdate(newAction.toCompanion(true)); + action = newAction; + return newAction; + } +} + +class Item { + final int id; + final Action action; + int position; + List items = []; + dynamic value; + final String name; + int? parentId; + int? time; + + Item( + {required this.id, + required this.position, + required this.action, + this.parentId, + this.time}) + : name = action.title; + + RepType get valueType => action.repType; + String get humanValueType => valueType == RepType.time ? 'seconds' : 'reps'; +} + +class Set extends Item { + final int totalReps; + int? setOrder; + + Set( + {required super.id, + required super.action, + required super.position, + required this.totalReps, + this.setOrder}) { + items = _generateItems(action, id, totalReps); + } + + int? get weightMultiplyer => + action.setWeights != null ? json.decode(action.setWeights!)[id] : null; + List get reps => items.whereType().toList(); + + static List _generateItems(action, id, totalReps) { + List items = []; + // add item for exercise + int position = 0; + + if (action.repType == RepType.time) { + for (int i = 0; i < totalReps; i++) { + position = position > 0 ? position + 1 : position; + items.add(Reps( + id: position, position: position, parentId: id, action: action)); + + if (action.isAlternating) { + items.add(Rest( + id: ++position, + position: position, + parentId: id, + action: action, + time: action.restBetweenReps, + name: 'alternate')); + items.add(Reps( + id: ++position, + position: position, + parentId: id, + action: action)); + + // don't show a rest after the last rep + if (i < totalReps - 1) { + items.add(Rest( + id: ++position, + position: position, + parentId: id, + action: action, + time: action.restBetweenReps, + name: 'prepare')); + } + } + } + } else { + items.add(Reps(id: id, position: position, action: action)); + + if (action.isAlternating) { + items.add(Rest( + id: ++position, + position: position, + parentId: id, + action: action, + time: action.restBetweenReps, + name: 'alternate')); + items.add(Reps(id: id, position: ++position, action: action)); + } + } + + return items; + } +} + +class Reps extends Item { + Reps( + {required super.id, + required super.position, + required super.action, + super.parentId}); + + @override + dynamic get value => type == RepType.time ? time : count; + + RepType get type => action.repType; + @override + int? get time => toSeconds(action.repLength!); + int? get count => getReps(id, json.decode(action.totalReps)); + int? get weight => + action.repWeights != null ? json.decode(action.repWeights!)[id] : null; + + static int getReps(setId, reps) { + if (reps.length > 1) { + return reps[setId]; + } else { + return reps.first; + } + } +} + +class Rest extends Item { + @override + String name; + + Rest( + {required super.id, + required super.position, + required super.action, + super.parentId, + required super.time, + required this.name}); + + // @override + // String get name => 'Rest'; + @override + int get value => toSeconds(time ?? 0); + @override + RepType get valueType => RepType.time; +} diff --git a/lib/providers/action_timer.dart b/lib/providers/action_timer.dart new file mode 100644 index 0000000..39d577f --- /dev/null +++ b/lib/providers/action_timer.dart @@ -0,0 +1,173 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; +import 'package:sendtrain/database/database.dart'; +import 'package:sendtrain/models/action_model.dart'; + +class ActionTimer with ChangeNotifier { + ActionModel? actionModel; + double _progress = 0; + int _currentTime = 0; + final List _scrollControllers = []; + + ActionTimer(); + + Map get state => actionModel?.state ?? _stateConstructor(); + ActionStatus get status => actionModel?.status ?? ActionStatus.pending; + bool get started => status == ActionStatus.started; + bool get paused => status == ActionStatus.paused; + bool get pending => status == ActionStatus.pending; + bool get complete => status == ActionStatus.complete; + bool get available => paused | pending; + List get sets => actionModel!.sets; + List get items => actionModel!.items; + Set get currentSet => sets[state['currentSet']]; + Reps get currentRep => currentSet.reps[state['currentRep']]; + Item get currentAction => allActions[state['currentAction']]; + int get currentTime => _currentTime; + dynamic get currentValue => currentAction.valueType == RepType.time + ? currentTime + : currentAction.value; + List get allActions => actionModel?.allItems ?? []; + String get repType => + actionModel!.action.repType == RepType.time ? 'Seconds' : 'Reps'; + int? get repLength => currentRep.value; + int? get repCount => currentRep.count; + dynamic get repValue => + actionModel!.action.repType == RepType.time ? repLength : repCount; + double get progress => _progress; + int get totalTime => actionModel!.totalTime; + Timer? _periodicTimer; + + Map _stateConstructor() { + return { + 'currentSet': 0, + 'currentRep': 0, + 'currentTime': 0, + 'currentAction': 0 + }; + } + + void setup(ActionModel actionModel, ItemScrollController scrollController, + [bool resetOnLoad = true]) { + if (resetOnLoad) { + if (this.actionModel == actionModel) { + reset(); + } + + this.actionModel = actionModel; + setAction(currentAction.id); + } + + _scrollControllers.add(scrollController); + } + + Future pause() async => + await actionModel?.updateStatus(ActionStatus.paused).whenComplete(() { + _periodicTimer?.cancel(); + notifyListeners(); + }); + + Future start() async { + await actionModel!.updateStatus(ActionStatus.started); + + // start timer + if (_periodicTimer == null || _periodicTimer!.isActive == false) { + _periodicTimer = + Timer.periodic(const Duration(seconds: 1), (Timer timer) async { + switch (currentAction.valueType) { + case RepType.count: + break; + case RepType.time: + _currentTime--; + + if (_currentTime == 0) { + // move to next action + await setAction(state['currentAction'] + 1); + } + + await updateProgress(); + notifyListeners(); + } + }); + } + + notifyListeners(); + } + + Future close() async => + await actionModel!.updateStatus(ActionStatus.complete).whenComplete(() { + _periodicTimer!.cancel(); + notifyListeners(); + }); + + Future reset() async { + await actionModel!.updateStatus(ActionStatus.pending); + await actionModel!.updateState(json.encode(_stateConstructor())); + _periodicTimer?.cancel(); + _progress = 0; + _scrollControllers.clear(); + notifyListeners(); + } + + Future clear() async { + await reset(); + } + + double timeUsed() { + Iterable usedItems = allActions.getRange(0, state['currentAction']); + return usedItems.fold(0.0, (p, c) => p + c.value!); + } + + double totalComplete() { + Iterable usedItems = allActions.getRange(0, state['currentAction']); + return usedItems.length / allActions.length; + } + + updateProgress() { + double repUsed = (currentAction.value - currentTime) / currentAction.value; + _progress = + totalComplete() + ((repUsed < 0 ? 0 : repUsed) / allActions.length); + notifyListeners(); + } + + setAction(int actionNum, [bool isManual = false]) async { + Item item = allActions[actionNum]; + Map newState = state; + + newState['currentAction'] = actionNum; + newState['currentSet'] = item.parentId; + newState['currentRep'] = item.id; + newState['currentTime'] = _currentTime = item.value!; + + await actionModel! + .updateState(json.encode(newState)) + .whenComplete(() async { + if (isManual) { + await pause(); + await updateProgress(); + } + + int index = currentAction.parentId != null + ? currentAction.parentId! + : currentAction.id; + + for (int i = 0; i < _scrollControllers.length; i++) { + ItemScrollController sc = _scrollControllers[i]; + + sc.scrollTo( + index: index, + duration: Duration(milliseconds: 500), + curve: Curves.easeInOutCubic); + } + // _scrollController?.scrollTo( + // index: index, + // duration: Duration(milliseconds: 500), + // curve: Curves.easeInOutCubic); + }); + + notifyListeners(); + } +} diff --git a/lib/widgets/activities/activity_action_editor.dart b/lib/widgets/activities/activity_action_editor.dart new file mode 100644 index 0000000..9422bfd --- /dev/null +++ b/lib/widgets/activities/activity_action_editor.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart' hide Action; +import 'package:sendtrain/database/database.dart'; +import 'package:sendtrain/widgets/generic/elements/form_text_input.dart'; + +class ActivityActionEditor extends StatelessWidget { + ActivityActionEditor({super.key, required this.action, this.callback}); + + final Action action; + final Function? callback; + final GlobalKey _formKey = GlobalKey(); + + final Map actionEditController = { + 'sets': TextEditingController(), + 'reps': TextEditingController(), + 'weight': TextEditingController(), + }; + + @override + Widget build(BuildContext context) { + String editorType = 'Create'; + + return Padding( + padding: EdgeInsets.fromLTRB(15, 0, 15, 15), + child: Form( + key: _formKey, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(top: 10, bottom: 10), + child: Text('$editorType Action', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.titleLarge)), + FormTextInput( + controller: actionEditController['sets']!, + title: 'Total Sets'),]))); + } +} \ No newline at end of file diff --git a/lib/widgets/activities/activity_action_view.dart b/lib/widgets/activities/activity_action_view.dart index 73d965d..14b7255 100644 --- a/lib/widgets/activities/activity_action_view.dart +++ b/lib/widgets/activities/activity_action_view.dart @@ -1,20 +1,26 @@ -import 'dart:convert'; - import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; +import 'package:sendtrain/database/database.dart'; import 'package:sendtrain/extensions/string_extensions.dart'; -import 'package:sendtrain/models/activity_timer_model.dart'; +import 'package:sendtrain/models/action_model.dart'; +import 'package:sendtrain/providers/action_timer.dart'; +import 'package:sendtrain/widgets/generic/elements/add_card_generic.dart'; class ActivityActionView extends StatefulWidget { - const ActivityActionView({super.key, required this.actions}); + const ActivityActionView({super.key, required this.actions, this.resetOnLoad = true}); final List actions; + final bool resetOnLoad; @override State createState() => ActivityActionViewState(); } class ActivityActionViewState extends State { +// class ActivityActionView extends StatelessWidget { + // ActivityActionView({super.key, required this.actions}); + + // final List actions; final ItemScrollController itemScrollController = ItemScrollController(); final ScrollOffsetController scrollOffsetController = ScrollOffsetController(); @@ -23,88 +29,199 @@ class ActivityActionViewState extends State { final ScrollOffsetListener scrollOffsetListener = ScrollOffsetListener.create(); + late final ActionTimer at; + int actionCount = 0; + + GestureDetector gtBuild( + ActionTimer at, Item item, int actionNum, int selectedIndex, + {int? order}) { + // default, for rests + String setItemRef = '-'; + + // non rests decimal reference to item + if (order != null) { + setItemRef = '${order + 1}.${item.position + 1}'; + } + + return GestureDetector(onTap: () { + at.setAction(actionNum, true); + }, child: Consumer(builder: (context, at, child) { + return Row(children: [ + Ink( + width: 70, + padding: const EdgeInsets.all(15), + color: item == at.currentAction + ? Theme.of(context).colorScheme.primaryContainer + : Theme.of(context).colorScheme.onPrimary, + child: Text(textAlign: TextAlign.center, setItemRef)), + Expanded( + child: Ink( + padding: const EdgeInsets.all(15), + color: item == at.currentAction + ? Theme.of(context).colorScheme.surfaceBright + : Theme.of(context).colorScheme.surfaceContainerLow, + child: Text( + textAlign: TextAlign.center, + '${item.name}: ${item.value} ${item.humanValueType}' + .toTitleCase()))) + ]); + })); + } + + @override + void initState() { + super.initState(); + at = Provider.of(context, listen: false); + } + @override Widget build(BuildContext context) { - ActivityTimerModel atm = - Provider.of(context, listen: true); - List sets = json.decode(widget.actions[0].set); + if (widget.actions.isNotEmpty) { + at.setup(ActionModel( + action: widget.actions.first, db: Provider.of(context)), itemScrollController, widget.resetOnLoad); - // we need to set the scroll controller - // so we can update the selected item position - atm.setScrollController(itemScrollController); + // WidgetsBinding.instance.addPostFrameCallback((_) { + // if (itemScrollController.isAttached) { + // itemScrollController.scrollTo( + // index: at.currentAction.parentId != null + // ? at.currentAction.parentId! + // : at.currentAction.id, + // duration: Duration(milliseconds: 500), + // curve: Curves.easeInOutCubic); + // } + // }); - return Expanded( - child: ScrollablePositionedList.builder( - padding: const EdgeInsets.fromLTRB(10, 0, 10, 20), - itemCount: sets.length, - itemScrollController: itemScrollController, - scrollOffsetController: scrollOffsetController, - itemPositionsListener: itemPositionsListener, - scrollOffsetListener: scrollOffsetListener, - itemBuilder: (BuildContext context, int setNum) { - List content = []; - List set = sets[setNum]; + return Expanded( + child: Column(children: [ + Padding( + padding: const EdgeInsets.only(left: 10, right: 10), + child: Card( + clipBehavior: Clip.antiAlias, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + topRight: Radius.circular(10)), + ), + color: Theme.of(context).colorScheme.onPrimary, + child: Row(children: [ + Ink( + width: 70, + color: Theme.of(context).colorScheme.primaryContainer, + child: Consumer( + builder: (context, at, child) { + return IconButton( + alignment: AlignmentDirectional.center, + icon: at.available + ? const Icon(Icons.play_arrow_rounded) + : const Icon(Icons.pause_rounded), + onPressed: () => { + if (at.started) + {at.pause()} + else if (at.available) + {at.start()} + }); + }, + )), + Expanded( + flex: 1, + child: Stack(alignment: Alignment.center, children: [ + Container( + alignment: Alignment.center, + child: Consumer( + builder: (context, at, child) { + return Text( + style: const TextStyle(fontSize: 20), + textAlign: TextAlign.center, + '${at.currentValue} ${at.currentAction.humanValueType}' + .toTitleCase()); + }, + ), + ), + Container( + alignment: Alignment.centerRight, + padding: EdgeInsets.only(right: 15), + child: Consumer( + builder: (context, at, child) { + return Text( + style: const TextStyle(fontSize: 12), + textAlign: TextAlign.right, + '${at.state['currentAction'] + 1} of ${at.allActions.length}'); + })), + ])), + ]))), + Padding( + padding: EdgeInsets.only(left: 14, right: 14), + child: Consumer(builder: (context, at, child) { + return LinearProgressIndicator( + value: at.progress, + semanticsLabel: 'Activity Progress', + ); + })), + Expanded( + child: ScrollablePositionedList.builder( + padding: const EdgeInsets.fromLTRB(10, 0, 10, 20), + itemCount: at.items.length, + // initialScrollIndex: at.currentAction.parentId != null + // ? at.currentAction.parentId! + // : at.currentAction.id, + itemScrollController: itemScrollController, + scrollOffsetController: scrollOffsetController, + itemPositionsListener: itemPositionsListener, + scrollOffsetListener: scrollOffsetListener, + itemBuilder: (BuildContext context, int itemNum) { + if (itemNum == 0) { + actionCount = 0; + } - for (int actionNum = 0; actionNum < set.length; actionNum++) { - Map setItem = set[actionNum]; + List content = []; + Item item = at.items[itemNum]; + if (item.runtimeType == Rest) { + content.add(gtBuild(at, item, actionCount++, itemNum)); + } else if (item.runtimeType == Set) { + List setItems = item.items; - content.add(GestureDetector( - onTap: () { - atm.setAction(setNum, actionNum, 'manual'); - atm.setActionCount(); + for (int setItemNum = 0; + setItemNum < setItems.length; + setItemNum++) { + Item setItem = setItems[setItemNum]; + content.add(gtBuild(at, setItem, actionCount++, itemNum, + order: (item as Set).setOrder)); + } + } - itemScrollController.scrollTo( - index: setNum, - duration: Duration(milliseconds: 500), - curve: Curves.easeInOutCubic); - }, - child: Row(children: [ - Ink( - width: 70, - padding: const EdgeInsets.all(15), - color: atm.isCurrentItem(setNum, actionNum) - ? Theme.of(context).colorScheme.primaryContainer - : Theme.of(context).colorScheme.onPrimary, - child: Text( - textAlign: TextAlign.center, - '${setNum + 1}.${actionNum + 1} ')), - Expanded( - child: Ink( - padding: const EdgeInsets.all(15), - color: atm.isCurrentItem(setNum, actionNum) - ? Theme.of(context).colorScheme.surfaceBright - : Theme.of(context).colorScheme.surfaceContainerLow, - child: Text( - textAlign: TextAlign.center, - '${setItem['name']}: ${setItem['amount']} ${setItem['type']}'.toTitleCase()))) - ]))); - } - - if (setNum == 0) { - return Card( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(0), - topRight: Radius.circular(0), - bottomLeft: Radius.circular(10), - bottomRight: Radius.circular(10)), - ), - clipBehavior: Clip.antiAlias, - child: Column(children: content)); - } else { - return Card( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - topRight: Radius.circular(10), - bottomLeft: Radius.circular(10), - bottomRight: Radius.circular(10)), - ), - clipBehavior: Clip.antiAlias, - child: Column(children: content)); - } - // return Column(children: contents); - }, - )); + if (itemNum == 0) { + return Card( + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(0), + topRight: Radius.circular(0), + bottomLeft: Radius.circular(10), + bottomRight: Radius.circular(10)), + ), + clipBehavior: Clip.antiAlias, + child: Column(children: content)); + } else { + return Card( + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + topRight: Radius.circular(10), + bottomLeft: Radius.circular(10), + bottomRight: Radius.circular(10)), + ), + clipBehavior: Clip.antiAlias, + child: Column(children: content)); + } + })) + ])); + } else { + return AddCardGeneric( + title: 'Add an Action!', + description: + 'Click here to create an exercise template (sets and reps, etc) for your activity!', + action: () { + print('teset'); + }); + } } } diff --git a/lib/widgets/activities/activity_view.dart b/lib/widgets/activities/activity_view.dart index d1c5d94..be0c517 100644 --- a/lib/widgets/activities/activity_view.dart +++ b/lib/widgets/activities/activity_view.dart @@ -1,17 +1,17 @@ import 'dart:convert'; -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' hide Action; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:provider/provider.dart'; import 'package:sendtrain/daos/actions_dao.dart'; import 'package:sendtrain/database/database.dart'; import 'package:sendtrain/extensions/string_extensions.dart'; import 'package:sendtrain/helpers/widget_helpers.dart'; -import 'package:sendtrain/models/activity_timer_model.dart'; +import 'package:sendtrain/widgets/activities/activity_action_editor.dart'; import 'package:sendtrain/widgets/activities/activity_action_view.dart'; import 'package:sendtrain/widgets/activities/activity_view_categories.dart'; import 'package:sendtrain/widgets/activities/activity_view_media.dart'; -import 'package:sendtrain/widgets/generic/elements/add_card_generic.dart'; +import 'package:sendtrain/widgets/builders/dialogs.dart'; class ActivityView extends StatefulWidget { const ActivityView({super.key, required this.activity}); @@ -22,7 +22,7 @@ class ActivityView extends StatefulWidget { } class _ActivityViewState extends State { - List activity_muscle(Activity activity) { + List activityMuscle(Activity activity) { List muscles = []; if (activity.primaryMuscles != null) { @@ -36,132 +36,72 @@ class _ActivityViewState extends State { return muscles; } - List action(actions) { - if (actions.isNotEmpty) { - return [ - Padding( - padding: const EdgeInsets.only(left: 10, right: 10), - child: Card( - clipBehavior: Clip.antiAlias, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - topRight: Radius.circular(10)), - ), - color: Theme.of(context).colorScheme.onPrimary, - child: Row(children: [ - Ink( - width: 70, - color: Theme.of(context).colorScheme.primaryContainer, - child: Consumer( - builder: (context, atm, child) { - return IconButton( - alignment: AlignmentDirectional.center, - icon: atm.isActive - ? const Icon(Icons.pause_rounded) - : const Icon(Icons.play_arrow_rounded), - onPressed: () => - {atm.isActive ? atm.pause() : atm.start()}); - }, - )), - Expanded( - flex: 1, - child: Stack(alignment: Alignment.center, children: [ - Container( - alignment: Alignment.center, - child: Consumer( - builder: (context, atm, child) { - return Text( - style: const TextStyle(fontSize: 20), - textAlign: TextAlign.center, - '${atm.actionCount} ${atm.currentAction['type']}' - .toTitleCase()); - }, - ), - ), - Container( - alignment: Alignment.centerRight, - padding: EdgeInsets.only(right: 15), - child: Consumer( - builder: (context, atm, child) { - return Text( - style: const TextStyle(fontSize: 12), - textAlign: TextAlign.right, - '${atm.currentAction['actionID'] + 1} of ${atm.totalActions()}'); - })), - ])), - ]))), - Padding( - padding: EdgeInsets.only(left: 14, right: 14), - child: Consumer(builder: (context, atm, child) { - return LinearProgressIndicator( - value: atm.progress, - semanticsLabel: 'Activity Progress', - ); - })), - ActivityActionView(actions: actions) - ]; - } else { - return [ - AddCardGeneric( - title: 'Add an Action!', - description: - 'Click here to create an exercise template (sets and reps, etc) for your activity!', - action: () { - print('teset'); - }) - ]; - } - } - @override Widget build(BuildContext context) { final Activity activity = widget.activity; - ActivityTimerModel atm = - Provider.of(context, listen: false); return FutureBuilder( future: ActionsDao(Provider.of(context)) .fromActivity(activity), builder: (context, snapshot) { if (snapshot.hasData) { - List actions = snapshot.data!; - atm.setup(activity, actions); + List actions = snapshot.data! as List; - return Scaffold( - floatingActionButtonLocation: ExpandableFab.location, - floatingActionButton: ExpandableFab( - distance: 70, - type: ExpandableFabType.up, - overlayStyle: ExpandableFabOverlayStyle( - color: Colors.black.withOpacity(0.5), - blur: 10, - ), - children: [ - // FloatingActionButton.extended( - // icon: const Icon(Icons.upload_outlined), - // label: Text('Upload Media'), - // onPressed: () {}, - // ), - FloatingActionButton.extended( - icon: const Icon(Icons.note_add_outlined), - label: Text('Add Note'), - onPressed: () {}, - ), - FloatingActionButton.extended( - icon: const Icon(Icons.history_outlined), - label: Text('Restart'), - onPressed: () {}, - ), - FloatingActionButton.extended( - icon: const Icon(Icons.done_all_outlined), - label: Text('Done'), - onPressed: () {}, - ), - ]), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) async { + if (didPop) { + return; + } + final bool shouldPop = await showBackDialog(context) ?? false; + if (context.mounted && shouldPop) { + Navigator.pop(context); + } + }, + child: Scaffold( + floatingActionButtonLocation: ExpandableFab.location, + floatingActionButton: ExpandableFab( + distance: 70, + type: ExpandableFabType.up, + overlayStyle: ExpandableFabOverlayStyle( + color: Colors.black.withOpacity(0.5), + blur: 10, + ), + children: [ + // FloatingActionButton.extended( + // icon: const Icon(Icons.upload_outlined), + // label: Text('Upload Media'), + // onPressed: () {}, + // ), + FloatingActionButton.extended( + icon: const Icon(Icons.done_all_outlined), + label: Text('Edit Action'), + onPressed: () { + showEditorSheet( + context, + ActivityActionEditor( + action: actions.first, callback: () {})); + }, + ), + FloatingActionButton.extended( + icon: const Icon(Icons.note_add_outlined), + label: Text('Add Note'), + onPressed: () {}, + ), + FloatingActionButton.extended( + icon: const Icon(Icons.history_outlined), + label: Text('Restart'), + onPressed: () {}, + ), + FloatingActionButton.extended( + icon: const Icon(Icons.done_all_outlined), + label: Text('Done'), + onPressed: () {}, + ), + ]), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ AppBar( titleSpacing: 0, centerTitle: true, @@ -215,7 +155,7 @@ class _ActivityViewState extends State { List>( icon: Icon(Icons.person), text: 'Muscles used', - object: activity_muscle(activity)) + object: activityMuscle(activity)) ])), Padding( padding: const EdgeInsets.only( @@ -272,16 +212,35 @@ class _ActivityViewState extends State { fontWeight: FontWeight.bold), 'Media:')), ActivityViewMedia(activity: activity), - const Padding( - padding: EdgeInsets.fromLTRB(15, 30, 0, 10), - child: Text( - textAlign: TextAlign.left, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold), - 'Actions')), - ] + - action(actions))); + Padding( + padding: const EdgeInsets.fromLTRB(15, 20, 5, 0), + child: Row(children: [ + Expanded( + child: const Text( + textAlign: TextAlign.left, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold), + 'Actions')), + IconButton( + onPressed: () { + showGenericSheet( + context, + Column(children: [ + ActivityActionView( + actions: actions, + resetOnLoad: false) + ]), + Theme.of(context).colorScheme.surface); + }, + icon: Icon(Icons.expand), + alignment: Alignment.bottomCenter, + ) + ])), + ActivityActionView(actions: actions) + ]))); + // ] + + // action(actions, context))); } else { return Container( alignment: Alignment.center, diff --git a/lib/widgets/builders/dialogs.dart b/lib/widgets/builders/dialogs.dart index 72cb411..a8078a1 100644 --- a/lib/widgets/builders/dialogs.dart +++ b/lib/widgets/builders/dialogs.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:sendtrain/providers/action_timer.dart'; Future showGenericDialog(dynamic object, BuildContext parentContext) { return showGeneralDialog( @@ -55,3 +57,51 @@ Future showUpdateDialog(String title, String content, BuildContext context, [Function? callback]) { return showCrudDialog(title, content, context, callback); } + +// TODO - factor out, this should be more generic +Future showBackDialog(BuildContext context) async { + ActionTimer at = Provider.of(context, listen: false); + + if (at.pending || at.complete) { + await at.clear(); + return true; + } else { + return await showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Are you sure?'), + content: const Text( + 'Leaving will stop the current activity. Are you sure you want to leave?', + ), + actions: [ + TextButton( + style: TextButton.styleFrom( + textStyle: Theme.of(context).textTheme.labelLarge, + ), + child: const Text('Nevermind'), + onPressed: () async { + Navigator.pop(context, false); + }, + ), + TextButton( + style: TextButton.styleFrom( + textStyle: Theme.of(context).textTheme.labelLarge, + ), + child: const Text('Leave'), + onPressed: () async { + ActionTimer at = + Provider.of(context, listen: false); + await at.clear(); + + if (context.mounted) { + Navigator.pop(context, true); + } + }, + ), + ], + ); + }, + ); + } +} diff --git a/lib/widgets/generic/elements/form_search_input.dart b/lib/widgets/generic/elements/form_search_input.dart index 1836f25..a3ae776 100644 --- a/lib/widgets/generic/elements/form_search_input.dart +++ b/lib/widgets/generic/elements/form_search_input.dart @@ -82,33 +82,35 @@ class _FormSearchInputState extends State { @override Widget build(BuildContext context) { return SearchAnchor( + isFullScreen: false, builder: (BuildContext context, SearchController controller) { - return FormTextInput( - controller: widget.controller, - title: widget.title ?? "", - icon: Icon(Icons.search_rounded), - maxLines: 2, - requiresValidation: false, - onTap: () { - controller.openView(); - }); - }, suggestionsBuilder: + return FormTextInput( + controller: widget.controller, + title: widget.title ?? "", + icon: Icon(Icons.search_rounded), + maxLines: 2, + requiresValidation: false, + onTap: () { + controller.openView(); + }); + }, + suggestionsBuilder: (BuildContext context, SearchController controller) async { - final List? options = - (await debouncer.process(controller.text))?.toList(); - if (options == null) { - return _lastOptions; - } - _lastOptions = List.generate(options.length, (int index) { - final Suggestion item = options[index]; - final dynamic content = item.content; - return service.resultWidget(content, () { - resultHandler(content, service); - controller.closeView(null); - }); - }); + final List? options = + (await debouncer.process(controller.text))?.toList(); + if (options == null) { + return _lastOptions; + } + _lastOptions = List.generate(options.length, (int index) { + final Suggestion item = options[index]; + final dynamic content = item.content; + return service.resultWidget(content, () { + resultHandler(content, service); + controller.closeView(null); + }); + }); - return _lastOptions; - }); + return _lastOptions; + }); } } diff --git a/pubspec.yaml b/pubspec.yaml index a4c09d8..2748ab5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,6 +51,7 @@ dependencies: mime: ^2.0.0 video_player: ^2.9.2 dart_casing: ^3.0.1 + collection: ^1.18.0 flutter_launcher_name: name: "SendTrain" diff --git a/test/drift/sendtrain/generated/schema.dart b/test/drift/sendtrain/generated/schema.dart index 3333477..2ad4626 100644 --- a/test/drift/sendtrain/generated/schema.dart +++ b/test/drift/sendtrain/generated/schema.dart @@ -25,6 +25,17 @@ import 'schema_v9.dart' as v9; import 'schema_v20.dart' as v20; import 'schema_v21.dart' as v21; import 'schema_v22.dart' as v22; +import 'schema_v23.dart' as v23; +import 'schema_v24.dart' as v24; +import 'schema_v25.dart' as v25; +import 'schema_v26.dart' as v26; +import 'schema_v27.dart' as v27; +import 'schema_v28.dart' as v28; +import 'schema_v29.dart' as v29; +import 'schema_v30.dart' as v30; +import 'schema_v31.dart' as v31; +import 'schema_v32.dart' as v32; +import 'schema_v33.dart' as v33; class GeneratedHelper implements SchemaInstantiationHelper { @override @@ -74,6 +85,28 @@ class GeneratedHelper implements SchemaInstantiationHelper { return v21.DatabaseAtV21(db); case 22: return v22.DatabaseAtV22(db); + case 23: + return v23.DatabaseAtV23(db); + case 24: + return v24.DatabaseAtV24(db); + case 25: + return v25.DatabaseAtV25(db); + case 26: + return v26.DatabaseAtV26(db); + case 27: + return v27.DatabaseAtV27(db); + case 28: + return v28.DatabaseAtV28(db); + case 29: + return v29.DatabaseAtV29(db); + case 30: + return v30.DatabaseAtV30(db); + case 31: + return v31.DatabaseAtV31(db); + case 32: + return v32.DatabaseAtV32(db); + case 33: + return v33.DatabaseAtV33(db); default: throw MissingSchemaException(version, versions); } @@ -101,6 +134,17 @@ class GeneratedHelper implements SchemaInstantiationHelper { 19, 20, 21, - 22 + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33 ]; } diff --git a/test/drift/sendtrain/generated/schema_v23.dart b/test/drift/sendtrain/generated/schema_v23.dart new file mode 100644 index 0000000..1a26b69 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v23.dart @@ -0,0 +1,2669 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => [ + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeights, + setWeights, + isAlternating, + tempo, + status, + set, + createdAt + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'actions'; + @override + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}status'])!, + set: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}set'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String set; + final DateTime createdAt; + const ActionsData( + {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.set, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['set'] = Variable(set); + map['created_at'] = Variable(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), + set: Value(set), + createdAt: Value(createdAt), + ); + } + + factory ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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, + set: data.set.present ? data.set.value : this.set, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActionsData(') + ..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('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, + set, + createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActionsData && + 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.set == this.set && + other.createdAt == this.createdAt); +} + +class ActionsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value set; + final Value 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.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 String 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(), + required String status, + required String set, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + totalSets = Value(totalSets), + totalReps = Value(totalReps), + repType = Value(repType), + status = Value(status), + set = Value(set); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? set, + Expression? 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 (set != null) 'set': set, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActionsCompanion copyWith( + {Value? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? set, + Value? 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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('set: $set, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV23 extends GeneratedDatabase { + DatabaseAtV23(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 23; +} diff --git a/test/drift/sendtrain/generated/schema_v24.dart b/test/drift/sendtrain/generated/schema_v24.dart new file mode 100644 index 0000000..843fcf6 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v24.dart @@ -0,0 +1,2670 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable(ActionStatus.pending.toString())); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => [ + id, + title, + description, + totalSets, + totalReps, + restBeforeSets, + restBetweenSets, + restBetweenReps, + restAfterSets, + repType, + repLength, + repWeights, + setWeights, + isAlternating, + tempo, + status, + set, + createdAt + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'actions'; + @override + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}status'])!, + set: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}set'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String set; + final DateTime createdAt; + const ActionsData( + {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.set, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['set'] = Variable(set); + map['created_at'] = Variable(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), + set: Value(set), + createdAt: Value(createdAt), + ); + } + + factory ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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, + set: data.set.present ? data.set.value : this.set, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActionsData(') + ..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('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, + set, + createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActionsData && + 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.set == this.set && + other.createdAt == this.createdAt); +} + +class ActionsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value set; + final Value 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.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 String 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(), + 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? set, + Expression? 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 (set != null) 'set': set, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActionsCompanion copyWith( + {Value? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? set, + Value? 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, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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('set: $set, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV24 extends GeneratedDatabase { + DatabaseAtV24(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 24; +} diff --git a/test/drift/sendtrain/generated/schema_v25.dart b/test/drift/sendtrain/generated/schema_v25.dart new file mode 100644 index 0000000..4ed1ce2 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v25.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable(ActionStatus.pending.toString())); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String? state; + final String set; + final DateTime createdAt; + const ActionsData( + {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, + this.state, + required this.set, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + if (!nullToAbsent || state != null) { + map['state'] = Variable(state); + } + map['set'] = Variable(set); + map['created_at'] = Variable(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: + state == null && nullToAbsent ? const Value.absent() : Value(state), + set: Value(set), + createdAt: Value(createdAt), + ); + } + + factory ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + Value state = const Value.absent(), + String? set, + DateTime? createdAt}) => + ActionsData( + 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.present ? state.value : this.state, + set: set ?? this.set, + createdAt: createdAt ?? this.createdAt, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV25 extends GeneratedDatabase { + DatabaseAtV25(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 25; +} diff --git a/test/drift/sendtrain/generated/schema_v26.dart b/test/drift/sendtrain/generated/schema_v26.dart new file mode 100644 index 0000000..9f320e7 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v26.dart @@ -0,0 +1,2701 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable(ActionStatus.pending.toString())); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable("{}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV26 extends GeneratedDatabase { + DatabaseAtV26(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 26; +} diff --git a/test/drift/sendtrain/generated/schema_v27.dart b/test/drift/sendtrain/generated/schema_v27.dart new file mode 100644 index 0000000..f002ba1 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v27.dart @@ -0,0 +1,2701 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable("{}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV27 extends GeneratedDatabase { + DatabaseAtV27(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 27; +} diff --git a/test/drift/sendtrain/generated/schema_v28.dart b/test/drift/sendtrain/generated/schema_v28.dart new file mode 100644 index 0000000..2cb62c5 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v28.dart @@ -0,0 +1,2701 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable("{}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV28 extends GeneratedDatabase { + DatabaseAtV28(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 28; +} diff --git a/test/drift/sendtrain/generated/schema_v29.dart b/test/drift/sendtrain/generated/schema_v29.dart new file mode 100644 index 0000000..07bff1f --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v29.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: + Variable("{'currentSet': 1, 'currentRep': 1, 'currentTime': 0}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV29 extends GeneratedDatabase { + DatabaseAtV29(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 29; +} diff --git a/test/drift/sendtrain/generated/schema_v30.dart b/test/drift/sendtrain/generated/schema_v30.dart new file mode 100644 index 0000000..e2f9e5c --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v30.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: + Variable("{'currentSet': 1, 'currentRep': 1, 'currentTime': 0}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV30 extends GeneratedDatabase { + DatabaseAtV30(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 30; +} diff --git a/test/drift/sendtrain/generated/schema_v31.dart b/test/drift/sendtrain/generated/schema_v31.dart new file mode 100644 index 0000000..5d5d4d3 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v31.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable( + "{\"currentSet\": 1, \"currentRep\": 1, \"currentTime\": 0}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV31 extends GeneratedDatabase { + DatabaseAtV31(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 31; +} diff --git a/test/drift/sendtrain/generated/schema_v32.dart b/test/drift/sendtrain/generated/schema_v32.dart new file mode 100644 index 0000000..ca1ff2d --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v32.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable( + "{\"currentSet\": 1, \"currentRep\": 1, \"currentTime\": 0, \"currentAction\": 0}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV32 extends GeneratedDatabase { + DatabaseAtV32(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 32; +} diff --git a/test/drift/sendtrain/generated/schema_v33.dart b/test/drift/sendtrain/generated/schema_v33.dart new file mode 100644 index 0000000..288c4e6 --- /dev/null +++ b/test/drift/sendtrain/generated/schema_v33.dart @@ -0,0 +1,2702 @@ +// dart format width=80 +// GENERATED CODE, DO NOT EDIT BY HAND. +// ignore_for_file: type=lint +import 'package:drift/drift.dart'; + +class Sessions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Sessions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn achievements = GeneratedColumn( + 'achievements', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn address = GeneratedColumn( + 'address', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionsData( + 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: 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 + Sessions createAlias(String alias) { + return Sessions(attachedDatabase, alias); + } +} + +class SessionsData extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final String status; + final String? achievements; + final String? address; + final DateTime? date; + final DateTime createdAt; + const SessionsData( + {required this.id, + required this.title, + required this.content, + required this.status, + this.achievements, + this.address, + this.date, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + map['status'] = Variable(status); + if (!nullToAbsent || achievements != null) { + map['achievements'] = Variable(achievements); + } + if (!nullToAbsent || address != null) { + map['address'] = Variable(address); + } + if (!nullToAbsent || date != null) { + map['date'] = Variable(date); + } + map['created_at'] = Variable(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 SessionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + status: serializer.fromJson(json['status']), + achievements: serializer.fromJson(json['achievements']), + address: serializer.fromJson(json['address']), + date: serializer.fromJson(json['date']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'status': serializer.toJson(status), + 'achievements': serializer.toJson(achievements), + 'address': serializer.toJson(address), + 'date': serializer.toJson(date), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionsData copyWith( + {int? id, + String? title, + String? content, + String? status, + Value achievements = const Value.absent(), + Value address = const Value.absent(), + Value date = const Value.absent(), + DateTime? createdAt}) => + SessionsData( + 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, + ); + SessionsData copyWithCompanion(SessionsCompanion data) { + return SessionsData( + 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('SessionsData(') + ..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 SessionsData && + 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 { + final Value id; + final Value title; + final Value content; + final Value status; + final Value achievements; + final Value address; + final Value date; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? status, + Expression? achievements, + Expression? address, + Expression? date, + Expression? 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? id, + Value? title, + Value? content, + Value? status, + Value? achievements, + Value? address, + Value? date, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (achievements.present) { + map['achievements'] = Variable(achievements.value); + } + if (address.present) { + map['address'] = Variable(address.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Activities extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Activities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 100), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn force = GeneratedColumn( + 'force', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn level = GeneratedColumn( + 'level', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn mechanic = GeneratedColumn( + 'mechanic', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn equipment = GeneratedColumn( + 'equipment', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn primaryMuscles = GeneratedColumn( + 'primary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn secondaryMuscles = GeneratedColumn( + 'secondary_muscles', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivitiesData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + type: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type']), + description: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body']), + category: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}category']), + force: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}force']), + level: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}level']), + mechanic: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}mechanic']), + equipment: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}equipment']), + primaryMuscles: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}primary_muscles']), + secondaryMuscles: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}secondary_muscles']), + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + Activities createAlias(String alias) { + return Activities(attachedDatabase, alias); + } +} + +class ActivitiesData extends DataClass implements Insertable { + final int id; + final String title; + final String? type; + final String? description; + final String? category; + final String? force; + final String? level; + final String? mechanic; + final String? equipment; + final String? primaryMuscles; + final String? secondaryMuscles; + final DateTime createdAt; + const ActivitiesData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + if (!nullToAbsent || type != null) { + map['type'] = Variable(type); + } + if (!nullToAbsent || description != null) { + map['body'] = Variable(description); + } + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + if (!nullToAbsent || force != null) { + map['force'] = Variable(force); + } + if (!nullToAbsent || level != null) { + map['level'] = Variable(level); + } + if (!nullToAbsent || mechanic != null) { + map['mechanic'] = Variable(mechanic); + } + if (!nullToAbsent || equipment != null) { + map['equipment'] = Variable(equipment); + } + if (!nullToAbsent || primaryMuscles != null) { + map['primary_muscles'] = Variable(primaryMuscles); + } + if (!nullToAbsent || secondaryMuscles != null) { + map['secondary_muscles'] = Variable(secondaryMuscles); + } + map['created_at'] = Variable(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 ActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivitiesData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + type: serializer.fromJson(json['type']), + description: serializer.fromJson(json['description']), + category: serializer.fromJson(json['category']), + force: serializer.fromJson(json['force']), + level: serializer.fromJson(json['level']), + mechanic: serializer.fromJson(json['mechanic']), + equipment: serializer.fromJson(json['equipment']), + primaryMuscles: serializer.fromJson(json['primaryMuscles']), + secondaryMuscles: serializer.fromJson(json['secondaryMuscles']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'type': serializer.toJson(type), + 'description': serializer.toJson(description), + 'category': serializer.toJson(category), + 'force': serializer.toJson(force), + 'level': serializer.toJson(level), + 'mechanic': serializer.toJson(mechanic), + 'equipment': serializer.toJson(equipment), + 'primaryMuscles': serializer.toJson(primaryMuscles), + 'secondaryMuscles': serializer.toJson(secondaryMuscles), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivitiesData copyWith( + {int? id, + String? title, + Value type = const Value.absent(), + Value description = const Value.absent(), + Value category = const Value.absent(), + Value force = const Value.absent(), + Value level = const Value.absent(), + Value mechanic = const Value.absent(), + Value equipment = const Value.absent(), + Value primaryMuscles = const Value.absent(), + Value secondaryMuscles = const Value.absent(), + DateTime? createdAt}) => + ActivitiesData( + 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, + ); + ActivitiesData copyWithCompanion(ActivitiesCompanion data) { + return ActivitiesData( + 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('ActivitiesData(') + ..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 ActivitiesData && + 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 { + final Value id; + final Value title; + final Value type; + final Value description; + final Value category; + final Value force; + final Value level; + final Value mechanic; + final Value equipment; + final Value primaryMuscles; + final Value secondaryMuscles; + final Value 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 custom({ + Expression? id, + Expression? title, + Expression? type, + Expression? description, + Expression? category, + Expression? force, + Expression? level, + Expression? mechanic, + Expression? equipment, + Expression? primaryMuscles, + Expression? secondaryMuscles, + Expression? 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? id, + Value? title, + Value? type, + Value? description, + Value? category, + Value? force, + Value? level, + Value? mechanic, + Value? equipment, + Value? primaryMuscles, + Value? secondaryMuscles, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + if (force.present) { + map['force'] = Variable(force.value); + } + if (level.present) { + map['level'] = Variable(level.value); + } + if (mechanic.present) { + map['mechanic'] = Variable(mechanic.value); + } + if (equipment.present) { + map['equipment'] = Variable(equipment.value); + } + if (primaryMuscles.present) { + map['primary_muscles'] = Variable(primaryMuscles.value); + } + if (secondaryMuscles.present) { + map['secondary_muscles'] = Variable(secondaryMuscles.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 SessionActivities extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + SessionActivities(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES sessions (id) ON DELETE CASCADE')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn results = GeneratedColumn( + 'results', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + SessionActivitiesData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return SessionActivitiesData( + 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 + SessionActivities createAlias(String alias) { + return SessionActivities(attachedDatabase, alias); + } +} + +class SessionActivitiesData extends DataClass + implements Insertable { + final int id; + final int sessionId; + final int activityId; + final int position; + final String? results; + final DateTime createdAt; + const SessionActivitiesData( + {required this.id, + required this.sessionId, + required this.activityId, + required this.position, + this.results, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['session_id'] = Variable(sessionId); + map['activity_id'] = Variable(activityId); + map['position'] = Variable(position); + if (!nullToAbsent || results != null) { + map['results'] = Variable(results); + } + map['created_at'] = Variable(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 SessionActivitiesData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return SessionActivitiesData( + id: serializer.fromJson(json['id']), + sessionId: serializer.fromJson(json['sessionId']), + activityId: serializer.fromJson(json['activityId']), + position: serializer.fromJson(json['position']), + results: serializer.fromJson(json['results']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'sessionId': serializer.toJson(sessionId), + 'activityId': serializer.toJson(activityId), + 'position': serializer.toJson(position), + 'results': serializer.toJson(results), + 'createdAt': serializer.toJson(createdAt), + }; + } + + SessionActivitiesData copyWith( + {int? id, + int? sessionId, + int? activityId, + int? position, + Value results = const Value.absent(), + DateTime? createdAt}) => + SessionActivitiesData( + 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, + ); + SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) { + return SessionActivitiesData( + 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('SessionActivitiesData(') + ..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 SessionActivitiesData && + 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 { + final Value id; + final Value sessionId; + final Value activityId; + final Value position; + final Value results; + final Value 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 custom({ + Expression? id, + Expression? sessionId, + Expression? activityId, + Expression? position, + Expression? results, + Expression? 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? id, + Value? sessionId, + Value? activityId, + Value? position, + Value? results, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (results.present) { + map['results'] = Variable(results.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 Actions extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + Actions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn totalSets = GeneratedColumn( + 'total_sets', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn totalReps = GeneratedColumn( + 'total_reps', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn restBeforeSets = GeneratedColumn( + 'rest_before_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenSets = GeneratedColumn( + 'rest_between_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restBetweenReps = GeneratedColumn( + 'rest_between_reps', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn restAfterSets = GeneratedColumn( + 'rest_after_sets', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repType = GeneratedColumn( + 'rep_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn repLength = GeneratedColumn( + 'rep_length', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + late final GeneratedColumn repWeights = GeneratedColumn( + 'rep_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn setWeights = GeneratedColumn( + 'set_weights', aliasedName, true, + type: DriftSqlType.string, requiredDuringInsert: false); + late final GeneratedColumn isAlternating = GeneratedColumn( + 'is_alternating', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_alternating" IN (0, 1))'), + defaultValue: Variable(false)); + late final GeneratedColumn tempo = GeneratedColumn( + 'tempo', aliasedName, true, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36), + type: DriftSqlType.string, + requiredDuringInsert: false); + late final GeneratedColumn status = GeneratedColumn( + 'status', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable('pending')); + late final GeneratedColumn state = GeneratedColumn( + 'state', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: Variable( + "{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}")); + late final GeneratedColumn set = GeneratedColumn( + 'set', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActionsData( + 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: 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: 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 + Actions createAlias(String alias) { + return Actions(attachedDatabase, alias); + } +} + +class ActionsData extends DataClass implements Insertable { + 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 String repType; + final int? repLength; + final String? repWeights; + final String? setWeights; + final bool isAlternating; + final String? tempo; + final String status; + final String state; + final String set; + final DateTime createdAt; + const ActionsData( + {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 toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['total_sets'] = Variable(totalSets); + map['total_reps'] = Variable(totalReps); + if (!nullToAbsent || restBeforeSets != null) { + map['rest_before_sets'] = Variable(restBeforeSets); + } + if (!nullToAbsent || restBetweenSets != null) { + map['rest_between_sets'] = Variable(restBetweenSets); + } + if (!nullToAbsent || restBetweenReps != null) { + map['rest_between_reps'] = Variable(restBetweenReps); + } + if (!nullToAbsent || restAfterSets != null) { + map['rest_after_sets'] = Variable(restAfterSets); + } + map['rep_type'] = Variable(repType); + if (!nullToAbsent || repLength != null) { + map['rep_length'] = Variable(repLength); + } + if (!nullToAbsent || repWeights != null) { + map['rep_weights'] = Variable(repWeights); + } + if (!nullToAbsent || setWeights != null) { + map['set_weights'] = Variable(setWeights); + } + map['is_alternating'] = Variable(isAlternating); + if (!nullToAbsent || tempo != null) { + map['tempo'] = Variable(tempo); + } + map['status'] = Variable(status); + map['state'] = Variable(state); + map['set'] = Variable(set); + map['created_at'] = Variable(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 ActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActionsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + totalSets: serializer.fromJson(json['totalSets']), + totalReps: serializer.fromJson(json['totalReps']), + restBeforeSets: serializer.fromJson(json['restBeforeSets']), + restBetweenSets: serializer.fromJson(json['restBetweenSets']), + restBetweenReps: serializer.fromJson(json['restBetweenReps']), + restAfterSets: serializer.fromJson(json['restAfterSets']), + repType: serializer.fromJson(json['repType']), + repLength: serializer.fromJson(json['repLength']), + repWeights: serializer.fromJson(json['repWeights']), + setWeights: serializer.fromJson(json['setWeights']), + isAlternating: serializer.fromJson(json['isAlternating']), + tempo: serializer.fromJson(json['tempo']), + status: serializer.fromJson(json['status']), + state: serializer.fromJson(json['state']), + set: serializer.fromJson(json['set']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'totalSets': serializer.toJson(totalSets), + 'totalReps': serializer.toJson(totalReps), + 'restBeforeSets': serializer.toJson(restBeforeSets), + 'restBetweenSets': serializer.toJson(restBetweenSets), + 'restBetweenReps': serializer.toJson(restBetweenReps), + 'restAfterSets': serializer.toJson(restAfterSets), + 'repType': serializer.toJson(repType), + 'repLength': serializer.toJson(repLength), + 'repWeights': serializer.toJson(repWeights), + 'setWeights': serializer.toJson(setWeights), + 'isAlternating': serializer.toJson(isAlternating), + 'tempo': serializer.toJson(tempo), + 'status': serializer.toJson(status), + 'state': serializer.toJson(state), + 'set': serializer.toJson(set), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActionsData copyWith( + {int? id, + String? title, + String? description, + int? totalSets, + String? totalReps, + Value restBeforeSets = const Value.absent(), + Value restBetweenSets = const Value.absent(), + Value restBetweenReps = const Value.absent(), + Value restAfterSets = const Value.absent(), + String? repType, + Value repLength = const Value.absent(), + Value repWeights = const Value.absent(), + Value setWeights = const Value.absent(), + bool? isAlternating, + Value tempo = const Value.absent(), + String? status, + String? state, + String? set, + DateTime? createdAt}) => + ActionsData( + 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, + ); + ActionsData copyWithCompanion(ActionsCompanion data) { + return ActionsData( + 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('ActionsData(') + ..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 ActionsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value totalSets; + final Value totalReps; + final Value restBeforeSets; + final Value restBetweenSets; + final Value restBetweenReps; + final Value restAfterSets; + final Value repType; + final Value repLength; + final Value repWeights; + final Value setWeights; + final Value isAlternating; + final Value tempo; + final Value status; + final Value state; + final Value set; + final Value 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 String 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 custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? totalSets, + Expression? totalReps, + Expression? restBeforeSets, + Expression? restBetweenSets, + Expression? restBetweenReps, + Expression? restAfterSets, + Expression? repType, + Expression? repLength, + Expression? repWeights, + Expression? setWeights, + Expression? isAlternating, + Expression? tempo, + Expression? status, + Expression? state, + Expression? set, + Expression? 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? id, + Value? title, + Value? description, + Value? totalSets, + Value? totalReps, + Value? restBeforeSets, + Value? restBetweenSets, + Value? restBetweenReps, + Value? restAfterSets, + Value? repType, + Value? repLength, + Value? repWeights, + Value? setWeights, + Value? isAlternating, + Value? tempo, + Value? status, + Value? state, + Value? set, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (totalSets.present) { + map['total_sets'] = Variable(totalSets.value); + } + if (totalReps.present) { + map['total_reps'] = Variable(totalReps.value); + } + if (restBeforeSets.present) { + map['rest_before_sets'] = Variable(restBeforeSets.value); + } + if (restBetweenSets.present) { + map['rest_between_sets'] = Variable(restBetweenSets.value); + } + if (restBetweenReps.present) { + map['rest_between_reps'] = Variable(restBetweenReps.value); + } + if (restAfterSets.present) { + map['rest_after_sets'] = Variable(restAfterSets.value); + } + if (repType.present) { + map['rep_type'] = Variable(repType.value); + } + if (repLength.present) { + map['rep_length'] = Variable(repLength.value); + } + if (repWeights.present) { + map['rep_weights'] = Variable(repWeights.value); + } + if (setWeights.present) { + map['set_weights'] = Variable(setWeights.value); + } + if (isAlternating.present) { + map['is_alternating'] = Variable(isAlternating.value); + } + if (tempo.present) { + map['tempo'] = Variable(tempo.value); + } + if (status.present) { + map['status'] = Variable(status.value); + } + if (state.present) { + map['state'] = Variable(state.value); + } + if (set.present) { + map['set'] = Variable(set.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ActivityActions extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ActivityActions(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn activityId = GeneratedColumn( + 'activity_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES activities (id) ON DELETE CASCADE')); + late final GeneratedColumn actionId = GeneratedColumn( + 'action_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES actions (id) ON DELETE CASCADE')); + late final GeneratedColumn position = GeneratedColumn( + 'position', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List get $columns => + [id, activityId, actionId, position, createdAt]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'activity_actions'; + @override + Set get $primaryKey => {id}; + @override + ActivityActionsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ActivityActionsData( + 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'])!, + position: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}position'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + ActivityActions createAlias(String alias) { + return ActivityActions(attachedDatabase, alias); + } +} + +class ActivityActionsData extends DataClass + implements Insertable { + final int id; + final int activityId; + final int actionId; + final int position; + final DateTime createdAt; + const ActivityActionsData( + {required this.id, + required this.activityId, + required this.actionId, + required this.position, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['activity_id'] = Variable(activityId); + map['action_id'] = Variable(actionId); + map['position'] = Variable(position); + map['created_at'] = Variable(createdAt); + return map; + } + + ActivityActionsCompanion toCompanion(bool nullToAbsent) { + return ActivityActionsCompanion( + id: Value(id), + activityId: Value(activityId), + actionId: Value(actionId), + position: Value(position), + createdAt: Value(createdAt), + ); + } + + factory ActivityActionsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ActivityActionsData( + id: serializer.fromJson(json['id']), + activityId: serializer.fromJson(json['activityId']), + actionId: serializer.fromJson(json['actionId']), + position: serializer.fromJson(json['position']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'activityId': serializer.toJson(activityId), + 'actionId': serializer.toJson(actionId), + 'position': serializer.toJson(position), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ActivityActionsData copyWith( + {int? id, + int? activityId, + int? actionId, + int? position, + DateTime? createdAt}) => + ActivityActionsData( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) { + return ActivityActionsData( + 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, + position: data.position.present ? data.position.value : this.position, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + + @override + String toString() { + return (StringBuffer('ActivityActionsData(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(id, activityId, actionId, position, createdAt); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is ActivityActionsData && + other.id == this.id && + other.activityId == this.activityId && + other.actionId == this.actionId && + other.position == this.position && + other.createdAt == this.createdAt); +} + +class ActivityActionsCompanion extends UpdateCompanion { + final Value id; + final Value activityId; + final Value actionId; + final Value position; + final Value createdAt; + const ActivityActionsCompanion({ + this.id = const Value.absent(), + this.activityId = const Value.absent(), + this.actionId = 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 position, + this.createdAt = const Value.absent(), + }) : activityId = Value(activityId), + actionId = Value(actionId), + position = Value(position); + static Insertable custom({ + Expression? id, + Expression? activityId, + Expression? actionId, + Expression? position, + Expression? createdAt, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (activityId != null) 'activity_id': activityId, + if (actionId != null) 'action_id': actionId, + if (position != null) 'position': position, + if (createdAt != null) 'created_at': createdAt, + }); + } + + ActivityActionsCompanion copyWith( + {Value? id, + Value? activityId, + Value? actionId, + Value? position, + Value? createdAt}) { + return ActivityActionsCompanion( + id: id ?? this.id, + activityId: activityId ?? this.activityId, + actionId: actionId ?? this.actionId, + position: position ?? this.position, + createdAt: createdAt ?? this.createdAt, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (activityId.present) { + map['activity_id'] = Variable(activityId.value); + } + if (actionId.present) { + map['action_id'] = Variable(actionId.value); + } + if (position.present) { + map['position'] = Variable(position.value); + } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ActivityActionsCompanion(') + ..write('id: $id, ') + ..write('activityId: $activityId, ') + ..write('actionId: $actionId, ') + ..write('position: $position, ') + ..write('createdAt: $createdAt') + ..write(')')) + .toString(); + } +} + +class MediaItems extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + MediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64), + type: DriftSqlType.string, + requiredDuringInsert: true); + late final GeneratedColumn description = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn reference = GeneratedColumn( + 'reference', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn type = GeneratedColumn( + 'type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + MediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return MediaItemsData( + 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: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}type'])!, + createdAt: attachedDatabase.typeMapping + .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, + ); + } + + @override + MediaItems createAlias(String alias) { + return MediaItems(attachedDatabase, alias); + } +} + +class MediaItemsData extends DataClass implements Insertable { + final int id; + final String title; + final String description; + final String reference; + final String type; + final DateTime createdAt; + const MediaItemsData( + {required this.id, + required this.title, + required this.description, + required this.reference, + required this.type, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(description); + map['reference'] = Variable(reference); + map['type'] = Variable(type); + map['created_at'] = Variable(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 MediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return MediaItemsData( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + reference: serializer.fromJson(json['reference']), + type: serializer.fromJson(json['type']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'reference': serializer.toJson(reference), + 'type': serializer.toJson(type), + 'createdAt': serializer.toJson(createdAt), + }; + } + + MediaItemsData copyWith( + {int? id, + String? title, + String? description, + String? reference, + String? type, + DateTime? createdAt}) => + MediaItemsData( + id: id ?? this.id, + title: title ?? this.title, + description: description ?? this.description, + reference: reference ?? this.reference, + type: type ?? this.type, + createdAt: createdAt ?? this.createdAt, + ); + MediaItemsData copyWithCompanion(MediaItemsCompanion data) { + return MediaItemsData( + 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('MediaItemsData(') + ..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 MediaItemsData && + 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 { + final Value id; + final Value title; + final Value description; + final Value reference; + final Value type; + final Value 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 String type, + this.createdAt = const Value.absent(), + }) : title = Value(title), + description = Value(description), + reference = Value(reference), + type = Value(type); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? description, + Expression? reference, + Expression? type, + Expression? 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? id, + Value? title, + Value? description, + Value? reference, + Value? type, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (description.present) { + map['body'] = Variable(description.value); + } + if (reference.present) { + map['reference'] = Variable(reference.value); + } + if (type.present) { + map['type'] = Variable(type.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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 ObjectMediaItems extends Table + with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + ObjectMediaItems(this.attachedDatabase, [this._alias]); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + late final GeneratedColumn objectId = GeneratedColumn( + 'object_id', aliasedName, false, + type: DriftSqlType.int, requiredDuringInsert: true); + late final GeneratedColumn objectType = GeneratedColumn( + 'object_type', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + late final GeneratedColumn mediaId = GeneratedColumn( + 'media_id', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES media_items (id) ON DELETE CASCADE')); + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', aliasedName, false, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + defaultValue: Variable(DateTime.now())); + @override + List 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 + Set get $primaryKey => {id}; + @override + ObjectMediaItemsData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return ObjectMediaItemsData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + objectId: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}object_id'])!, + objectType: 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 + ObjectMediaItems createAlias(String alias) { + return ObjectMediaItems(attachedDatabase, alias); + } +} + +class ObjectMediaItemsData extends DataClass + implements Insertable { + final int id; + final int objectId; + final String objectType; + final int mediaId; + final DateTime createdAt; + const ObjectMediaItemsData( + {required this.id, + required this.objectId, + required this.objectType, + required this.mediaId, + required this.createdAt}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['object_id'] = Variable(objectId); + map['object_type'] = Variable(objectType); + map['media_id'] = Variable(mediaId); + map['created_at'] = Variable(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 ObjectMediaItemsData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return ObjectMediaItemsData( + id: serializer.fromJson(json['id']), + objectId: serializer.fromJson(json['objectId']), + objectType: serializer.fromJson(json['objectType']), + mediaId: serializer.fromJson(json['mediaId']), + createdAt: serializer.fromJson(json['createdAt']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'objectId': serializer.toJson(objectId), + 'objectType': serializer.toJson(objectType), + 'mediaId': serializer.toJson(mediaId), + 'createdAt': serializer.toJson(createdAt), + }; + } + + ObjectMediaItemsData copyWith( + {int? id, + int? objectId, + String? objectType, + int? mediaId, + DateTime? createdAt}) => + ObjectMediaItemsData( + id: id ?? this.id, + objectId: objectId ?? this.objectId, + objectType: objectType ?? this.objectType, + mediaId: mediaId ?? this.mediaId, + createdAt: createdAt ?? this.createdAt, + ); + ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) { + return ObjectMediaItemsData( + 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('ObjectMediaItemsData(') + ..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 ObjectMediaItemsData && + other.id == this.id && + other.objectId == this.objectId && + other.objectType == this.objectType && + other.mediaId == this.mediaId && + other.createdAt == this.createdAt); +} + +class ObjectMediaItemsCompanion extends UpdateCompanion { + final Value id; + final Value objectId; + final Value objectType; + final Value mediaId; + final Value 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 String objectType, + required int mediaId, + this.createdAt = const Value.absent(), + }) : objectId = Value(objectId), + objectType = Value(objectType), + mediaId = Value(mediaId); + static Insertable custom({ + Expression? id, + Expression? objectId, + Expression? objectType, + Expression? mediaId, + Expression? 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? id, + Value? objectId, + Value? objectType, + Value? mediaId, + Value? 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 toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (objectId.present) { + map['object_id'] = Variable(objectId.value); + } + if (objectType.present) { + map['object_type'] = Variable(objectType.value); + } + if (mediaId.present) { + map['media_id'] = Variable(mediaId.value); + } + if (createdAt.present) { + map['created_at'] = Variable(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(); + } +} + +class DatabaseAtV33 extends GeneratedDatabase { + DatabaseAtV33(QueryExecutor e) : super(e); + late final Sessions sessions = Sessions(this); + late final Activities activities = Activities(this); + late final SessionActivities sessionActivities = SessionActivities(this); + late final Actions actions = Actions(this); + late final ActivityActions activityActions = ActivityActions(this); + late final MediaItems mediaItems = MediaItems(this); + late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + sessions, + activities, + sessionActivities, + actions, + activityActions, + mediaItems, + objectMediaItems + ]; + @override + int get schemaVersion => 33; +} -- 2.47.2 From 23663f484b6ba8113fd392c0b8c1836af1f5c9f8 Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Mon, 10 Feb 2025 17:08:13 -0500 Subject: [PATCH 5/5] added sound during countdown, and upgraded minsdkversion --- assets/audio/count_finish.mp3 | Bin 0 -> 366546 bytes assets/audio/count_tone.wav | Bin 0 -> 1445828 bytes lib/daos/actions_dao.dart | 31 +- lib/daos/activity_actions_dao.dart | 1 + lib/daos/activity_actions_dao.g.dart | 1 + lib/database/database.dart | 6 +- lib/database/database.g.dart | 230 +- lib/database/database.steps.dart | 339 ++ .../sendtrain/drift_schema_v34.json | 1 + .../sendtrain/drift_schema_v35.json | 1 + lib/database/seed.dart | 92 +- lib/helpers/widget_helpers.dart | 18 + lib/main.dart | 11 +- lib/models/action_model.dart | 27 +- lib/providers/action_timer.dart | 108 +- .../activities/activity_action_editor.dart | 298 +- .../activities/activity_action_view.dart | 57 +- lib/widgets/activities/activity_card.dart | 2 +- lib/widgets/activities/activity_view.dart | 40 +- .../generic/elements/form_drop_down.dart | 32 + .../generic/elements/form_text_input.dart | 30 +- lib/widgets/media/media_card.dart | 3 - pubspec.yaml | 2 + test/drift/sendtrain/generated/schema.dart | 10 +- .../drift/sendtrain/generated/schema_v34.dart | 2733 +++++++++++++++++ .../drift/sendtrain/generated/schema_v35.dart | 2733 +++++++++++++++++ 26 files changed, 6661 insertions(+), 145 deletions(-) create mode 100644 assets/audio/count_finish.mp3 create mode 100644 assets/audio/count_tone.wav create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v34.json create mode 100644 lib/database/drift_schemas/sendtrain/drift_schema_v35.json create mode 100644 lib/widgets/generic/elements/form_drop_down.dart create mode 100644 test/drift/sendtrain/generated/schema_v34.dart create mode 100644 test/drift/sendtrain/generated/schema_v35.dart diff --git a/assets/audio/count_finish.mp3 b/assets/audio/count_finish.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c2c5b591f3ed3af8cb4fa19dd9c188f7689fea9f GIT binary patch literal 366546 zcmeF2^;cBi7xyP%r~!r)5T&JI=$4_BR6x4ByFrv0x&@?B=}tjfQo5uDqy#~b5>!M4 zg!>Gi@ADTtKRTK0C% ze%5}@o*sJIDnd9bIqp`s_F&es)wK3^baHd{&{NP<#2LwO_Y+Tl4?AWR2M2pwKVLni z$B%F}818=T=Vb4L`~Cmd|BC{^rPly%NyOP8^lE7EI;UMkBO0^}wLu;H{2^_R8h!c0 zC`clrcSorCyufGk{%mG!We}+Z01`pt z39sUktr3p_;8!6=s;v#KzSSEN1^_^;tTEmugeb+Q?JEg$g`VK(i9F7VyMBdc^W07W z`%n;hRbViM%-rM0hOg>;Wboka>n4B*W6BZjL61E!p7_bzq@%7v! zq$E3fVxd`hO2Bx#?lOM1Bof=TTzh|w7)C`MFWEL&)>uHBXI)ZGlldc9UiA*=ynUuv zc{%;g8qu?y*U2i+`H7{0OP>K6=!+RSc79pce!}t+g))}l-~1@^P#b>Mg_g`|XT*@E zttx3%AgQlx`ovFs^FS*nd+R1fO`7_JPA}I)qBet3ZU**5y z@};PLLSkQLfa*wcJvI!;@^;3i$J};UrITsiPCMFMaM=tfX}<1!^XFauTBl>3{9JWs zFwn(z#Ts;7#$gn#Eyb4Y(ZF2?aC?j#|5ed*6kNItnS4mq^_=Wm^ws1V4Ah!C#5jp= zhx4O3E<#JBPuva&3&b=wy-6h^2L~-`EyLe`I^RlE@ySCj{kW#tU2cz}O&f0U)?9yD znLUxLNKvL!?rSeobN+g)EawI}PH2k0JUid}>V9x}iAotuP`;kj;Dnw{+R=i)P0qTF zIn`|QGu@}-socmE4h$#17iqB?4LN$zjNOX7C%!f#+jppD;vM1BZ196u!Kgw|AA;wj z21ACxPVaLLSghj77jAIq0~oZAN0LX&=;6lx*~ZuqN?h( zX!U*-rNJa)%cyET6|Xs9X_0T{8b*0Eb8<`Mr~cXFu(gQu*g4<3R3^6lJhEX&?)lqhwRXALDf>f61mYlGMKz}__+#A=EW(X2e5A?&f0fW${a~X*XS3bIW+7~Z@mvRd%WNG8N+#A)~Eci5ui3B3|gou=69U`;IwFFy$FR@1DM#xK~B`F}^M!^Y`+d z+sty(w-xlO3deuOOMHj_Q(`8~P#80RMW37QU7*Fc-xHhEo)m8xJTUoak4b9i#AWj# z@9XrV4>?mMhQd6v$uBJr&fg7J2Td(uGK?k```6Bwm(CQ;>5JEoepQ z^4=}9PkOYR?=$aJSfv_55T%bt0pF7r?~4bKAcEt2B@^hM-v2&4A2tH^@DT_*nQq<<81WFj=pI$7&+uZM)}vC*2+n+VYgY zbKMCGF2OEMzVc<$A+^^FVL2?nE&R+eS7mx`^-@N6?2l(7Q{xOn2QTBnX;a;I^J!s| zH>RrYM=j*Onb$F<9(D`V7IpGhjz`I!FV48|AbE(dju2-&_QoaaYIExx*X81EXd3D3 zpfwTG&kc{>wKPuDd0Qp^nYWodA%9LHO6M)~dWZUFcjU}hYMu<@-QBW6EjH>lzx}4M z$R(QQKkX;=YMG<{yq!lbwJxW#RVN5M8ZNB>hxCQYsE;iZChkP0vs|HDnM08s3CTmm zB*N9p%kt&gGnH`aJ|ouej~o!>;5|DAk~ozpEzvttgMlgI%U6rz?sd%;CSGau`=;eV zMFQ-SJBsv6yN8v=2{(eC9S63~AHPfYfgHpe} zv2p|d&M~y~n|*?XbdkY51s<5Pvqltc2e(nuh&~M-9%q~eRSeQbNavnCxnOQm-vf0! zIX+39iYRwhoyoT*3oE3h;cs_JH-q>an1|~2SIjK#J4~q2FMC&rMs|=HzD}&1GQ5}e zTCGskro(*3BEhltql2AAiObbDjZSGDRV*9c=7)zmUAI4`o;@25d*7enTmMHW?6btn z!NZH?IRqgwezIF58JNbR`O(KbqYu|LN*iu&0>2!LNhsqY1|q!OQhjxom}^}4i=zf- z90D0Sqln|-$f{Stx??92`ucXZ)x0vb(N%0+*j6EDlNlZUKwl~kL-R(dC5tRy{u+il zU}@fZvNm}NC^0@Q>U4WYmIR3xKoo9XTcrrPfdIeqbT|y3pF;uVa~OklFFai7H`M>St7nP zU==1#C7zq!*3;A3#R|dgR5D&x2L=Y8rc#+uaGmNm|2vGYO45>921B>LHmlLKB`Hee z8&Mm>=zi1t`D_mBRlyrZ@I@H#z*O(bb8Myb_iQGa=10sBwDWfo$4Z+psnx@5pYOoA z;&^_uJNZ5N_}X{Da*D5udm-+tOairL;=_*Ynh+_s44PY&fvNfO_Rb+Krc;Cd@>xp^ zQ|jvvZT4HGlnROl7gq7zr-0)W3O$bJ3-`v4uR2RcBi0rJ@AzJIRFO>HEm4MlK;ON0 zJ;so*M?Ss`s*%!rxF?@dZlZ&{K`trcV}=Yn9EaR>`B#NZnqcu(WdkWO?msPGwvY}f z-ln>)@?E7#;v0&kiFVdXl~YC~v6H5SZV8UhL@0GL^dc4SaNJjKrm`1&XqTFirsB7x zJ9hSdhmyd{?mZFRFNP@9j03O6aKc;q#k0NEMbTvSE(O*FIh;{jBIr-QmbGcTUXq_e z6_k?tum8=C{6r~7G}}*({*KU}ywizvhV1+*xVfZfVO&sbPE|`QeR$FnxyE zX>oQbTSfR=Vtp}&lJD(_rf*w=HRmen9sH+O{wRG`){W`4K6Gd4l`D~5o_O~RHp>-D zZJe;GGT8d|DK1bPCVxGN#p~ixNE@JK>s@>0CqkX5o z_E*>O(opln@QJ(tyFUvdU$jPXDy}5)8YqlNA(CS!m96e4F8>;Z%MUVeR~8ET4D~_V zc74~0kS4yWUsUG1t$_=b0bR2@#Z_!6_)Kr~`&B-R?sUAIOW=4`A2k%uF=A0eeD}U{ z#jcfW4H8&t2Srij8}eOg5FrscEdwn3qEPLS#_$yz`Zl=@7FCyWFDS_v)qC zyHn$am&#auUz(xT$9^Xwfxcoz)J@+hZez#wX4c7{SjzdEpBgS+46OHSMkv~n+W{tJ{#CL(tP1q_|(J@b#7;Oj2a>(j_f^xg4tiqs3i`{cm7Y;La@3B!Z-@6#q6jM*2hY?>kI zW=dbXW7{_Mq;;1+)cW%VckTNU={$MDjg6gfkkUTQVX~7j^s}vQUwf3HB&A;U>&=@a z{_A&k>vpe;&^ioNPevc9ztqiaVM>QpTsV`4EK4bD@UbJCyhC}%|tC4YdS0j^vn-gdMws=F2MzYR~HPPHc@|*o{2Xs zjBe^0n^cl!F)vCK(=0N)fBK-=qPa>Ztcl_13#wSCWS|Var$%4$Db@B}rE?`MH{v=? zRas9}Rp2j)elFp}yLaD7V9NgJfQ@f@nLRhi4MWLK|Cb-WaoP=L(gaBxYc#YAb6W-I zT_^}`WX#;ICnh=St8RC;?3~j}O4>Qu?C4jvbt_ee@2GcFYlM82&xo33i}B5wSae%! zTHy9dSc^+KTz>On*-3lEXdtGdiI9~!i}5GEUqvy|z`gIK{Te1Eqfu;jSXhfhqZS>l z%LvV;IRec`Vajuw+e7YF5PAE^i2ct4bG~+^X-=2QIkvRWaXsbC3oBO}waVMKL+RQ* zE$w4yPs{3aN^*mQb_NYbR$a{7&ZF|)u*mKw3*4REyJLK=;=yKIZ(_hixcaDKl7uq$ z)FiRP8V^tTd0=~9tc+=%fJ}U6YqEz2NkVDGkxSXtd1t(TRbXw`e!Ec`Q5kXwbmSo&W@a=}@mP@WV76*AZ;5*!%v`+IJ$ zMT?)IBqJhnn>X4@;fImc!}lqU-fP^%SrPBow{)Dg-(vS|8fIC)!`xmj%Z&Z_DXk({ ztTp_Yvik1&i4@c6V=W<(n##_Hk6(bp3%`q4NU;`wZ3A5M-`gE12daDJ+yPpNwKX|fN@<6#nNSaa`ny@dC6+5VM_7Wcm~IyWKSIj;k&l0*?BmkIDw zuZieEm#l5?H%lcSc>RJt`W!L22Oa)VR9AE723A&;c*NsFe^~5T1bmdbwbH%#YnU;nC#M+1ggn;orq0Tjg-Bt9O2p;ul#ZwMBEW9Q9q2u3rD*BzmEuQg@+BZ8+|a7yVYoczCrFdVy+o`msE~)%%rZkue`9m-}R2KtUUH3 zWWAyT-uBy03x@-mki8 zS(%@#3c9c|E7u&+6Rxr{4=I9`s+6-KmgPeK#{9A|nc8?2b8bOd9#2we=JAXt5f|?A z#D zL%Qcw9tT;}-p*C+7-rSXgluw?Xl@~_6B+rjlQAS--}lsoqLRqE2eb`;h^c*eZf&@` zC0=s&RR$k!#KOFrSm5Nr$kF1YGGYne(Y`_M8+4XKjv2l&J|-r{4#o+W#UL@&3|PYBS)Qb{e5!C@s@ItXbB?CS<{5BCHxh z7pvP9|IOtNWvfs%>)SEmhb}^wng)+l?0jOBd##38MQeF^;~MY&F5kD5E|a3@i2I~? z$1sDkJ6J@ljNrS33qn1cVVXOIjvWH01nD_1-y-r5;rLBSl=#7cuDN(T9wWU|;r$5V zSbvMi*kr@}``3ZL)pzoI)-8W6T#H%R-Y&IvIcA@7-*9W@SL!=As6UZh;rX&(9si{) zFu6!qqarLaZh3#P#52$MlfCZmnf?)yWU9yWA^y&kGT%&tZkZ1||Gs~K{Cm1o8zvZ) z){Ot{@8*t@)Nem_x**8KW6YO6FQGD%%Fj{bEH}vQLucP=;E*F3d(4YdE~EX82_Bx# zuRH-N?vzvK{Y>?07GzmItIbg2wi>^_oB4{6x6>ohDYn5i=lv6jq}IFs*0G0TnoS)P zV;XN1b8?a&2Z^9L{ligt?-w|Q^cQ&d|<*))T7_}up#QJwEb+j zW_TTqCtfbMZ5+Gutbc_q0khY=p&t|M)kIJ9Kdlj9tljTx2Q(64rpJ7(y<+ZBy~vo> z;XRyY!Ik7(KC_If^wkF!vl_}_cY|#f1pc{iO{%}-e_f2FtY0UQJ~e-yg(XwXt}U-@ zFFUI%(_!5f%xcs4+iq0aJdgi?;Y3gC6fxs{AQyPTFWO3_^;7HEKFr-!BAV`aSfX%9 zX}VBk;LzBJfnMa-csA;2C5q8{!jj*GEj@v1@Bbp_Zq7{FMLLEODZvTXW}M1_Q7yN& zc_42t6S_~jW1!Gfwh%;LX?7#OFmFCZ_CoQ@GaSar+wG6Nl>?W zbuO@!tiGl-d?-9p%u$+khnuNQEkDcLGruEdr>j1pL;Y}No9Ddl=gR?~5i!E8Lq8R# zPi&I?Xj|pzSSUDAWZSQN*;E(33?H2iOMTaNgWR`>8Enpf%1Lp4#RY5d{zGKdigoi) zbgE_xSN6svjkmdCafPtrRB24x%->jcjLY_d)$w+VZr-L9?KVaZYthcWCj?*75tN z%EDdWB?MUhy*q4uHWcc5eP!pqMVEkiGXU1^0_JS5qK;M8nS5A!Vw?|`jC-nwq(VBG z47z^3mU%tC=YI=xL&*GJ~3RVesysi z^6~ugwDsbAO60X`(8Al}*IVKr2b+2l8e|ttD3jz_Y0A+givz9_6etkFjeTFBD5Vx{wc*Hp ze^mITPPSQrpl;*So1X1;N!*sVDbzbURz^b}c+JQ%PZeAxj~ftsS_~)`+1c@|+tz`? zQwX5_{knfE-~H`zc7J{U{&0b23T1a1&q|=K4DN}nm^Oq40HE6Oa=hq0FUWR^>_fmQ zv6oxFx9%zB2A3V&2E6C4-~i!)z(JH>CIrjE^KnxE`#yzEA`L<;;o}hvW`@AXPi1m2 zgkuFa^3~M%$#oItzW1GEz0V+K&?*rDxI*{3Ze>a1%J#l8=6$d5zc*rP-JSK8z$qR2 z2Q!|wy9992$^BTljBQ$obbMF7!jj!J;|>7Ipx%l#HWo<}vBrJP+!Dl`CSRTZ*IisP+X2%_eK=i5u~e;422wqKdrw)lJlULD5hR z1zeBBXJ8QhxP9-5oo>nb$pP%sk^l#eYGKkqs}`6E3n_fWNWCW07)iD%|vA-_TH z6M9-_Pcs^)9H|_43Qjp9f#7>h&pLY6cJFCZOOhn@4&!MX@hNMihE&&ArDZ+Qx}#P` z#TfqKhe!mRFEsvk;j{75vU#mUG#wuVac9u4A+IRSMj1vxj@D)j=;FLtHDCrQPL1Td zPY5p9Xcq%6qEKRpY4w`{8}78ykN+kjx$<>MRX`vl(Vm2FJ3enO^4taKsowH$E&aT&s&T}X2Ohdrw3dSjGjr|R!uZW z8Z+v0N*Tkpxkk?8$Ds~boJH@q)M@~yO^x<_<503x^au>;UNK2k`c>ER>bk{Im@5Kh zM90nmvviDldoT6L{bqefzWx|xnF1&PoUur{~EIRn%_TyP>LP{}4E zpnL(GM8>i5&CcP>|JpOPfpO0CL3|t`azwimyk@3VeMSwfw{JUW1!zHqt%NoTRKc{U z))YMwxBY<1{p0h-!kH%?8)eNlovga>hvahL+%h-?}{%WlkB zzx0{@W!N}j*{u``r6?gJ)bHo^8m!x~VtQ2f@c9U%ZjjqWQ?7kiB3P*H7m?j97{j)s zbQ)lZL~+yI;eS@@0rQ9HxiFhH7%v$(1;v6QGJf6Td1bFs;${Ng`au>3nX@ud6(5V< zt2TM;mny^m~ zLaJe6Vm92tT*;%w)S1Bdi$pc*?15)cB~^M&YS@qw#_I2(U@mj+yL^) zrviWB&;@|7Q~9W1r4|b%c=#lt_+uxB9O|rNU_paDo_$*NGgQS&^iW$0BHJh7alDyp z4EjLGpz6Wc?k&0`afg|ajwB^m9_Q2oa9Xk#k3d#9VageLfN^48_+&P5n(zOLgb9FlZwy zcVA>tn`(K? zW10ohy=XS70=gUI_R(qn2lvZy%IUu^Pruf0rzhNSQpSfZDAG(fbrvoHZu>6~YqMb@AyO-uypulIU5M^3@&7QA$?sJd|OXt797VOlU5By3~`m)0dQ z;%{mJfTDZRgR`+2P@^_FYCRa%C;|dqDsnEYl-EHYLFtK60}%!7cAL%xdBi~^QIXe9 zU6ufFWqHN^$s#UR6Y+>X?Am+wj{A*MEjaf4#~NUSJbJs*vq>)mDc|m0aZ+lz+Kos2 zha6}I`%SjSpmxmaeK|NmzdaKlWUa_WCtw5R-IyMQ9`4HTuLH90aMA4nlcon(PTHzs z*)4%9og%w9KVP(v3$Yw%rjOZ6Hi)+%{Nm~%p%)#WHjENN#PVBAEyW#O`>}Z)=SV&< zzt>6ObwC;k0J_S0GdL6Qknat!fQeTJWhkdl47NQUba|wo@p$@-SMvI2X%72dS#?{& zCYD4DwSbxyHU30FKoG3GCg$Ig#y(w!{_+<>tKn2QIapw#gikwtjPt>~XFtF;oQ!-# zmKX@D`1|Lf1kSi;R}bWt6(F55do@bwm-Ds_%=>Crr}zA`0$(5ex+U3rgWNZ8n*FvU z=R)lmiyUY61-7jhHDo2)7rQzKVdjF=IWBM*@}Hdo!1{F<034rs8qepY(`oZCAgKvp ze7ScxlXM>fXOgn}+z@pHI~pn|_<`hQT*2p-UpZVbJO*&`14yFFf$paf7|6O@d>!|= zVb%L8Gzr!z3G$a$Y8gbCI7hD-8Yk7&!KvHM%mB4@#qK3^eKLtxkg zK1dmtwBsAHXiAWi+o)xwdtG4emFM~8qI^C8wBM!KWBTnT1a}iDsMd0tEWxeo1E}(Q zbJikSkP6prlo`zSDba3@uxYDl&?ORzh*k2WuFAZKuK1cHQI!`4TzBe+T@Xwrld0Xk zClBo1;g`obwLjIgQ0l~_@zc}1TU9lsGU`A zFDJalwt?7hL#?KfuLyhBQs{~CQ5~Dh8X4pTwbCm+=X3lb;f+MZDX~QX$G`=Tj^E}C z;}0bBDw)w8(1Q^hO6^I!``z0!c~CMKiktY^l4${LuE4`JOPm|}ex3f@PSR1TmWk9o zi%Q0pAgWPR@3=6vo_#^~;ne{aW?Kfpe0=*U_>DS7(S z!O9C>xjt$h|8HEt7k+vUNCB5uS0+3eo208~LSzH8SOEr3Xy)u3Or5*Fj}_)E$YnEw z;DbES*|)75pkNzfH|*sFn}L17-ZTde}mi}uDdiYt{G6<&(dDjd#T?> zgrsH`GJ}xx!d}5Qn2FLq%s01xJjQV?colZt42+7?ZogP=6WV4&{(XW}2H6Py^n3pT zIDN%ml$t6{`T*64B%?LPhZeW}dS3lUm}SF?LXs|B@o{10jtv2|L7*!D^!(oC1e)6W za;WFSzF(H~;M_cZEps3SDz%N$#*122fB(GXP>w67ebjtR;MbJ=2^$D)t;tJEZ$!nB z9)2x<`B8r79LT>07=f_S%GEs%kACYMZIis~d&qAAX69Cv_W<+uH>x#NU8vQ9 zVwAWHuKv_u#bkBwR#vX$eiwUcXista*6RkjL+D)Pq%aP-e#LeNOft43dlqTZEv_og zN^J5zckSrQMBpm$e*O6U@cTuf+^3fzt8dqZR&$X9kMDrixYcm$3!ELvy-^);?1M;> z>XATodeK%^!ggPtiOR^o2xo^;KtM=sS=cVO%S&)P$(2MH0G#PAU4_|cs`mX-EWYx* zqI!n2U7s)f3jxJ5-<|MoNDSDC^YnS$!Ljt+;NOq_H;jR^h(7Jm5ijPnUqW6lk&-a8 zAIfX$f335^NUwW3u5g9+!C;SRu8s(09Mzo<{iBk?Mf)0tz~_|TE^ZdIDXgK;d$GMk zFSXlz=p4eyR^*fV?}9+nv~(}ru0+C#m~hj7U$ke^?fG3!7|+f>Ke?>f!@cDaa|?f)rfBIN*1#^^v|9K1pX2>~zxeHN^XH#MfQypr2cV)d?PzXR zb3-y6YWFwG=L_{RrqX}>H5k!)L1;V_^O#jG{sS6TFSq-YW$*%O1YSjApOy2<`Pt=~ z_2oyiYv0@}^LWQ7nO$M-5W#pi8r8zCrFVVy@B}$rn;PD_*^$@It@MMsz`A6+#A|Ak}ocnwk)XE5lGI zAFIZ1fASdLj^97VWv!#;y5o$JtDTyWi7EEUH&P5{E@P^tXF$lud&3%NJw@0vD7b~3 z+32n^>9kAN-)nsm3b3{67md|Duf;}r&+8WZi`6y#_3KjV1dA>n0Pw#S0;T;niz>sv z$B-o_FxJ&dU>U^vC%#V=0kP4Z5TFnD!7wLHx|BHR z>uR~o+mN`z!2dTrj9LodgzFdQ-R{H1Y9e}5d4Ti%CCh6uCaD!8$2HI3rEx}y7h&fe zInNPhq`U$23{-G@BF%xQ$F8~)*5Gh3jleA;7*C$C$*F5g(^9H17*9z<{>BuItDZksB4S~Hga}XV@&#mmLv1LiiCL`zZt#WD0QuW*tzqJ^kb;bF5MvlRByEsm!A3E^hz~NAq@2aq#Iwa zKg=!X?2p@FM{1VBE)7!c&T8`6?AQ6jMy_CSZE#8_S5CzIPYw15Uw=i*@w=5ZwOdH8 zX@9i>-Nfo1G<6#%94ibvhIbCn(x+h{4xG=`T5Sj zu*<9Kt=E~wQ6Z@k@A~XOi4P&~smUu6H&bjXo8(L`D*Q7uhqVb+nH#j>;XQaL%3!AI z6G)pP1lM^bD!p=u&N9i{U%7gIk+}!_b`|66ti9^Fl&82NrknXdi2rC$0|R;I;B`Eu zvGbIxk}_j?h%Tc!$`Aq4K?kuA5#&UqMl!@eVo{pppr?$Xn`u|phCt`X`^QXIo_y`U z5dr=j?tQl>nDJ4Aq5{3Be^CNL__$iL6wr67z^djZYg5x>SgjZcSBb%KRCY8P{}MH| zHt;0G>N{dS8mt4?SNa{mWu@@=#rhJkyN@tyo+0CgbUtqC9(@y&%k^ua=yg)xr>Su^ zkD?pob|Ypct@&{MoPJH-QZ%67mWM`zdcT6;5~!eFDW=5o$jDwJLd1iQOhMZr8n-Uj zt^-I#|%v_o#g&dN{>?j={)@sS$X3%+$$cx*>5_n;6I$tVZaj8H&B zRycLB-*v1;%vi=KMDHB?1}^O4vIQ_#3S2z2oN;`3*?OuE3U6RUCV8}f@oxP?nqcdp zAVZnmlo9F_%#$KDrre*BI5FKe0POC}eeFkhHC5p)SXZ^S{yPeDyt@{%>!27W`GgTe z*y}|IC4pFxVn|XT@IvSQ4CWh$Ixg}~g=?}!Ax%AkM$Z`G|^|T^yq{#Q_}mQn%x7nD{XxR@iU(W;wL(ESEE4x_0abs zX00vx;J8@TuHMGv>$gEj9H_1ItSKF%OA5NJazT9{)-)}#i`UJ|ua8BB<<7E!6Vl@} z!~HbzMQX-gW<0pKQu=@umnJdFs;x%VSM{wwCs1FhrQ!m^^ztz?=3^2`cH%lJ0AVru z6iTt~-MeyoMKQqT%3-ct*wu@Aj9mUn*j_0Q+&7sB6oiiqp;yeQJmbmaRJr4K`JCHA zM??p3gA@>3!4VDw1=Lp8g3+B;tFolqAmaHqMt8I1uJ`AwqfaN0AAcP&Ra`Dvq}{eg zYeSJOw?&vzCg7mlyvntArgpcR7kwk!nPK-q7|bnJs&py^{MK3%71VAxh=q8~RW;93 z_A|E9qW;e`E^s<7J6@c z-=Fbt;~V94+Op~yntg^qCRU(0I5+~|YfJPJ%3?+C%R1Nk^QifJ`^5pLgTg|yNRjL- z!PJQRq#zWX3JJ(b)fQRt9CtP?ON27e`OL$R_t zxli=HxO>#f94JU?CqJL^T)%E+uTk@DgD^8OIlo5iNEyvm6%YsU^(uGd_FWAw!9e5pYpt~sp$4(kRiwmM8}y%AN%({9Uex( z#emMN#Hb^U$HkoF!0v9z45^ij731|r0cDfi%u|DLV;(0KW(WaqDPFLXnT8wE1DGl~Wm_S^h^U4MQp_qp>?X;c3FZSK%` z5pG1;sUMEjgwF@!uGXZTQrAN%F#ejNLo0^+6x~aMB#Knyy#JBZ|lSY8q!eO zfoH^Ca$Q9382;U_?EyMx>6ItA>b$%Vhxi~3ZR-mxG)x+JV4G@OrS|RDZEYoxHUR-1 zQLGh3HhJ}VE>{}eEestJlu0@rH(&ml_VRrBv)cSS?XvKR7$5t77#o`P7F4ea^gD$a z`IlYmL$1~>jgii$?CTZR-r+XPWOSI<55Xn0(^~r$oo0=j8K7xyeLk-cR+`m+i|S*M zX3Kwz-U>gQ$R zz`QW_YPNYWtsUF@mkh3e{@0f(KT(Ho)Eh+7TYyNasXQ&~%;$e@(0JVyGOa*U6PQim zJ%M1vy@YgOEuhytgh|2(&7$cG-rWMQmG@q8MY1T|!Mr4~*-{V_?>X?!B>mAcb?qSA z_Vl;=Fok>fe6Z!>DV84QLkY?SMZ7cSoo&txZ7EULGEL2%sOB-skfrNawqm#9BZo2c z##^Ug9F`RttahOV%))RG^}e_D0ln^@BPqT0CoU%QV@!5N-I~O!!W$s;v{3kC^i13w z6rY(-K~ca=OT)gB+_E}gmJkEN1EH+^6it99pX}X3Hfp<;q|rL9%Y9 zK$tb*wnWULepzTIZ~|9&R-&%SZHev_>oa^$s@`OB?OIZQJOhK_vq1u^!7U> zKY=X_2}6prKs7J~xG!#%&paq3As$1GANd!@`A_)5Lax8;Kv_}vZ|@-X8{}{&R>E&Qq#?Lnj`6=>9Tm#X z#>UQ>Bk^p6-s3SACubsh`*a6miluDNzfE{-g)D~kS#;KBm_;H3;*#@p=8*QC504tY!JW|CwiD{qa1e zfqB1H-$`*_x2wltII!IX7V5mgQ>EW*zniWcwJzQ79`4LTE9M49 z?`-dkyT1+TK%lpr_gon=1GV12-RaD_rn|2G_Toi&UM*{^Q?Jd2Cy1vC(u;U0s#YOT z%InYDy*C|+(l#z&XTu{4Uh2X65vJIa7j&i0bu2{fujrpWBQU5+l@M~Rd=>Y!Q0Lg? zI-~kh-h|MOp$7g*NvBLh#2sZxx5}`I(l)&!``@{1R!8Orx&DXc916+UAdBbqIzwA< zJ}Ve;greF~!kaGus!#!;4dvctP;mJZ7UTcqj*0oSmQyER3D?&?a#}054Fm$}J%+k8 zofb}k^97l)({)%pc$e|L_WCrkH$oF0Ld`(bvflkpqli{?P72hs-!xAdw)UIpyCHB8 z60%QH;55{wly2=td)L#l)Y|+}VgT!p`(B#=s6`3$Bm*J!gpjWvO1>7i zqt~xLc5O6LCZywo>I@NefE5H;A;8=HPi_&5)I4?U0zNwzg{!iM6OHOF+d~9+QN311-r%~%1}Mlb z;g;@0SMz6DRVBY4N7M05(~-gk2j=rFzvsk3=M&Up%^zQE-tyP`?NM?x8Fs(6d;dyI z(I{#YLUCy1VN=;fQo8)+*`n(Vec*PJui(7!r`rrNWMCrnC!=he@V?lbBF3^<<0vjF zIvS8F7hVe1Rjy@c+ia{$+-&c(D9v$3i9@w;PBGL0+}w+eM9a-b!uiNa!fDlLIWeiCb1qovKTT%csSv<310{* z7!2);lHAKnjQSa&3Qhn+yxU)_hFe++9OW~5_o++R`C*kKMI|_4Znrn+lTffp9&ofG z*tckhwRDTd|McoQuAqZ#8jqOht80DrnQHKJ9a1Jkfae(S{S$U%czIfdcm(Oyekb~L zkylj3F)HQBP(zZGz^Vjolxo?` zW#&*ggF>uI0(w+V`91wLRVG&C4b2v+hz|ghm3>iC&A)HMN8MTSyR~`$Lf!p|rgy{4S*>Fut zO3nTXi9|BAA0B9wa!bDH)BYc`Z?4PP(XMA?I!QsW9U}d-un?YZyqsCAP zWg`bmA$bQOiGv%SC@Uu@xfZTVoi677F$)w2<#Ho<+}Ha3&@Tuib-fkY{bux;4i#ZPbawQ^npuCVLa z&w#+0;OAP~uh!6e1hR_gH7}%>DrxQ##0MnQ%cUU9-#H$#GMpv%8_kEi@-z49sce9rOc^VoiA-gW)*%Pwh^$=FnhBq4iN^SHWU8}_*Z z8H!GU)%KQ>!IOfl{n{JkzC&OBl;VP4jQ8`uDpkQ%Bv29>=!RE!O7T)muT%oqXEMrY zoblx2Nnv%COy*hFS^L7ah+}!Wq;rrJF=*#D`mZge#1}BEkX%S_>6XiM$c1N5ncD+M zZ|?&6-Dy9BMaQYWDC3{w!UJ2sPQj4lh04tw*fO z`XtQ00jl&AaXVcr)QI`D3b8~nx1!^c`KTphdhh zp(LCDv*|6pQ0jpV6lWEvUc6d5wG6|4UlLJzqG7fpX4An-76!PRhQvytKWsfpkP=^S zx_2(HWLE~qSXarGO#fHQL1$HPyBsb*Sk;yE;f@dXmFIrno&1R&;G_Rp8^OvD(KarU z978aaI!-Af%7OglPbZ;RH<`8V^>1SN0uFxpNM@S}(pL~D%7O6H9fn*ep~CGnf+e6? z>)FA4TuM?eQql3a^;kLKS&nm)@SNwazR5v=;W_%LZO?q*b@K5RmShB?!bqj%`axTS zClciy#}Aj|vYwSKxR{AO2zdMp!9a{p5e{O=cE@k;_fn=qft(~sBS18k;%}WwiUMV? zcO=)5mGey%xSTpcpGg>0ho6NhUD^lGNH zz+5z$qGF#n@>RZ%OacLMyqI(8lYv?mz^Ig6pl*#FQK6_qSE09>d&Hl~H+~1dn6RGr zEq9!{{jXvE|D}gCZu$R^|n;me8aDAtmv#TVd3x zWAbNVmXqG32mXcHeVT15gCmd)gy@MMnZ`A^(5W;w&IrrV>2ehoXl%E84EAc*=WIT# zHQ9T~)RF%0efE7Gg#|%_Uz)DhW2B>Ezj+;xi$i*{AP6azm>6|q64RjkZ{@U)Q5Sx$cys*3mFOTFN?Wdpsvl zXU|;Cw4lKT#DH`r`M|((0EH4~$+H`Ey!1Q!-Ero?oy07;*(9f7?y8{GIL*28+hrj_ zqPh`qH!t%`Ydvke1STovZe5tGsn?XNQ`_DnqBHX@PT$iv3@!EId-%YZ^c`0Sv5n8} z{CByVSly3EOZ;|2T)23FJx(~UJ8G^q;RPFygh-%lcvu4=3DPH!AB=qQ803=wYhV87 z`zL|&dH({}KSV448dG+vhk%Ue3>68wIKWvSdf}v`ZN}_$@j0w%Yt{aiOCgEGwx6Jc ztCgLW7=FUB(wVR=NTKAUqY1p^82I22{1g775 z7W0|F%l*pOK8mT62tCrYj1xvU8Q8ap+E^a?XA46}Q%}p4S}GckjIJyKe>UUu?JtL( zw?pt6FF-`)#=Y=wzGHj243LA5!&XH$dv24Dgfw z(&f~w^m#MzcneQ2i7%jGaQs!-=sIaR4P}vzgKn?Au4HZb)!*_d(+6)+%)hMDpwVzH z+-sYgB6#-7pNlj^tKYcX9*jfI$%m*6T!0tPOG;l>ZPKlmc`CnVa3tG&exe_ey`odu zpIv|&iXDJDVE(}gz(^0T^oNq+SqU}q)s^nW4_0bA?vH_}@#B-b)Yzs=LsarAX^R#3 z83ax}4I5juraj^vUozG1gp7CGMKrT0m!%QXVYCvh$qwvjnKid1JNtT3l$rMI_GD(M zw!-vdh6aW*Hey6$cj9=R(LoB?N*HiNyFLRZ${9llyG0Wx^VY>oxcLpkKe6@UK)__D zk*}gRA=xT?gAfMA?X*~%-n(~6E_kgcITOk>?7EwI8{ct~aG^oeYorFxuPev(O;Qa_ z$iFXMVk@5|-#%2x5LBmCGi~wwE#kR=n=O&H6tVtbcfA%L9JdV$r%UndPJcJ5D_`(5jdSvxK6F4C_0=@68gj#cYyb)&ywfY>#TL0 zXxQ$uPR-HlRw3XM-hhOoCaX8()ziTWHa{{X<25cnmv>$l#WfH?p1GX;$-mxfUR$fn zleu0Co8Q@aGP)@J@57wu(?E~Q+)O_#BH+GL9A(TR>qv4h(c~=;cV}(oe6?q){@C2O z=Aq0ibP7F^i=dH(8kr^f#2eXwv<9UzGa7#XDqwv3V`l5CAv)JRsifD|8Ffe8=c|Jc zHF?5OQ%G+(2#wF1GxF`0R_dHCytH!dY*A-cAE7a$Z{R-<=uY~JX-yZ{8}6^|hqb)l zbh%odc(K3m@ANPrs^^XfBf zBV$q)9B5>DJ;w6s!*x5j0Aj@m1AVbYZc3UEIC^{XZ;S zcOcaN|G(v|BYTBpZ)att4%z!`!r6NyE0RM9DSJlfjKfhlGb5smGLLLN$)@Zg{7&EB z-}m419?#eF@q9d=kLNp%%z&vG3Z#ij7A|`Hh>Y7J&e?;$tgqJ1W-_kzSl6nqf5hiu zzfkRIhnqgh=EQ)@)WPv*)xQT{>aD=&x;!D66 zDC5nYZG|{w=j!dm2j_4QyvwH*0W?`RDU&Ln}XJlV{5Zv%Q?7RGj95I7hkZr$}vUD zDus$lf=m2nA%jDw-$u3FMU|x7R_nLiPqA(HnJPJP`lJ&T!t`2O8#kG_+qV8>@a&Xm z9`Jj!iy8VtHOXPy0{$Tf`Waf_xVsoub^B00BdRYEe~2+rGlH8(QPeK*{}&-YCZrFu zJ|uz3y&NKaL30H;qT5DA=^x}+h_77XbST8-ui--=3CcK)D_cL2A?m{{By~V!qRsr+ zOnB~0c`7_kY0xS#lZU(xAo^<>0HKIVDr$tj?0v=(0q7DWQOhEZaK!VuVhv90eJBh| zv|>wMZ~2%hZz8jgPpjiiI$PT+Yfc6QvYyT^Y~BB(qFEelX}@)Py2-c%6AGkx!~7t* zxjK=pv16w_egC&!D`49oG5L!&4;T;%e+;UJmfVz4q~`%5ZbH#SiM?W|azU;p^1&rG z;Q0O`pYq^B5xl(Daim6d4n=>o=nf%QXW?|hcZjclv=Ic~gE=W3THu~RR` zP!+D&I8QNVGO@7Z=VzUM3-qk|Jti|(ZX)m5w^pXtmx-|>?8e<6Quj-GjCDDxs9$w= zMy!moVE#caW?bPeKkT@wTSwqu;0RQ(j}hxud}um2l(Yvx%-1g1cfX|pcmR+F&dmJ7 zORj0#p)J3qs?p=J^KAFs+A9IQ=burvvA@B*)PPHNe~?t1)W6^vZ60?FgnL@rnC*5x z>BtM8_wG32Z||(#ima?#dUIpnj_9Wi6k_Cgqrt>wfSECWqg<^>{;I#AH6+nO()N{t z(IL{+-j0uTz;1wEj|>z?QuI_$ppPbA&kMs^2178ggEv(=pNK8I&5eG6HTax6QR(4E z@$8i(mnvOU`XJx|ErRtPI~YIv_TX*itE{cKH+Z##xh3A9rIVV&}mPqW?jUxsM<96vg)M zl_PenSCAX*RwY8N)-1H8PgyOI0RrrzG<5mzNYjzIE%UFy+hOs8KXZGlPmpo}sE54( zAeX;1Acxw*9DD<;@@`o%#WC=GQk~AGg^CCvw_-v{$#hVC-p^z{NO|*ITXAvGW%G1$ z0Er*2b1I)DX?^|Ors_q_ZX*SOk(V6^NB^3-zA}~#a}A)m`1C7TgD(JkPgwZ!ZeNVPnn(7*&~WG=bp7$Ddys;ZbDQ*;HnwV086 zAB16H*l1HCV!+1FBlXiJs~ z3bZ>rCmKM``k(WAM+{x0D{@?QePTH19%Im*rp+B>dxQ_smKizOhO_aGs(Yp&zEC_d zMsLj=;&yq)WXh|i@>M06^Qp5JmiN_*bedE1f-a*B3W*ak1g&Cvq9D^u@t%56)2rxqm+@yNiY$>R%o;_O%EV1wa{- zKO<+7)n;JIx791PG9C3E)mT2)wBN=EV-2={p2F~Dm~%qg>@@$p@ZfSIbZjegpY;d9 zvGls`%u)|aonnE!wiK1y$8NO{;1^C>NyfPvPC~9|<%@{yYThfz5p7Bw|I1aia_0}k z^3ZF6?QsDYQNu}#mVU!sWDYb()R@R_E|GYQ!!8pqK`in?`Qec|HXn#fdp@YLc!@9V{o!q7E)w}Al_7r=Z}77+26s>|B_ z<<%3XosFEt@8a9dZY8EOw#sfqR<*ZNOnx@GrR`lR5#(tWS!>$NIF6%O)H@RhJLhF= zJD!aC^t`WUR1s{(N9sY{x^k`b9^CT6L}$`95wa4Cswv|VV)x;@78yhyz_hh+`~ zMmrt8Wrbz|HB=sCGh?-RCfcMG!!nT}Y@}PZVsc@VCrI~+Ej9B49Nw#m5ZO4Wb;R)c zRBA19{>dY4-+XVBItX$LaYW}VOtw}^xjkNTYsH^o$YTyGEl}`6sfMnf1|1c}b%(_r zWEH2fnD0oY5|cug14DBmAk}XCw(8bdgvU~!G9SfXo^YHDI6q*%8J$kK1mK3lt=?bb zj0X+)FKL!w->o6rgMC_MMSD2Dn3S8;g?XP&^ScDzL1lLO;4eCr#9A-9r{$&+KMyJC zifrmN_duV4WdsvT4Vadx@51&4hwKGiR|s0cSCCteNu5^`6b-BDwkR(pA?B)y>ZzHx zwl5bj21xS^4go$Wj*@!;9Yw8hgI2UXksch3{9C^BdeW=xiwE!P2lAgT5AjsHcf+-x z8^w3Q8BMGRe(sL!wxEhLK~Se`ZWvETN7WPGfR?5|H6eBl+e(C1`|~>ijMQx^ z))yN>0bcS8`NS>aKo72>o{Y}i=&{%Df1g>z8mX=X;XGf^Q#C?5;Q)XWIK>y93y2|c z5|zDACk;Zgi=SyF^zofYgjoF;plJF2qB10MAq?u$EiT%%(gomx4&R7cmM^j#;BmY+ z&5&9$>}9NyIgwwFWL>$A#80&P5pVX`NYsgFF4`a4Z(;63*S)x#tn2HxXu>mjpA7S7a^kW~~;6^Qs--1>#DPEq84g*7ecf00uW=L5dxXomBAeFcRSg*qfc z5T*brHY$36KaEd(M{9EqLeGkg)TIuLh5_UzLFEf&SOvS(M|nzsQIU5vq#> z)iow|&1m9b10ne=#Q#f6$Mf=%FX6|n$8H)^JEI2|-oc`F^cB=CJ>JEzVC$#!*WKd&WKKzwNODW029=3w{fT{yeH&qhGotP`z8AD8V zCup^t=t}VnoDE*O<_)!rrcAdAeITFy7a1E>;|DFqbE-qBc&8QON+fZi25*SGHvAdt^F&eZg= z%G}eC?LpVDi^Pj5yk412q|0K{G$VZ_T&*%ZX43S&ZO;O?p@r^^;;HtBhD?qlO!LA$ zU}3<|Zd)OqcG2=@R;dHdFJE0jjwmmEAmJAyYUt_$m=Cp9p$29F_zJ#v)Btj{AUp?- z-i!IR#}@W9H|iS%3J^Z_c!$;Z-m+^O-VOHefjwCKkwucekw+bx0pNvlz2*3k0hJ<) z{Xoh4Fkx(e-b0GXgvZS5NO3O4!UR{@X{M`RT@`6i*|~LDRGvMz8Jt)Cz+g6=$@g?- zF`&Jl{b_FYV@cDzvimTV+Im?ZE4uub7#(T$(v;3Rc^@?h7ZZwxstnjg=0L&4|ADJo zlwqZdr6SMy1-(S(#6r!Q-6!9R+k=lzICVT^?V?U})gXXAsSFx(0k%4=DIFy-+5!Sc zD$9h-F;KW^wUzx$R^(Dy$Zsdo#7%iU?3G?`WQotTuJzj@ptXoW6;31O=Vp)=7rRWx zgEZX9bdAFHpQ9%Q&pvj*|Cuq@W77JSiS5H+x26E!)hnmXd-%XBW#!Hs?d|TH?4M8! z-PZU1j3c_<%Ife0BsIQybkXFtN0`lVx$N+>u=K9aihsKS_$u&LnY;_eNk*)!H!QbvSJqN ztBDWWC_B$@Gc%D@GPd#BIyL{fq3G&bf(^*IH7Wkg>Y7Vl!{NNG;=~bI)XR4o`%WcX zicfnU2EJ&`EA1&(qksG5Dpyxy(tMowVZV2}l>|yj3JIYe9^51Bl++zPMWG7hG_L%r z@fZYnKCDwVuBpbpth?-fTh(2^?31ym7DUnu1bT^#xYE783U-O^LeMJEBKN9Fn#?@S zln6W8O6k{-u;>))g>@krFY8oS+X8W%*>0_?{gz#C2?%^>Y{uM&A$O*Gn~<9MB&}j*NKKep@)k z<{h$aVK7P|hd8X^(WR}HR90@Cgx#<;)2Iifpe5tif<3~9{xzcuV0125`Cu9EZT1cq zs?=2*8k@#_jqh*6J9(~hbuDI0omd`-jKolY_e0He=&R!Uv6pau2oDU!OmUO-X^}e% zHM%lDSz=|VZ}T9$AbawsLfCmnaNpUgGs|l(P!r{2FgT{GufI!alO5(rP8Y>2u9&sX zJBe#xZTC{`wW!OS$9eggwayT@(yC9ZYJLWVopIbsdDzQqWI33J`RNmxQrFAgFss`9 zz7#~c{aT|N&}3C4z!Pk@JHa`X^|y`VLk9ifwBF#1rv(ce*dexyEl1%xYq5VW3oTHd z0gypbpzB(>xKM|+&u@>rKFJdKeYVllWPokPk%cZgAr;WX0Q9_wQc2v<;Kh|kBodm# zK7Sdh?KgQp6ux+3V>rCxNoX(V$*Ae*Jn=wE-&;d0PbpnSth3Ci4KSKAJXCTKfqlzy zA^-okU)~)EJ9R|4M5{gMqF|N8GbeW zWQAOowNbMF;@38OTR$FnOAi)m3jo5RqWg;;8^gJcPiOKl zNMHY{79_kT6ID<})f`bzr z1}Yu_I$V2R;w$NNcbHPKE$+xZ^vU(fK!(=&&s!RBPg1pOQE_CX46P4TMjFz+XQdw& zWEURXyYw_2;LiIyxMudK^gt=-UZr@}!hrgMSxX5~)HrTY)yF5)N{1Vg>|BRhQywo^lJtl`eiWbcUEU8zBENR-E zTn+o%^jgW@e)iD;_-SgC9-2ar1l{Eh2e9$vk)ffUitAIzHl&Kp1l~{FKG3tM$pxov z)=~auD*`X)b%YBcSo2SmHAPx3GF7!{)V#!Uv)t@Ymz3508S|`0)$bBR*W_`Y~-N5lBt1Q@@ zz`u(Z$G8{kGj3OAhfUjUMVy;?yKo*0<;9XWQ^=5ViOrN2x!h>W8Ic7+SkMeWaSjM+ z-noiYx$9{Bq=hVrN~%>Z{Tf@v&wi#HE@M*0zU%#@mCs`kHZrd<1EtkT%F=syoRSk0_z%(Ct4!!SED zHgYGCp=-lyI($8<-VY(900aQa{ZWvuTJbwvH?JIN*krJ^U8?BeZRea-*lvNZnXo%o zJZaAiYQKJg8+oOz5qB)t6PreFJpR(U7czJ~Q+E%Mgdn!EzNG+iGMW`C$u1D1)Ms+1 z){(#5=39t{;HnU%x>K#EN{GrbAgUXM1Zhw@$hdPd@`F({iDI4{WuJbXU+i_hhWCg@ zif>u*-_Cg@nil;R_E-+wf&qLiLd>dvRM-7ns!bwyc7_X4iYVAo&(-2>L)zRNvDLMa zsw~;g%gZ~zz~>e!6I3JgwinAy&NI0>;(>1!d(V7M`P0zJ`U(@npogBE~Q#}Pur@dq4>b2%7h6*Br-Rn zb7A&tf%aFe)7dZ|qpG`U267K4ejZhVAUET7JM<%jQ6Hz1d#X2YFY7o-9joaKy|$qD z1&3(H0Q~9Ux4{S02uir0e!W#H1>6ES0*8n+zLSXJ4cc;YTn(Ks$0sj@T6HDhFHGMgy;3REQ^4?MvjHE z!dCy7am4Fu2$(Ald>+@;wba!z>O$=i+PY<ts*F?!Jv-Q^TrD`LNl#i|PgT!RED*HA#X)wibha z*34|?HpQLq20bcCEy8t@%6#I3J-kq7@`nv0GL-_f&omd*K&o$qRCs_P z-)%|8fe3Y-BQ;5pS95)j)*Pp#2XjsyUD)h@U=*a;`+RK<44`3Aq3d$bsRW|-nFTF1 zADDhSz|EB7AeqR_n&gR&hJtDWrrdhk`o;WwL3JZx#P-}CSDr+c;iSECKQ&n9H-Vzq z2XqL>b#AJWmeMb^C7f&Fen-^E9*Owd{{8+wQ^$d6>k4u|V=@>Y@=_5QiC8(`Rr}Dh zU*-RWYUNZ40)j&i;lF8(1k_J6hPOl}o2q^GJA(I1cOU%}-Ghr2xe_BLmjcvXLfv+^ zSz1Zgdr)vPqVdH#msdz=x6w1JRFT6}*t)R&^=3q8yLaO;-urRuy9L~WcUz5#9QItt zR@7&E#SBEQS3vlvRiMEtVENK9K<0OP-48XfgBF3j3?1GOpB^8}F1T|)oa=)vd?eL} z`YVjY+*YV9vsxkG;m&u@uU0>-r{vuGiG!oTcm%K*4hLvaS58py_H-*HV)OVggU4o> z+B&YXCO3Tt%zSZBpYb4}+-$pvqoYmdwuyP~I-*)%Ff}&jf#EUlP8?r% zD=kSyJ8`^?FTT#KrW|XKwuRMsV_m?O%gB%4jW??h%P4JJASmYHaa*FV9&DLRd;yun zn`ZQjzBw=mTRdD^*4zM*GLl&oq$6wXcR?(x&%=kNl^>I0YtO^SXCM@b<@<=4SvD1ev@@*_jF zt;w{Zb72zyx?S2h))4E5+gvZIdUs+nJ#pw`@(VwXA{30pFcY#S+2p19~mUT|5uk=_baaGjzbjvkF zWv5<=$9gN==6K8iAN-{Mva->9=1`<1!IsA*+AG}pEa2w{I4&uGAq(L7u{6%Bxpy4Lous1rsTWGqLe{X%+enSUN~QhoEqX zLZC`?Z_+fHLxiI`QfAr>UrkN?NTigvXsJ5>b9yPmYb22ZREcp1X6vECv?}B*(dm7{ zCdZi51}~Ek&+KySxJ#9K)_}%)H>nn%|K;#|6K4kA|}{8f*0)7hs_F*ldaP~~gBVI8i z6xEhZ`8Fu#hPe4zo5|XnoNu=)KiRB&)y!2oT}Tga_-_8v7vue;??M!Q^FOH~*ds=v zT-DWzR=!3n?=tJLQWypBb-bvydGWvY0i5=Ls4fv1i3aiB?Mt)J2VGqi4$a`wdohwO zRNn#q%=&$6g7w0kURl!EtTK;qlY`w(&M>FuIpVTh3XqEi5&?`JMmPYPt!Z#tl2Uf+ zvgI~nyeDQlE*=wKE46W%MPCbSlp)h2xR9-)DtslODx}R46E6x7~ z!>-zz<$H(s*@TaPB}4LzopEqlnfZ-p3Z11v*4uU_VwpOQJJ_)2Fd$b?3e^w`ZS~OS zd(TM$8598R#2=bY;|j}*f4w4~bRJNdw%J<_FN;Jn%hQ11&UDOTYJktSv6u^MO$&K{R3?>O}ac(k1;1rv2SudC%Hv(T`hIvHal0C5ILOhO^} zGa=#vK_2m(!7qPu0bTKU=f`;^e?`WEFTDa5??(I$bo9pLR7;{!#=kkmZc)Y2JzHZ& zier+~Lc;X$6CK10A;`&eDMjHx5oC~f>623N%1*cQpv|(neaMLL%kBz~-S0o&720E$c+0O0MW0Z@6MF*&^C zXocvOeUCH7rp!O~-uI`rUe6y`EhW$>>QRTr0(j}5oW$L3BQ%Oe9#1p2m#BrcuF0Ei zoS8kE$@Gp9-gHH3zqv@id4A%#O*l4TiQVgux7Jk|ZC9JEh+APly4dV9R9>R{^@R$a z)=N%B5v6i{n`xV5!2Rj>_Wvir)$#nWGpwo}acom-7N)V<>8rMD)dQk2C4+s3I6BLC zQyhQ*P@|B5Ij6>;&VfdG2a~*2mM6-eq(NB!e0KC<7je3SPGN^e5w%(}P<85^MnJHIrcDu$#7%!gPidmIpTN0mfyn~^Wm z!M6-&-Zb3eITh0Gb#Ttgj~S-*A4EId5@h!cql$T2LiC5G2Js(BOIRNsVJ-%cw@!Yx zPI;zvv`*t%=P%oK7E)~m>Wh+X0iPl$L$FhX7pD_u6J*>s%2^!Aat3aEydL%{{#?FL zxb`qWO&!whLT5#Pm8Sej4XghD28CfLEttzQUX)>lGdv3f$QHqi#g_+MeiC7s z`eP?2V$-u$KUk)jv|?nnoD6{Q0|!$Sy`GU!{`bv7#voSLZ@c9vEFW2YjNHyDtJ7LM zbFaVanTrn-*^Vyb|77>k4PE(0tuXZX`y^Xg>CSiCB#JT+Mg7NApw?4)SE0WJT-uh`LD%dOm7=cBjc@FDKs}#UkZmNrQ@f?&fZnp4`VLv=e?KbFQte4fp!%!QSxw zp>NJZWXTdqACenJL z94k^3YwwBo8nuhoG-!6YRNd10NYV2AwsosXYm@N0mHNq~5NwrJ^1oaiI)Yi~-7YkF zW0Pgu!v~6c|H?zmsIs!)Rbl-%oF;^Rydgg{eijD*Q$r8AC(Wm#MzQ}r`SXJjR+O#a zcJH0-AMe*i_wh-spV&^zhj+94*YuhV6GvdTlECUy2tfuuI+(4LEu?{Sq3X`iEI~!~ zP9l{-6`{2jgSTF^IX~CMWke6gXWfo%=6S5gQHN1eABQZ^atQ%@S008?DxF(4jjU8syY%mf6d6RYfd;%wUNHdNnPrS!x5 z(O@%S_|!z4H5~%e1h7$pZ_ok`egaUh^t8E&cLW>1mYS*Q2Q3t~9x|K>QBCuWmuy{H zG+9KPXOxa$!t^POoh57&uD$J1!2WI;ZC_!@$SUGYx%Wu?y2YPT{ygmm1h=0(;n%Zu zefzE;N2GEQ|6?SoL|Lwe5bCg@mw4UyKL8~(CIS7MnnfpCrKVXnhaXLYg4Md}UNbgZ zyxjl#0Oxj$&pLaUlb0vh3zE?Skm!-Z)qpS14lb(wT)if)6HWU1E^XNBRcdG9^|l^0 zr7g+yjaxteV~mTr#0NdPIM1j7(ZC$_LS&4i^Yv<0KE9A29}S@s zf_&*T=#6h=2FQCFQ32_JMK(-SYNTUrvgM>`8vSH|c--k^(We}iHNu_8rnwO^}G%i=bQUSkdN+9nH_o#*8OtMT5Lv!6jT z@j*v+m5Z&D-jo3yN$mD;hp*=py-g->tO5`Sc#6kBl}k3FJx zC@>W8{2IXWqae)?bB6b4O9L1=paBF(pqMJi#kK@9or#pbyeAi{b3b6fPqZGZU+uo; zfIvh`-Y5AETB4Fjrv)tYdV4LpNtzk7TUorpzEtqCny6%TmNW<(`qtBKQjgo-JWq9O za=vSJ(oW!LY0W0K?zV?P$$WD^-ucalwj~!1$qYH9Pv%>hZ+ZTm zkk+@W{j0?*q_uK^UJ?5r@+w=K2cgxg1Uk0P73ovCs2-x(YV6$4<8gC3+-E zFK7A%5F3IwS)c-l!p|gNRpo!4eIL$&N({YurqXDbj@xmBdnKXr=bNc%dwW}o_ASSy z!^{2n#gWYb?>_JMe+r+9M%R5|v*O~ID0rM!kf4;gf%TF4^Ztl7KZCfzf3>?be*TbO zlsNFx5%{N}k3u_2q2vkC-L!G>DkmRvqq^wnUuE~-$;*DoN^DwxwPz_0lpXvu$m2Jl z{|;w?QJJBXa?uE5N*cPoO6{6{sg03EoBFb;?RNKKl_S%w#-Dh6x$b(c?TSN?0GOnV$t~0kI14CZ z^~IWW!Hda)&+E>vo>lCb#TPp_%OcVm!s?1sGS~gEqe}Z3T?&b}<9viSI47|@b{=m` z*J|*J`k$GdcbMRt9293n|n}BbRU}WbvMg*J6UH%R%nD3ak@DB$$$$AE-b2@~WkMYtQ-%HTYk+cS+u&_i~ zLOGlOS`ep%w0$8tmyS*K>c-Kjwo%+T(w#poQ-zPWREW{H^v;&sys7PZSk;!GoNp}U zoC>~V$Y%QD!#W$E)fsN4E@z_f3Ub>q>FQRzutVZOLjg>0 zja6uN-Bhv+1nuBd(Jg{lMohqE?DqRxW-TLXCqpjTT378CzFY6Q{KtQv{}Y$~5*Gl< zK?j@%cNNo^CeW{AlGeq>!z!e4*=9PTa6IvJ-uRQaM5!kTl+-)J-%2W~6m0A|s!*hDz4}0CMS`Kk7z=@48V!yZ zbsIe&9C7c8^zVJ>O+z8Db?3!L-2Lu$ZS1+9&ATe=NeiW_{(K>dq@~-pNQF|+MLC)n zmI5htUOFGP(V5msoCi+dEpUS?Uo6+F48t~QKCDeRe)7fQT(ng_v&G`ACh@>7gY?7l zLjC6x1_n&n!(uo!?+`OWnoONx|9SQwSSJQ55X59$nG{=6NavvN-$FPI_46qia3U@>LUW9ahl zhM|%*RUUs}0D{qcck-=*B)rCv^I6MY*YkgzJH>B_7a)^(jgTl&D8Q(TY7j^psQe$d zxvZ31kQh{_VKQ&(G^HcD(xl|4@6b>pY{O#OOWn}+?(F51tW?-@3CS63sid`Kt9R=s zn<*B?ioYKRfCv$Z*!88mHENUlO>zru?aFqYMfK-4)Yy$>W2ud4+Tp+MrU6B?KvSED0Jd~%Lt$cp|s(J02A=IkBkt^ z3HbJ!y5{`f?77-l@ro*YY-Y`})27q!#i6c=d0;kU5z(oi7S9zJiWcSJyjGMZBvzoK z&fjhmHrd}X7&uyTI%Xq|nbvuN^F9)e-aIm^HtH1CAIl15R`$Y8p@qf9BL9ZRJvKz0Sw$>8x%B|D2baQIlVmw=ad?YyX(X+~H$BuZD-sUqQ5QI8; z0qoyoG9q%zN7Np@%40CZdacPr-3vKLo8YMg0OovXCK+OTwmn+G0wY6{uorw|lSbNP zUi0*$b`k6@|Mv4B_efTXUqc8OX9^>7xBpni(RR2J=j=023&eicB;J-DRxB z?{y71IuP*5BHSiN7azCjP@w;F^xoe7QcDjv&?x8nO*X1(snY*;uzX?p*kD`xkT?2i z)=c`cyk!f8(ObxA)=GEoax(}kTNN_1UB`Mv!tQwP1ae(PJTB zCmV`y%T;E3laCJe6Kz&--^~1*p)7sTQ8YkABk>CcC0Z}iYG$mycxHOJaX!Y0Z@iIG z&Zr)<@?AW{S?)qJR&Aur@l`m{mfq|qmBWTDCy%xXWkV^AF!(hG`ezbIGA}W!68RTH zKm~#F6zja?xqp`PEpR%y(m%)%UpW$@F6V#q@F`pm4(9G-a*i*hm1W z?R~!e&|=qNF#Dv|*o@b*LEImn%0ew;1O@}{VWj!~OGr~lmvui)o3b&-1-pb}`NuVm z@LuNAYm=8#M`jUTw_1ux%JM^jgv#H2^~JkxO^tXcslwn>Zjv}PZA_-8c&oXImOm36 zFhR*Md=UIN&fvm?X@r4NgQEz+XaHtL&2s@UrRZ0=Sleyi`Be^FD?!4t%5T%UzK&hy zbMY;ysMIb1J5+_Z()t3$1(DOyL|XMUm=xn6A-F{(ZUQfsfe+C)ovLqbwe|}airn$y zpB1AET<04Q8w`}=vLp4k z0wv5QVj^y|8+vqiKUCJ;HPLQ|2($_^h}DcY)N&2cT4CPMd;Mu& zS#d&u&&L=bb3cxTg29|@fWH2vcBc&6Tk67I$n{$FEKFE#LEhH9_Xbv1ox@hgbD>mPf2J0T zKjnzfV!A&OH4~n(_u*?J-uzlx@1fUS)oM&MBHb_rhTRc)eoJN|#>ID=pBgjg>8gH} zt3#fMk{b5ybm02Eqg0$fz#z|wwvCZPMg$@wR#b;02|3kQ`gLOQ zw?v)#A9}J%Cs4U+^5R= zYZA>5#|%o9YA=Icu>?^UD=L2Rd6#!MK8`d80cfB938+WAB|>sMdE>~3lcFnYuh*T~ zKOHQ_ep+zkZ-631S+2Q)x)>bzg^EO#n8+Q97?Fm&hb5XJ7q}#r#T^dsou9vY?&_sz zLq2uIcJ-0KZ`-g#A>GPcz2i=1>+?*`xnWu5^%IR2L6|LrhGS$#r;Tldh*8k|JmE=A zwzD4OjZg6|mlAp?P1ZWkDyx36Z z?mfP`_Hu2I0x{Q>^t{MQ9)Skmeh2F5S7S&u8#Bi+6zGiTbPW2&Sn0jF#}F-s^~Kye zbr1I>%${@5_p`kF@ETDD3#QGyli4qV2PKy}SAdum`k@XzOtvkum~I!`S4f6rbCU=6 z(T@~Ja3Oo(bP0Hf5)JEtlieeea%#Ns!T-9By2(pz*NOwopu}M40p+WO8{yZ#u8-qnxAQCUINh=H#&F@vtU+WR{-?{l`_$;q&B@9wk1^Eu zdF5uSggL|p*jOs#Vs_?ypUDD52WRqDrFE0;%V8JNozG+lbFz7<{8MN|BcK5br{>(r|ATD=Qa-vPCNx7XGuG6aBxLL_w1nIV<9ZCXvfw z17EPXxT8?+Pi4q*Lfu~LsmH{Sgurw+qzXKO!eF^6A+0uidaLC9jX)zmU_D<6m-WP)YYgL$P8g6yJcL@|!ZnGU%a z=4Iv~LzlP^We3IPz3Pr} z!9_46N`BS7_U<|z2m;H`0u>?%v+x{AE!HolDWZ4HS(CM_ClY=q3~-U-nc#vN&?r{{ zu1}vCpx1zcn0|+fp$^;`t7Tz()m+};zI zNpCI02V?Q}1lM*#2+{(d8g{ZZQ|npVc~WFV+Hu%oK9PNB*LybJrkXETjsDy-X0oqT zZLuSksvm+Ed_ome60-gy^q!}&^l#wRE4TfRkz8r$*5%Go#QKn&2;hQHpg&}xKAS@m z&=fMXkS^E+m&f$uJg3{T(tg5Lr)O;)=g`m#)5qH@w+3KL2e^6q*VASx&U=Lc)qXH1^bDdu>az11OCl zy>kLb`Glz1X>sF5_tI4$f<}hU^(IOWg{X{kQf);!lc*ShU18_nGR|8x$}tS7a6te-xXhtuqS3R=%%j%tQ3%X;bAEfje!A5)c3+S^hh+^ARt@%6&rsLxt8(V> zu@UoH$14_8ZHyg_?3f6V;wx+VOQu?7B`!zJ-&D(9R_6Q?T)>YRR2$n6J`q5aoOjvp z0JQ5|;(fgdt#`#gjwf9ka2}QS<%s#5xq_dM#r+} zRx6VaH*I+8h}chVKDisNJk!0LsKuHN&SLHYXd`@XhPp)iKt{raqZtKkt%a?pcW`VJ zCgS)yLXbe({V)g}o@ieRLHs+^h$fJB}jQ!3|*!uRl>GNN6!EZqCjn@?>2>Za*gDi1_8?)2aa}A|-ik99jzWr-HMS(gV0a@N9~Qu5U45 zlAI9=VYypRINr>Ye%obT?7lejq9p8oAIBsHZ-X)bp&lgZI zR_-2IXnP)-Z{SYmz45Y&wv{=Rn-SLAC-c`@2Rw33oXyu1OYd4|=8q~SYZbLsp!`pX z+c=y)=!jHhs;<3H8@tPaF#fgl3q%|AISTEw$HaXza z6x>mJJ~3H2SZa>P-PPB;_oaEDv*Nt9Be}Gpt=iHmD%wyEB6IC3Y_{F`I6#7?k)b^&K_#(y8u^enG=88Y*S2O#BtfVS1RH$h}n z@kzHx2IwlhgB%K6Rrf!5=#t7e6@B2bYVdaD6IcFRWT`o91 znEcg;gGR;?Z|S*ewQBdjm6Q^t@+~D!eG9Zw1K%f_7GzW@U2N91)s3oTZP^%M)2uxw z8;qLt?=0GqNS$VyC-V7^^gVE)SWjxX`0=ybE69Ke7ariH{cvm4N^GnpL5ro*m}drA@RgnHi3_5VlHSNJvkzF&`SL>dI7 zJ4T11bmw5ikS^IMX+e|_q@`0*HXLIhF=7Z#1eDGVK|()@(x{Yz=Q=LZhoMkl!Vl~a9z2t-gqDupwPlafmMY{v*k z^UfyP%y&aO1a3|m#oEuh&m+ZgVr_+8ZSlP4u@(C(#`?T7Vn4eb-?En{+% zKFJJua(WCT+M8p4xL9OdV>0_vr*bI&P?!%bc>y`V`tVBqUt7*f!Y46@7!&Qa8>x`R z&7PG*H|~eE-c!kvq%!Ylz18rQX>M+5DsD>4>i#!O<<028@t5scALu9(Yi2ya^g#9< zpn~A?bw)&OyPUp^2-pt_ELh#iZgHz$b4Mf2cehGgKl;`lEm-cU?%*Udq|_HRd;Um~ zlg|tmm+91lT#>xy!{x7pZK=2EF%%vrZ!4ba)o1q672AVq6GFjSWCwH!M{2wj1Qv&E z(2slVe!X0~8L;1^u59_<<*?o6FjTZ8++Zc?ECuvrkWZAA*|}YagYg;E$IHRULBG!# z0kw}RO(_aaonbS2;T=C`kJ?&l(|jVbwXsJ;qT#`Ly_|CA0i2oWuR|724K+F)R|Q$` zjz3_j`r91QZyUg;F;yo&l=c~sPg^kO?0EsX4T_oFf34sFafyF3)>j}F4>d-ES3Vx^ zj8d_QFpmh3E`fT2|AqLLt5zxUCYw})pEr3b9Ho#a~s7SmZ(%w4Kb=B4`b?Q9G(3sI6QvC0H5HW1Un{;0B-Dm+q%@;b|1_>03BcNoN z7<|5)B93HBMxWJl?0L z;OYFx(+1PvMvL+jUx#DE;D+t@(U=Bzx4hTSeC@(gRTpTPAd;uEN;?mt@?A|trLSN0 z;NT|LC^LII1(}6!hle9oW{e(PGUGi+*Hrqev6D++xiy-r^UCe*)bm|RD{~~{w0UU5 z?)?L8x8alUwNI1bq6`PTq6F@a-_)e5pioh(LG~9J7Dz1)JM=WH()92~et|0tvDN&Z zbcC26BX!1V&7;t6^;ShJoZ*4RSl*|e5sg{E`t4HD^0y*=CU~ld)DrGTbwArwE4KfM~uWc@v zAE|91jae>U3ySXZGeJNdqbytC+9oKJ$^1d;LmP*{Z+8s;d()!IiAvl1EbCNNgKVV! zuFHgC{NXJVSKgQ&yx$rC@0b|fek;BqAUWPFyj)00u;3jRB$U2du3?gTO-Xn`Ne<$O zmM@L94KHr;^lJVybV=!TcYIY;-|m4{nUKco2#VnZx?gWmQ{Lzq#xeIzgUSko{Npm$ zerSCg$C=~eUgf(#8sLdPD^kd7-3M}hc$Hf6h4LAj1CcE5@QN>kOKp)|m>$OEDEOeG zffqxBw|e!+8|FJF&iaBtBFR4;y5;}8`ml!j3lc0$QvmwL%gp`>J}pN>&GL<<-4DK| zCw8EAqe|Djn6D1!&gALeH^jyT)*uZ-Rlp$t0S?stU0 z)5Gp5uk0dVQ+&Nu-&b9V3xh3~oji2<6X3PouDWVrBQwOPHYUIKD}_tb5rO6E2r(ZP zv?~)Sp6jr>Z2<$d8hN(qbeb*_zRw|7>Ak{zg452@>+Mitv9r4_WKuy)D-(D*!VYi$$LFG*ji*-BZD8oO@v@D8G-ofFOM z>eIYEy!-O<2G360ni9Jb6&cEbQd~R&bp(V|lL;lTn!K1TT_9qD4;%NOM_9xbw5#zR ztAZ?{Uo$a{FgEC+45QTz%bRc5!pkG;$8!#^psk7=9OqMxh%K-}lwL~2al_Lt6xO^{ z*s3~gKH*vCYbFj8=H#rPVo_mFc5xGn5xc?nwje*zHR0q-{+k(f$OMQ`(>oYK?aq19 za`v9{|GtOW$p3Yhge1f+=3PP<_MAQtu(_cX?1fP44&bB_h!IvW_10cpw~#%dd%ryP ztLg5t(~6NFMU|i+52Xi%{dA~kItK(TN*arlTUa^S?o-EKS%^Kl*;fr=9wGH79qo{O z*L_zS|l5ET36#HFNeqmldLoB^+8GoGi*}}{b5jKxKUVwCARUNQaI8k>c@R0zd zA&r04!k#|<*`2cq$?yJhxA^V0B5%|4Yf)!83r)j4sOd&-aewVS^3J1Y;H>7}y|}A@ zc1iJ?C=*by%3mas5Mxx78TFRDdchtBO599f;UU$xZD189s4}m;@Wno5;VVM=4^Ma z%@!tSUMdxx#Z2~XAe4DrG{azi1H#Ch&_v)P%R5TeRC)K&vO0L$4O?{M#NPMUsQ<=W_t!bn)F-EGQJyrA(LI<4_|3_ z))#l8{IEt@19fkC3%`HR>@n2bwGoh%Pidq9FOmI0?0gi0_H<9Fq=}U*ptCO^x1F57 z3)Ede#j4i;O!a4C%BA?3+=Cf^Cs5Fl#duJUi&M}p=x`?LhKW*)8kXEtk}ma!tVyr+ zM9X44Cx~mY<0<5U)?~CE$|QXt9{96eb7x&9rg?P?R}QRA+VY25qq?G6@V$Ru-p|0m zC(GpnXt#W)oOETBqwAj@?M?(C8De;AVnv5>C+PdC4e5XGEJqCFz09#2qV6r6{uKP; z@(uw+mBp+}%P4EaOjC~#75YM-Aju3m+L-&VAmmHi@E2HD6)(1LJz9Qm9l<+L#qH)t zCYa+XO>2HX>Qrt5cz4sbnszV{;iq*k(ie=xB%8<0S0n7-uWrIO{^-;UYC_heIR92n z``>=rAd$A*>R-+KNY;0vb%ef&22`p;+j-S~#xp?h-O{JRb0e?$3D($usotB(1^jpZ zc}A`@{3}==ZF)@&I2M9vzu9spC4NuLh~Tzi)J%}%r3I<-lv$W5!}z)!`s8k0d&B$W zJVf5kRj2<>4tKVPqDMEA1t)`&Znk9}gv)RfF>6%mij#}Pm~Q(u*Q-L?qgB`1`d4x9 zU)1ETOvIbH>LdieR-5FD%eZm}vtAtEse-d@B&RmJq9HmmR8V*A5u2^pcoGA;Bx%f`K)e8bjiyYOcA>IHhZXUC53341q0}i!y2K^vbkp`S#1$ziwNWfnRd^ zPWA$1hTM&I9hWBDj|J(-to)eK_d4>s`{X#*b2Y!&oeP%Umn!2A`2U^}p*w(C{~|;4 zUqiF1n8M~2H+3mJd0EmkT5jW9+h!+A8mb;0MzJgJ&JATI=6omJNe%~Z_U=2}NAb)! z0@_6AI2)OPQ_>@V0%X%a_6w3faCqYz(b~ASA9WI$KX~XT?TUmT^xWsXKWMZS54m=t zh8&2}f?q&CAOq>7#gglp{x*Y&4jW74jFMyrx{MRA9@;`uQWL7uw9j+2+PVE-5CkpFG2_L6rMl3<;GKFlO z*CtMe)ZvhXP||ITjBA`kHY%Ee|5xXXP`tmfzz z=w&qY&ij(4XRdeo@+~WB71i+C#WPOdcBk!IuW#6w{{6bm^tFIjI`LixD9s~|Gkto6 z=!O+PDJO;aleBSIo?rhLAT& zgNj*om!EP)c++u1m6_0YJ|J_uRwOu@2VI=zk#o5Fn$|*{BNl8N1VPU)mx zu$T62X0c{*Kj)TTYy0}G%j1@K&p#DebF+`rf6&OKUS~}y7XVUPxqO9p@hiNM(!`wx z7gB~+Crk_dGz1!{EMq5wm&XLwH?{-c$GmUh^zxV!KdmZ<8|Bh|UDb)`TJ+J_XOqOQL zFcU4}!*|xFj_hrpnT?aU^7X%*BQI4uZ@zaT&DYlT;DCr1W6zlM|QG8sI`BV0QB$w6TuNp67xjbHm> z9S-DGQ`p!x^ycAB|13{k-zQ=#1Ea%#k@t?1{{nJ*fTd9T-^XfvVVt&&8JHh@-~2-& zFL9cl8%~y<_#azo3tel14Ob?eo(1s*n#0wy{VwUdSJWwRLE8*v5RO`pApPq(q6X_B9P$rM#UH2 zu9|gHYrT{L6#dmpe6^x5qB+q4u23MTquQwt5lzd z2PtUBEe=YPq|W0g&~Lj3#-uDQeO)4PBb+|=t!g<$0uxMz#1|myC~)_Db`f%^OIQ8< zRxn1wkaxCu+md6Yk|Tb;vCPcv&)HMreLolFSf%~S5t=~m4v~FYv9XQ5A1z7&BGh^| z$qZ%SqvE7M@!y=^Rn-hoR-(nav5r?SK30H|XaYhK;A7PXAP1aW+DEHz;P1eq1yItf zL@;HkCavZ(9l6JpWI7Z*xvCue`@JPUzVN>(Ijd3&d+n+P4_)pyezZZYN(v8VIO$S%1*G6CrrHL7P)Lq>0x`?+w%>C*xu5ifo79wKN5-#nl;OlAz zb%YdQ;W&I*AA3=KW~A_Xt>PdHn-B5UGt_Y7jlb+e>PvPAPR`sz*&m=zOftKf6Sc@? zpst;u(I}gLOvwFX^}F^wob2fZektQxe#<_-vo)YupuPnGjP8#rjgc-bt{R6qe5tuVQ{en?XRG z%5WlEyyIT~D6RP|`{Qfax^`ekC~>-?G?Dc~OfFTK;Lw8Vv@g~U&*_4fjzo>RZedPf z^e|?eT|Y)H+VQ+^3);L>SC40n+=u|Z$Xd&8#X?7}CuBZ&;;PTW^o(jG=V#Y$&?X{_ zs!}U3uVI}dN#xE}?l_xt{J-)cIZyk4uUvFPJ+Ln0?vj3gdNSdA-UlE9=KG*NPcn$S z0-uMc=iBqIyoXptM_*U^^2__my>LJK3LXNbEFF~7R>>y=1ForG+;RajcOVVsZW+bL z#(-RCg@l3~qxZ2cPp8fBB@xBxg+w?sYwo#t!J(YA8gjO1i~U|R%C(uC_Obwnw@rf7 z)#D;cB@ME*APGLF&x%q7uauSE-M^A1`?(4HL`Z3z4_s2NGPuu@G{Q@$Z|4d*&@!K$ zSRM^2d!X>(xc|xgDdnP$wTH*I7~T#O0pVFczqd+NONWIOHOaj(KO*f4AU*lH&Ff%iUKm9144wdaf)OoVq8>lv;ZX)71(K^*d$HnxusO z)~2hiO%>|^lfr%m|NB^z^8x_K0i9qYK-vn3f{U<%4+$2R$3+P>ujX+~jQWg(Ln<;I z)>12rjETm@k7H}8T3_${j;xN}bJW>dZl=cP@*{PVOcWzdrA@Cnyua!fyw`<|Jw`*Z z<`9Oqyt=zYH^65en7y?RnKhsBW%HfC9b4Id%C0EoA|PcpKl`+Bm}^6iRp|z~=+}GB z51qWppS53&eRqZ5cYiFRi@juG^vkOMsoP&;XPvjePDBI3LkdQIeUo`Ux(sseQgZu( zMPVeaa2I-e`(}mYgu%NMklpjE>z`RBE85B=T#0RNTQGR7ORedO1s)ZE zv+9Z{#^%8#+hrO%o3~(?!*CHc1I^kd9i415Hrqpfj_)hU&m4kcq#Idh9xBnub4A_} z-<4T?;mu-yCHTq(+>M6)+FM5|$$Pl-5rnNNEGY(m##bVuj2-Rdr}q1*BiNBIeb_g9XWE;` zcjLG0T0-3RO(o#+ZWfDP>Elwp4znGKm#l_*o}cF0wz_3Qq^Vt0*b^;MvV^3>VTdlK zjt1UaKh|FQ9tRv+k}JTMHh4hhpxe6BUN_`p(u!3SM9gsjrnq&4D{KFV^@m}>(bgu_>|PcNLj_9}dO@KQDKwyuMu?*vXTv zt-NS8xN-qG;N&6!@lsUgsEowtA)rY@zFlfT$Kyd=%JsfN&x6~Frd~wmkx(yj_ft+h zx|gWDrulQm;jhJuy8nC#RRj*&E61DP z!Omb9sX8OkpM!t;R`M}ofPYWEjlEV$j#}jBAS>wlo6&@#wBBqXExVNp9dMbUvA7~@ z+p6Ke*w!tIe5Q+o!wi@<_*|6w%_>E0QYKjxSrm!guQr&*UDBMf49@uZx+VwO8U- zzDhmN_G_zy11dg>#7;_@?9l4z`lZTkKi4ilU!fJwkXcvWQ)AU$?M7084A9@)CG{hD zi*M0C{;wBb zP#2H`_QSVcl1tCn#N3S7^Y2|gc6GgkEn_S;w;$U17SCVNP!Yg| z9=;iLxYG9^IS|&7THj0R8D?(6Sx4)M&h))vV7{xAuhKh~)faSkvV|*S`04ZI44c0< zcV~5Qi6DAedZQ~I_dNDesG-8V9(9y}e~Lb1jAQjdD6%D+e=)Km#(;A<4L^sIaGC;4y^FIr{{3IGOFPe9BNo` zu?l*j`pO)Tl>7XuIlY@~T!+N}=;$F!f;foGPc~s#cIZug)hkH zn0?KwPL|Q&`Zrd|Wx}ETlvl`Bu8SKspd+N?qa*kcvyCg}5e_Y;hj4s(XI<|c7J=qH zckgY$ex-kwg3oO%eaj-5^mWJ55z|ds5>*|3TbK88lB$#y9a&w4b?Wuw&TM~bpU*Rp zp}I@R(&9Vt118$ny5Cr`^2ehb!8V*Po;VfBokc3xc~^@qgri>f{IUDp^+u*l5ic(2 zF_w5}!Rh0dUgASS+C{l?T3*4HA?AX%W}&9?^+3aLD}ocbyX|}0XxFygT$Xo(|KO4% zYAvhc2g32Zy;Fe+?s8rf%DnpJ!Q_LN7?Y0=Ie9hw_}$DnM17{>o~oRhtXl&~kpC2# zeL!0dIJg_YUCo(^VY4du3bFM~L<-u&EgpeS2n)J--onoKE@9Twqqg>&_@6Gr;q=R^ z>x&;f^DW=?OC+$f(BzxE;etd8PdMbS?oY>(o_21c{;oM>?DY1EE*M_wTZC%M7r~8f z|Lghg?U4E#KgD4aK+qq+p%RT}A`7h#=Yxd=q6cbA59?orvl#57MC4<PoM9Y)8&FJmT%z$wj$AR)1%;>%?-ptl%e?!PL%=LvY5ZZ%Yl8Dq1&)` z(`x>CmAp6%l1c}?ANd2}@E`aFRfy6z%}*AhTTa>Hd4Vq{cf=Jj4g&AUUH?adXR*L5 z7nV7yc%fagjp0OM)m1b=KvOW)!;K=9>0{{ae0Fh~8WwIcS)S&xhOl-FKk+>u(fyC( zZYJ+K`<9nHbs7sbGndp|uJ=~RmHCX>h_bz-1qg$s^@+bfV=x7c2+vIHX%arzo2GS3OcKN5qeQdUpJM-cs7gM*6kz`@&a;z858%v9=ZaM zp$SmAowoN!5-n){H*(7~AipaV;!YHG0=GVQ)UaME0#O~1Sq@^BR@fzc9>S^QkxO6h(4fn1y1GPQ}Td zvS(a!xqR7LESXs`!@G$qe5}^_VJi>3h@8^EN++>ZN9a&?LT`yp=Mj+j7r;}B7C_8y zFeiyvx+)~-))tYOW>nCP4PQ>xdB#ocij7TmJ;zM?7flThpA|nC>pse_1q*&i&E>UE zzLBqGB4h~YpT)MK;ydKW=J6Z>`0c(je@A?K=aCE=W8Jxvv;;%X#j@1c&eq}TK zKkv#l;u~ftvH8m^g9SH@gP@vGdYvKi9K5+D_M5JcyI zBMahsTR7?1MNa;xrW_8(N$+e1L{yuaHLqYytKFI_V)s_yD$>=4Y_b7&QuDa&3764y zt^aMl^!R<1+w4`OAZ9;{gEo>5Wy3-SCjW_Yxj%CCEfZ#3+h*tU%m37*T^`B5NF{re zLN1g%>O5~?cH3wZc^Bea9EW~z9ld#zuMr{tF*WZ7PEH9-#zgieRklt#usknPM$>Sm zgU1ZcIG(?kt%_fCG_**W!<%Tq_4@Zip2E+hA~qqm0(lSnL~ zSL$kDCkCOW6O3sLzuG>GDen6dP-s0L09o@5kz3sSS9ek5rCd}GnFDtJ8?lyI;DdRF zi$4b@+>=!Wi#+_PN9MsVnpA!>d%|h2r}t;@9@q1+?XThKHKPVKG9UP4namRJl<_}> z(M?Cnsn@)9ubHfuQg$^bjiJ@yjWzY|Yi`)Qog_zVUkLY{k|3 zcqFhEO`4zkRm3bz*%!AgeQ`kehTkRimDOfm5p?G!fIs9i$+9z1Hf0KT>2hF6dm~zl zRt;`DooKPHmm6pdc5#!mWxjxQz&b!@e2$v>q50Zmt3kEG(vL$;(3e^s`!?|A&|w8@3VE? zNKG;}WWg2c9Nn^c6DC0==hu1z%$I7eBTkC_%n(*Z zbcJ%)+!-vltEFBX)fJ=9R9DUF%m4VN&_qPx9utg6Wt>-$0urIqeJw`NXYTm4$z;a> z`b^fF%Rl*UcvWTbMC(Yi=oG$&i{Bcb(UJ^bFTf((Rqeng70coiWVrJSrnxeXSv+4WFBR3j^(p+gl zh1aFbu4R+i_~{kVQ;!G~*H1XlOLJd94#=h^{_mAj0S*qJa+4|h1;K+-gn;qT+xklN zg5bxulq~kaqMQbt1{(xBW!RJ~0$RL+>H9S4-gh=gSdlKcnlRKv5gMvJd$%%wY1C@0 zlX!a}9=)|V?H?88(xO{Xhk6MwF}7+k3|fF>S~Nacn3j>84Z7wceHk0*#EFgUIsL>2 zVW`mfpd(n9rI~Ou<6R-`&xI!qVUFxY`fBbxBV8-_HX#;r4@o1RQUh;!#(Qa#o&c{S9{R>RrP2pIdrDNcn1NH*N>RXr&TSIZnR9c#C|qIM+%N$_{QPGecVN z3EYkh2!a)^BJt|mTPqPPu)PM!;$>GVs?ta)fiP(%K2HiM4$8yEk(ZNoH>K;zsjC(~ zHPV(1+b`y;%|z;fgV620O2CR@E=)puzeW_K;O)<(+#9kI_9f@%~ zT0MeW=KEb=Qb*51;^f4RaNC=KM7UMir_IJ^^R(VkdEgB?y0H8t3q!bn-KXGbKXNjF z%7sY?3%(-E>Yfz#We*|Esy9AU{`HP;S*Xk%^|tXKBw1YI7Vza$<4|ycTsgiAIf{$a ztOmb4``x-0jvNxrvsBi*F1N#2&SC(pJApMLB~aUY7ojVr>c99NZMD#=8sV^I zv@vn}ieSYJynI!I%gx}^?cK&5lrB4iU!hle{!0koK>~Ne0pzDMOD0GPo9#6}Izvug zJfSEk$v)_uxr%DHwSNcV_rRESPmbCS=aa zpU=W&MnRxr{ z*qqyfMDt|&86-ZC8`kcm>4Qr3Wbw!WdFjx; zTphXf`Q^*(z_!;elaqJ7U#K^YSBe;nB?DY8l#)dVWrEFbPT|lFSTUP*!wKU^tMvh@ z!8n`d4oNMdp{3atoWcDh-a%RUI^UN|nU}oNowcNY1VxXCbe#4Szc^FOAZIaAkaksy zUcU|I5<9&Av{|K5*^4QA-(j=%ZBUNj-6TO;?m#lP3Z>Ae z&F8wEHU95oO`fUzpIpvC0vNH{#*BE5$R67M7o}6f;$cFY%1OBI35KJJ^&~x-DE)x_ zg{h5O{CT$StzPTz9a=F8fA^fcSI>&KeHcD?2qtz}>1HtV_2y17w?^ah01E6!4Hmr#zdSPRE`N)E3$~mlvp>{UU6A zTO<6*`FdZ7%CxTOvwk{Z3N4*mw^5D9kSJY8UnRL2v--Zk?8P}dWf_0NfRNRWcz1;A zpZaN|FGhB*$N!c2mg}wLuKZnjBiNA~a#f?|oqZJFy$VX*zX?#H80V+f9_V&n^!JwH z+}9V71M<)T3C_jz!322afd3))?eI5^0m)}SDPO$OxpQSn<-VpdB*|O4%z5fkC6Rgi z;CheQTO3=MBMnXq62O(?k9R+Ql5NC*R!>^Bj-sK@Bat6 z#5^iZ$tK|7^nivYP_equ7tY%Br&W1)=y-GwgDE~&Q7~*wpSV4(!&zH476-3P$t(|d zLa*hV=Gj`f%L95Lo0_O;I?Z*pf*V~?E^SBG;E1IL7gPob*F1LC?%rQ=q8p`;t30KZ zLM(dP!8Bv2HYL~Z0G_VtOyW7TxELqAGb#oTBF~NNxd}bDB9Z^VR~Pr zSn5C3%0(Z(ZSELG51oMYoHt1!+>!#h6TZjD(w6E8-{OeBu$Aofl<|=Bju|_&a)NIr z*$c_5kXEfC$`*572S@-;#Z?r()KR`s>#hscDjwOI!5|U#TStrROGyea>V}2JuDtr% zsHMI=ml)ik%`_J3lz7E%_@T!KL&0uJUcUm9ciCw(9BG=?E=VTggAcR?ITw%vmI8TR z6TO%|Xf)Jc45v@k@31gFAHJF(F0VTnL*`U!LnFoAky^p7qPh&Vs~7i zW;>@>I!ZpDFsd*7212T6GlOjD9bp4;TDgxg!XsV=eNv|X5OI*8=7iYg9nvWYCDtjGpjz=m)7?yu^ck03J` zA3kWu_qHgwgG0%JReF^=SO`T!L7O^NQ$80hi(vS<_hHVZa$n&Y?=}<05{m_B zd_te{;sc~qwO3Tv+>ovoeJ)z&5iP!}hr#8v3jG_`BH?jbjcz0uytIUgXFT$t1^3KQ zRdo*%QY)j!Uer_c!7t4|AWN8K$gH5ohNARa(=g$Ef6wHIxQ{{vkcWPecboSe7_t7y z9B{iR^=D#aA0Xv!zd&7nByN;StvO@7R^!K?Y(x%{Gz;^!o;Xwgb7VC;=kNIK_2x@{ zulA@&VF;)c6hKc)ZY^AYTPon1YIJ)oG|wH?$hmlK@8mn_J1GzKUcm<$OXF*1)546Sk8ywSL=@KR@7c;A@I+RB=myGmqT@GUZF z!tPah@i7>0e%n0K25O?zAqSa_=S19$bS}X&AWmGXd-09iurA1zk^;3uGrcaOk7BjW zJjP`Z_do5Mw_6inY6*(0i{9HSanF9!e^T4oeDd~7lfIJawan^^yZSXbZ|Gt+4QPUa zekO2m!U$T|0|xSTo&-BOuY#Fr3MySF$UpcYmu$-~-zt^ff&Jw--%eM~l_ckMKB%z> zynqbZZS=Xc&(D{Y^e)5)bmHNG1wj>2O(3g1YxBtH?ltx?L}e_b5UgQ0ko8^09iNt&WsZAjM)2Qw60GH306MX-2V z^YC@X=kZUW12y&?mc9e`5uTM2zEO(Bp4l({I$}bO@cCew8s!g^&xLehCE4~F0b;P; z`}iW#WM`1MzklCQ>XOQ+eMn<9 zDe87oq#{HJ!mTqt7q2R2CjnKl@5L2vb>=m73&;VF92rnO93w_eFG_ven4%{j zs>`g@T(3|^5B2n6ewx$cnPs-K&XaPfd@qBW+xPGO^m@alq9{%!&YnSCpYX|K%N&f> z;om;M&N(1+{~+g4b1^F)aOKCQkXK__Mluc zi;R(qjQdq7y@kLdi@V0)Pt~J$U2!W|Rn#h`SZU(g^3zr>KHw z3OR$wrWt#7Oo53O=ut^Tz`KBV#vu>C~PNn z0unr)Ph8jq82NF84TM=|LXX0_Rf1h!`S@N2)%?`$_U^m?dU%(p)E$@%AhduSm_4v@$z$cIQ^N z?c}O<+a1b#U&1*0xBGJ2kJ^YBU*3ZKn7$1s+^n@m4bQ^DU_hkLIkJ8t@9uX)s2zAV z|CLoLC;@4NfvG+cYi{d$bZ66oO7EE9P@Qi6+~o2@&H;_Ld)oz%6 zrKnYXE1(Z&9(;u;=8$*+x!vTsB2D3oQvVvjNPvSw4tR9uc&ABv-ntjs6D3I_f;s0w zOJP+V-7WoPIC?54p`>f1QMr*;KPrB*7e)}H@knvV3N>VDQ>zJInP+U72g9ibckq^z z8aJA=p+sop^jQlmaDI7{w;=nL+R@eSZy$}uKCN+i%DN4di?Mg5!1c%(r0?ct^06f9 zzTk zX2IX4$VaNbvG9f14v3*|k^r@k22&M}aHENsPvI!c8slP*jHSCKMZ#%YAW@xmSam2@ ze6It(5l)1?BoRwX>4tKDH9UvDUKVxxTx)!+$m}3j>8Q`E&h<7+)TMM4J$K2ssjo$= zS!RU$X~wX7%)eJ|i(*zt8_=NxJ@f|A3oduHhp8#ih7HU}sZ0qh!g?$i4*Mo6%ovs+ z=rvVXU2qsFsk(>{z;~%uxxT5KQkh`YrK+ZsOEB@AP&3M`+qK+l&@GdCqK00X+>SO%U67bs@{o;L_aYF@i?6Ji`@|L1};j}bj zvV`Z*jIT0?VbT?>O3;4=#+y?9Rhwtvz~}4~r4eLhPRylTU6o!X+-jH85~$-SjXxK+ ztmDhVW%o}UL-zJs{4;JZ&nSJMlcyXkV#6~gb;w}QCb*)-%J=tiXbe8rZZXKQ;lV=W z$?+D96l^WrsnBv=<5seVP`*?ze(-)~`=+jV@>|OUDwy3HMOKgJW1{zJN^hZbC6JGV zvP35ioaHYd2Q)Ns|6?S#Bt#Q|SI+j4&P=%;&*N3+4YS&GvVg=IJyyr?ZPqUjEZw`e z&#E*$mx_T912uI^lU4$l4D>aVr*5+dW(I>Xj_NP&Okn5h9kx-M_4A~jg8B|sDKp<% z-zaxe38*QNXh@;#^EH!ixxVCj?6R`9L zEAoZ%+NOym8(8S$9l{>%-K6|2SP9T1!RT$9^|o8`FN*5}d-U?9>bA{mN+Pw`oh?Zy zSJKf&bl6AA{u9HN9w9xY!B1V?b_ifMKn9PCJj5_pS#ku+TfFholy_3#>&zu_57Z<9 zV8Iu!Tprnl!7FpXqroR7XC}tN+h)ReE9tk=#~PM_>D#ZTSzdiE-7}DVYe*+TF60BoHJAuP<_T z@9iREzM-~4hMk6dJzPvXa>s^yw};;)f-5RkT!-qusR6a zTwvzYG@GELsm&s_e+`cG;Nd0RvGOZcRp7FsybS)3VN4;mOyO$p7)z`VWL=p2qf&SQ zIbirOq6zd!%m=Rj&oi>zLp>_jPf^20MUk46s$fzbPfM*>r~i_@x^*e`;QGt482^=h zeAn`|jVg;$7)28~o@S1zgAI~zwhfy>&*2%G%Qujw61suN1&CB_e}nbh{i7|?inTSm z;$6K51H3q}k)G*kv`w88evLNnb2qszIXQuOv4F*7^pRQS5Wzu(IpEtZ^8J@{3(`)t z0ZQ=fS36cB4CLM%~VJG{B?4jTH%CId)F}X z3aSr19Bhg++Cyq_F7BF@?`7wrDWyb_!uRi}x&~p-#4~H#LmG*($9A?Zg>%AG9p2)S zwyHQq($&j!z99||^I>ieui1WkCwkc;~)2O-xDhX+G0Xaas z1O=uKK*cHw6ka)&F|uuDr^-q?+&0`ClooKsOMh6B=yE@pntKE=5-kGmKKcW!7GHj# z{ps&hAI@!)Z>kV7`te2=!8dWMy-M%(-8R}bpF#oNj)Ii<%9){q+WsK%ML}k>FC$8y zhxmG7M>)*$)J}>Gr__j2k<*X+>Va^wYh=-yg!vx9Ij2&6d8=nTJT#&1RZ*6-H+2OM(a+|$({T|(F} zy<%ovr36+KZVuyJKqyOz7UJaBtbOe>Fj39NKAb6LhjH6ztwno#!^adw_TbW)d94+mj`N!pwXMuPK zIpD6U0Bt$oV^xU7nmntlJ1q60E%V~x?keZoswws2;HD%)v98D0J~^vWIe#rR9&pyT z-yIFLldDjYm`wI3Yzk2qj29I_X8fVSIO*-0!$XJD6IYk!qgfbzZQaqIF1y~YD7zW> zqR&V?(kMju?yXFaWz6q^$0BLcCR&;f-YS$F)bu4L$UvwlM`{(dy^XPNoH2|E9rp$V zT!HTumMM7V1Wg-Si%U8tuf}b&=?DgVY_D~sODvlXcLg*STCDB(L*%z__(xYvs6tRS z43ZQE5q*&oKHG8gIbAN|+3LDhV~84}P;@UgQXJQhY<|CuAT3o9H?@u|GWQ+^Pr#nVDFPdv7X+w!%Sl7EOEdrNKTk2E#Amg}5~cy~A$J{E?K> zub6M-Lv9K<36_Gl3oqkJQzKWbzWY*>4=@veScMNyz9)Q7NqECqy80@5Pp1nR_HGNuR7w7K5frBr3cXw%x>u0G- zADpvZGG<6`KUNmF`umn@1_#@jUT^`&~fpD@8u=J;?rVsy_li zjyu4292{fFo#kYp{exYQP!gnPtO}o!IiQCj&ey`wW0BygW5DwG$XJjut%gVVmSw(P zeG5!055lnIsT<-)w8r<&7$a<&$6$R9E9O{eTaatCWjf2JF~vgR3S&kFhCR#O`{JHT9AH9y>{Ca}>SU4>C>G^CAxKITAnHRh> zt`T_&Y{0E6qm=3csqTA#lZ<@Oy*hSX^YQ9ymGMb2oefGcieSoQ-f9=&q%D`;-g+dK zopTgsQnzbWRT1Trzu@RAz6C)*wlMoRAn#RaKHZS49rgN^fwu4{_eTl`%fjUauCkFn z72FqF2HBc}6vz_sg`6ZKu;=?Ywd87mx#%bz=ca5@rstV1Ucn#{5-e z`#+kl!=LK^|6Y5K%8o+TwX#Dgn~N*1eU0pKZMkO3CM$arx-R!}$+(0>M%m-yax>CU zT&rXhjo-UI-`{_5AMg8oJ;!;T=Q;VE-2L?w1r&;upadTCZ`;}}!m73mo>P8ssD1ZT zR8dcFv<&(6JFi>h2}#457cA^lo)3S`h6<1x5UVAH3Anj8 z+5wd7OzZ4=Ghr5z|E8^})0fzO&dONJXG?(vveUZ_=>cC?1S7&`VPyBx_yzs;{G6Ld zV+B!2Pop9j4X1_gW)xg+#Qk}X57-M?_%yA?{ z2gt)3d{f`DZ;TFY5j;nAp_`pKo7vI1C@lmNFN=~MKa&1o6?sEeN~kLL-|_+QjH~^R z4q+&9}(qwf%*n%Hs>(9l`HvBS}a7`%IPL&Pjq^P65 z>1d>lGtDjB4zKPNsjT&F&2#Kkfh~AQwioV@^|urknys3q4f8a+&x<|N@f|i++k1RR za`#1i44IwJN-R}KS(5g73lpWnGtZct#OrtNE@gJ^sogj=atn64S@idCX`cH6TYU5pW|VPvdMuAHZTKvu-X~LQR&vBX#=bZV=8z+HIxd5YcE@ZO z0OKsVa!Zp@{^42>*;PZaBZSd{A~}i=hn;tNGmpxKgO4oNT7521qkXuo(h|hwRFr-` ztD$33vYIfgUXlI&Ekl8lvFBm?C7uk?kb(ihqQT%`zJSH&!tIDBw5S+FZ)iXneIO+D z8%@;*mxKYqTFheJ)bfDUg#1r2wWJq&d%WA1-?O^61AQWvN>vqx`nHOI5^*JAxH))* z6j-tX%_*Fl>n@;Vedu@%8t8>H!Aii}Wm-var6Ri=zBWxlg6Mg*Ye_4~@TaAGWIeK= z-vIw)I`oHuV2DEfU>(h{HJ@sv=8EX^y=!y=ONGO-Z+-sFT~q`xP*+3#4y-_3HIF!! zUPPr3tK*$9na<~=tK5Qxoi(Z3-*bH9{L=fpv$2u9n)ToobL6Vb3^Y%P;)Lpx2}cYy zUp#|lx3`sjYhn8;;Z5DP_FlVXo){6vY<|KX_3^zs|VMM-$DPJ4I+I|@i`_SN|35cfU*j_!Y@g@3fv-(s(+{>CG}*kRuD*YyXl3J*OZ zTZQJ*&`ik3gT@BVWvAUI){q}VRr!S1dlp=6U!MThXMfq$gdhLyyOaS89q33rOjtbV z`<0&3ds3{+xd>D0V+3;#cNWcEdJ!Ya2OwK8=Z7Wp7Z`KJ`gKvU=>q;$R}!V5X$|nyF18|P&(Bg1TwYyz7;DBqD0uI6 zKmQP)-=9#`!EE<7=G~QtE03pTyh3)%h<|JW3EZC@Ipn2@Dn<}hsz@>14-uEphCs~B zK?+d~Rh@|2;R|ca;82;pcDp&!*)@E?f`*uGCTkjRUNCKOdMzWr0>n8WA$Q%Erg6ux zht8QYmae+;97yKEM=cF~M~-(Pv@OzMsAJr}kV_yWsr|!9Y{lKj4gN8jOwjg*Nj3$$Z@V1B1y-2M3h7l=BeAwY{1l@^@05 zwh~;6GGA_v*@!(vrLsVhbfXkHrTg8;5px6DY}_~)I&(Jk#6y!>1e8GCFCZ7iqo}1R zNkdbg%_fF8&eOxlI<`y%jEB4>t+mb{Hyu0gY_dk!fFS2S6TBc-lp7pH0dV!rDh>ES zcRt!N6rhTV&S3no%@~p|5^U{gM99yarQ_`dY2@wGsf$ura%VsHZ{+e$9k;jlx4gvX zS8G?myQ5}8yu?1~CH_|8{>8hi-*5g6IbiM*{qM`E)VUA+o{hM5aX^H~!|O$z^n^uI zhmM`9EaxsAg|1DQPA{pUxqqb+HS7&`p~ z+3`?rh1TNXrY#Mq2id50Z=`d^pA4t(?ZY5;ax^b3YyY3c5xZ#PkX}ec=c6RVP%`}*Sr13 zPfsg0G0|78q7VdPGSTo|5E_vwTX^FgiivoyPEt)Qv`lUg@$Bwwty}{~;x`RDC0cNf zPHvZz#K#+B4&T4^(im2J|L2Sez;eLc#S&#aa2v>SKw&+*&Vxq9ESV)z(NIwixTGQ= z#3xm%(R>u#&joH-gq{RiwmjhL@>q_DaghC7S~8EM^rLB{3puC6MYJxJXf5!>KyW39 zo?gebT*=T9Z!qz&BD_uI#loL0Aq*pHu6|R2l2y1u3HGS<+0$Md*^g?Gr}G zI~3rOM(yhDZe6k1)=iGHLmupeg1o;+hBK9-Bi}1dM#Ha&{18Ft$%+2t_;O$H3t`LP zPNCq3XN?MM_aAc)u=>~h4LJZ^S_J@2VD18-;9(%k5k@jDZFY)Y=LJ0hX-dnfQ{JVo z+Ewajyh5|i!c6H7cAlPWSd?E=`B9;uHZIma)a}Xj#I%2HMM}d z(ewEUn8T7k9;Bl_sE_aN_N=`^33-)zQC?0yTUrj+WPL;XbDAGm4050~6pSBU!m_&{ zXc?5{36iwI%*o*7u3BWlT<*cmuS={_{Gp;DlHM6w>Mvu364rxqlw7YoyEoh9($5on zY-jp2AouuI#r@mc%*fN+b};mr&kc> zgtoWCU~x9TNH$wCP762F^ghyfRqhTXTer(ieXO@I2eqOXC7VNbszDi(FH;(*Buzx! zV?A~d$`lfK2CGh!R*vQv$>yC{*M3a0uC2S2APb*1H(Ob!vZp|oQTw=lG z#2TF`v7us_*|_{RA%S_Q#?L#S?p!QdH2&2MT*~hhLE-O)0{Upi6G&a>D*4r&zJXe& zh1Zu?Ka!MIwm^)wtd|vT6cl)R$auFYS9l*@zhfV2{l|V60Y>7C;A^$b z?m31%N_!=%23>0g4(j{SlH+~vUi=A5>E4q+`%HaP=0Hy0C@hPGU*N#=W3G&UZI{XM zno{t|Z>xVHN0rO_-x;d{Kr{r#hl9dm?yNlW#A?s&UAWKj$%M~jN0<6r@&~j5I9LL9GZ#j{)8?AmuGLBv# zSUB#Wo5^SD?j)?4RQnC{P1_7-YjsL#xl*3a5IfH5fr{A&)(B0jX~mg*$gSv1_rV{vb&%)3gHh?fFNZce;#1` zS}i|RUf>h5G}Biy)ze)HTNSCZ(rKN<<*{n%jumiTrlD>8l3L6|J$6rj@k~6?_>%J4 zzmTKKefhT|@g2Jb6jmV1{k}1)n&;FDVS81$WJ^m=H`Y-Ylx->1XowVS? zMn`x^dHnA?Hl@G!^NVZJafVeCwf##BlCq@?weFq00b}8a3VZCK`(^Hak#|ZR@&5a80BD)dy)39v{9DKE>6)dYJ_&Y{v zvIsObE8Sn`5|?Vc7$&-#=Hcf4uI8O9IdbgD5xPT|1W-!X!6h=kXe)AiZ@V_Ak zXe#j$*MlOD!@r=_J}ydqWHp8Qt4{)d~u zV&C_`n-9W!@g<7dmU3p|)Jn@*B)?6J?~%+rY6c^&=kH-xTGtF;XeCL)OXe1iNpReq zCQpM(6A5_^*nx}NOHT?VrRP@Ma=0h#Cml;>1De;WMN>C)r&%hBFcoMw2d`l9G=apy zyx=rkaDNL4-O&va_JXHH>g49l#YW2d`yN7VJ!0}E4&1Ig|yhdU#qzKM{KUe>gL z%I3cGrI;F(7yTEugNba=CpM}ZaMifGStA!LC4wN~*|(+LT~pQVt3y3}0wzxxP522DUgpdo23=?24t#ys$D^B$LK9UJ{oZt4vnPj2Qd=QJkE@$-&qufn@ zUJeU&KT@kkGhU9`N)0p{;p>Lqvn+VuA4E>Yf_NyF5|_l|r)`MVr@tay6*eb=7Yko2 z7KRwhR@D<=w(PV#?M%hxUn=~r^0-r^fJ`_~vp2j7|1h3}j6Ys`*Slc@$83&1?a}h-fv6{EP8z=Ua?_VEs!E@#Neb#muy4-W_G^i9D`d z1%C)!eCJ0#TsJyYL!U2FekDw(PHc03%KE7$r`TAvMLdNIPS4EyUtuL!-4$W}jsvXE z{ykQv1d2J%jJv0dGiEcT+XrlMGDd14uUad+l8lxtJA15U-nPCX!_z-hfuIzxKr*$S zFhT`sCtgZxQ+=-4qJ9?vEgiexpdijW-%+Q9sOgOEHZAScN7c)g34cqRZKB%Wdr%YO zPQSNizHc{mbB*RG02=vP@N?s>-}(rit%sB^RphU7@CLLbcR#a!B9n5*oA%OAnI#PJ716w$Zqg?K`t4SJCS5J5#=p3R-$!A#XQ!{@M*5wd zDM7^!A^gv^sN#vtzlR%dhipWvhKFqJksn8R1x)+;E5SRJnD%I^1Urf{Z=*&9(cSq8 zfN=*sUsGNMgn-Yr#`heS>Ho2UMpZ706gc|e;N6m9m%IlnBb?sFaTnH~st;vddfid{ zzP3C?zxzYbX?BWP2v@c;bE#YfvlhDA+BAc9?bF%VhSigQx_m${2TZKYA-;g?gUE2j zYy@Cf)Tm3rM4>xuo@ACYr#&L!VAi8>&!2=E3$zNq3ubkE`_8)e-i_{v1BC7~es7)* zy$mOON5Uju`%JI36-OZO%W_#!vq)UPrf_Fi_pWyO1Feqxdw8F2!^_+^9pc~8n=%^n zdKeo1SdN;E-%eAA4rN@x`o#Va#p|dcZnqk|`{Cjrhf<#&lE?U&vgXY{a7-ytWR{|u zNTdJ9 zU&^@cg;Pe>p~f)1CMZt(7_!asYAG2J)kPG|b@bzyTshdh!Wpt69BEX-^KIvm)ukSo zob3iXYkiyDHpQJBPv`?MHkDqX)Sw1h+> z*=rSw@K9(*RZthX|L$IdAH5jI8NnKGCX*I2YaP)ti}3NJxx`Ysrco8f^HfaFEp7^& zJFYGiBy(6=u9K%1Xc}V?;szLhD1$S#nsTOt$s8o*7{ z{B#XP3!?I|oVc@@vB0UqEgO((V{nY^Kdj%htRn7%IvPd zwP&u>JfsGpL{J8etOLd}&Y#w$cGzLWq3Kt_C2vKJr}L1+0!`6pF4nX43 z#C~Et(Ys3cZG)XV&ccmb_Pwx1V+y`m=4rl%P_j@`To5ykF_gg>#d{ixU`@whV3Bx2 z!|oF;qs=Q`xIX)<*tduRN8kEB9odKTRfGNUX^!cf>Ls0{k7LHYqmnsc*73}O996n7 zB+rl{Y+o1K;U${>%IyMZ(wxrkEOt zM_VcSb!2ip6LcoQmHn3(pv*=>?b$97vGe21&u3Oi9)xw;6v{Ucs&Lafh$wnX-N=gC zvLeP84nb7oCG*GiY(fjH7pjhA;8>@lX5UqxDra+f6$T*@x)PajCe!qadmgB$a6!D9 z6@DZ8CM~@J-JvUrQd#E$%d)m>+;g@axWiYqbLsinLmOiNsRj&55L8QEfBDcec*3(J zNiZka=57yPEgt(L{0?xicapLZK(xhH+>NKE`aZf*W@gb_;Tw%kZxbmHRUj3P!RJ~f z2ry0z61@;GMjW|6woUG>Aa<%oEG;o>buz<8RBk+2?oas(+DVRpkeRi1BpF ziPb*PmkKj;rdIXFAAg%zSNsh*Kpvt(?Qatd9Ao|iG?O=e-m~-$WuT)HtactgIz0R8 zEcjTMn&&4I7v^?&ThG9Tz*X|TjQ!gOH>(mR=b7+q>Hyk%-_}n{g(x2)xbF6c!`pCJ{r4JPNopcQ&{``7gRE;F( z%JhtYpk=B@HvaXb{Dx7?(c>JQ<4bj{EDM;0tZw>PMb=oiD{$4_$W=#cl}9)v@bxh~J^!j@f`n?pPtn4ohU&u`oG zR&`2zDE-~qdHO0eaC{E@H{<|x>F=fx_;L_{Xb3#kvXn*>DTxsp9wyM&1VPSXEmpf~ zb_9(lP8xCQtENF+#QqEhcouI$d(k#dPqI7B>V z@vIdBLn@H4F-49>&;@j@Z%19z4jQMR5odAR?BQWOtJWekV!Y8W$bf3!}Yfrk!PrA5%Y}fyo+^ZUvE5_^0=Wo(t#h*XM&_$({ zTCa4`PTsyvIz~9#etyM&Ial){hPox*jK+3CkuKxz%||KR{d!NGB^yeaS)%&3yJDgv zU2u!jrJs@8x~rt1D`r9p2a^ z=Uof@tPy?o=);5}d}7tIUl2qAzXTk2TS%r=oXqFuVSF&z7TbW~PCzZVQ!k1Y#g*Rd z*?QbjHa}g+)VMf_Eg)_sUs!%Ne()&IeAo*lVYO!-UQ;`N_+ zUjgtH(xFZkNP#&WcV(({4nc;`Pj%opaTO$=wzgY(jtFcflTTR9$+jcldeAh#*Pes2 z_F%LouecOrgqLDElU&EkN}$pV=@{wj=B@NhiGeWwR_7;WkC<;6<9&4I0&kkR)iIO) zhTLbW+1bA#=R2SQObAW~VonulBoD3}FS+#VPkt-8z59d8_!t zgxcvD|Je`Q*H}-ezI%Ue+(9u?WLisHyJHh!55~eCBYO#2s}1fIq8cSEG~I>^4~ThK z{2Ff7BA=c`D#ZAyvczfOkL6+{i_ynsG`b`HA(N)l69udG`urHE-S}NQ*>;|{u)gzl zWP3Jyhvd!jAa;6JRX&dhLy9TppAMQ7!Il*Ew~cqhCG#U(x}G`D8&_GMb=tc(F0jA~NLgGL)W~I+g}x!X-ob_SGYcgP-`Kki8S% zlgD5#KliDcdmI!`6D>(T3(;uQn@Ha~7RrVglZCeyfVOjORod~YFS_R%!l(}6+u#ND z&huEjmalRkg|L&*mQ?d|PO{7RULV8x+KQ9<%jJ*1F1wmv_gIg8N8Duw_mru;v&VZr z!JLb`SPTdS_v`lCvYJrDvJc$2HfcY=E~qfpFaJO-KWL*n=DwQQhp^$FC#!3FNY&RR z1e0Rg_Z0QDlcF*j?Ri$p%7Lxk>R6A}y`v|3dOQHMhCaardIb+Rfa0Npse|0OkJ* z>nuJPFiwUJSp6OKwIb5Le2~4%l;zT|;9jNTEKqYdErWq!2AtGuuFi!2{R{iUBUVY)V9-}dv}G3g>rr4?3>&&Kull;+nsxM z+QY+bxu4m7Cj8M4o*}!m)&9og7`VB^edMI3H)Ts!H+YzZI!i%zt6|?Q`F_WHZ?JS; z3_L`L?E`KR7ig1ps6R=Wf0pNZb&0aJ#uFc%XZ7AV7P34bpuMNTB_{z#`~r}6H95cgHuO;Lk?i@ zFZ`#1qf#f51Z26?MApPuc4l_2V()w96W1OxFoaVYf8_hrGv@cLtzh|wuVY*EgKem3 zSusst{4)^?bPsylD<+^l$2}WrudtVXt@|*)y{INEO?jQ6`@6~?+f17 z?QkD8qfHyW^o7TM;PZN0I+Q>4oXS&TK9!61u$}hfh}FO>a2rUC zC4gkRZOppO=6&o5AsfnA$`&e|+;+E)S|r79~d+NK-5Abe;IKZwEU z5F?%Da_2KR=rZJ}O%zm3`QIg(B0Ga2S0k2Oh)NfD1UW?gQuw2>a_ZF}{%}!eoXDNfc_%{4PJA zg*#ZOP-s3)4bSh{%FrdDnI%uGnzGJ{? zoEB~}!sgv+L71I?D|S*!KcL%6=fS|%<; z$oLrr`zYk9BRZCCBd118WSh_2%AB52} ztxC|&$y|4dg;Bgn@rl>WjUK!Zdj7QJUHL+H*}m9W^ueBu@2WXA7pfbfQcv|gS05jc zhfXtw)LWm-h4+YzFXO`S2rs8ekA_Wk;}`MsnSf2F`fMnPa^0?~~+^5#klwuVUWs>&BilS2Y<e5>chkcAM{H&tAc3 zbe`c0-Me$JIg1)HoG;sA&S|dJr8LcBWqkjZR!9+CzCL8)W2uD! zTQ~ib9buZM@Zu#tekPX9{@3ed0_*Rl-wkfboYzvm^%<{B<0j`lV>!*JIC6+><9eLH zpZ6G6{w~)hs=}lLH(x7=HO(xXHrlk>_eWI6Sjp_`DUJKGw_7QL-7N>i^&>UUhLbV) zf<5DGf3_%UT~_vQ>fl?3vDN2?l4c~@A+C^(YeGK&=j6W_I>6uu9xE`h0^}v2uy&Ty zNucsN^{#PAln4q7qRVg6D{xzRp@oEU19sEzy!e%_a=rI~PaCc@W74wy0`pVWeBDe7 z{RHa;%lJ-v;U@uSGT|N=W5isvkB^LL2XLeDBH;v$#rKj-7E1Hjm|gVLd_#QP0u1#N zMZqE~MYzpc3@u~YxikU0H>$j51Lu5J^f*Mu%Rcqg2d^Z)Y%0IQTn8u7gUkRqe8%E> zoeF+Uo_iEU7{uVbbv^!hfSXjG*Yzd0$6g`R0yRetn~&rBFQ5TpTYO<|5o%Lr={=&> zLio}BI-`liZ7?xX9ULB7=|ecOXJL_LM~`$iHjHsI=aEzmvTZa@Ul(S zBTS`AZP2bfTCLhEG*a5pg}EJVC-ATir2^7FA^A^KIa>hFFw7V*cm$AO^9VY)^`7QS zO^Q@a=MOC@jjzcb#l<}6U03TY|;kWQSvUE z3w$T-2Wx3OA`v=u-YyrYX;!mk?G!l!(mWSrlpk(cI-cCGEt2gU#kxpHx^8N^M*X}y z#^s`_$_%p2Q!8By!`-*qB%fU8-Dmuh9Qow{YR{8&LUE^{{*nbM9??1jiCJCS){8OV zh%ae?FT>`04;P%~3%k|pm6eI(P2a+hklHAO{qdwDsCIHJdK_fmGhtg;UJ-x(C z!R#od`6Kuohc0d1g=pd4tFQ6+2S{ln|2uo?#b(G1Y%Re&(7;nYmv!E6f{a9j-`^>$ zL)TufDGJT63qz_eMiHb@IeMBnKHIsIi@7vTIbBp2m@t;5xcYtgP{3oEO7qwR*_?=+ zg=DP3%hiYNTb6vQp9G5}#S^xKW3>eTIb#AK3Bb@~0p6<6-zFFzl@J@8^%9cFKKh<6 zC#8Rc{=60uDVQ0uvD1lN+8`nKTqfGix~g&^HT6dQlcS%a3b)i5Hib}=5U6R4v2|_* zY1UWK&WCu&@yk%%q@&G-_-D3GbBjP`^yWHVIx{?Y%-h-do1Egg|7Y^#kjuvykvZDAGo=qEFEM<=D|4AuP`SqplfI4Cn%DA*^4-^u-|-r+Yr2ilhJ zEANC~YG@SxBrVe5NR7lg;E*_j%)t)+79}Cn;vs z!W?O^r8B0v1$u9K^S8jwTi_C6k~ew_z_3%h4q39+a)!CSCQ_j2mUP5kJx*6R@xd^L zILu;cDf7xxOEncowps1Iq>QfHw1mNa5sP$jYngAWLTw1lb)*F6oOCzy6}QM#XV45I zs?<;FA~L*URNpfHtalCZsoCQfgrKD~M)`&X9Bm;AW7Ohmw&I(gNFvSX5irK?cA*6@ zBUGNui6cCBwa*s}$73>>KF7BjO7>u*_Cj<0XC#aF@4vrd+hrjk$E_Wb2+C$=GNVb* zEut84X-@Y(9Xy{JGNJL0E(e6156}c38xPq3MVFuvVO0X)Wp-KKq<;DISl+|{%!t?5 zWWkaUUIz*mg8i#umF*8xE8|5yZbwPjaamM5`_cvFo3PepwavDT~${$&EwO06j$#j6`;CzL;>FB}m6S~@mp-rZ2px!~U2RwEaXYQhesIJ3zI zdr5}|-%Iu_tJ~$BnHhzMy2#>dy4>dN@6t?iC8N8Qk>J8zPY>~FaOeysf2X0Un*nT$ zlO%+7VpcCU+ju#eI4COwN3R{*ez=V@*wd<$Ml=P!$zznoZ0FFp%T*1$``FFg)zyIL zeAe`#d&l_m2L5kHvPG3g@wb;V2GmCZku}I9+>1 zF|V!=FT=4I>ZtdbV}K_=g^wriI#MMm*84@}geb1iJ?&6R09CCwU7{#(c;7#V zKOpke?r$_UJV5Ln_Yu2Gu4wkJo8DGG!&o~q9$`4^>RQPj)^7-K^;{eQ=eybgwdwIW zl6?zZHIz7|P1n+Ew}EGkWM;tg>PTt`{wMqTt<)(>KLW=;p;^yA^Vzv+xi&fU&deeH zTEg_XTnMEIjfuj{AZ$#jGbBXoQH-}x+4~Krp zhM~r4i=2*2G>PxVpRU|ItqD%hWXPmoNM%=Rer2Ali3u!D_sY1_d9iL6anzE3XLtNh z@}1?hXg;HD7JUHbc2KmL5}V*25CW?X-qo}VKd^?7EW0$TiM_{n1ba+(r%)kRGUAQTT9(uS1WZ)mX}U0&Jxb#BF2; zwi!|awF$HwidRGw59J1hnxj%@96FToJ3*P}biqEvXl-iBin2x)<~Hxg#be2+i`PSh zUcKMF*GlzBHjSqtdxiU3tBHe4mA0P2qb!$qdPi9exjWAp_VrfI)vR>Ev zHT|!b8wN&wBw*kr_Av?I8H!TeF(U~Zqcmr{UEm5q^@b)gOmt6$55&pW1A2M)rcuHoUeOR*1j1=iyZhgNIJ> zsLg2#gJdc7X7$wlI-t~{*+{SGoI)W%cEC=&xLYnK0Q8vq02T{l31Pb>0UHDmBUqs@{WMz)4lfB=1)70@Bf$O za?O=Rr1zu-w1M%V5+7lHlep3R@h51&Q1c3i!i_0Tk%uL3h5iZ~==_m{?!(m4_vd*X zj+A|i7jaPB=NA?>y`=;%C6jgWmkh=;P+C1nz6+ZodEml!-UXdi#;ut*nU}F+gl4bK z&<4lQwRSV)`IlFWiEs4S$&}JM<+Bgf^qs21RL6G|4i{)C7b_mqI-w=0E5=)CYz