add new db fields to action

This commit is contained in:
Joshua Burman 2025-01-07 18:41:50 -05:00
parent 2288cba78e
commit 0cf62ec4b4
9 changed files with 6440 additions and 7 deletions

View File

@ -35,7 +35,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection()); AppDatabase() : super(_openConnection());
@override @override
int get schemaVersion => 20; int get schemaVersion => 22;
@override @override
MigrationStrategy get migration { MigrationStrategy get migration {
@ -164,10 +164,23 @@ class ActivityActions extends Table {
dateTime().withDefault(Variable(DateTime.now()))(); dateTime().withDefault(Variable(DateTime.now()))();
} }
enum RepType { time, count }
class Actions extends Table { class Actions extends Table {
IntColumn get id => integer().autoIncrement()(); 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')(); 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<RepType>()();
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()(); TextColumn get set => text()();
DateTimeColumn get createdAt => DateTimeColumn get createdAt =>
dateTime().withDefault(Variable(DateTime.now()))(); dateTime().withDefault(Variable(DateTime.now()))();

View File

@ -1441,7 +1441,7 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
late final GeneratedColumn<String> title = GeneratedColumn<String>( late final GeneratedColumn<String> title = GeneratedColumn<String>(
'title', aliasedName, false, 'title', aliasedName, false,
additionalChecks: additionalChecks:
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32), GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 64),
type: DriftSqlType.string, type: DriftSqlType.string,
requiredDuringInsert: true); requiredDuringInsert: true);
static const VerificationMeta _descriptionMeta = static const VerificationMeta _descriptionMeta =
@ -1450,6 +1450,88 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
late final GeneratedColumn<String> description = GeneratedColumn<String>( late final GeneratedColumn<String> description = GeneratedColumn<String>(
'body', aliasedName, false, 'body', aliasedName, false,
type: DriftSqlType.string, requiredDuringInsert: true); type: DriftSqlType.string, requiredDuringInsert: true);
static const VerificationMeta _totalSetsMeta =
const VerificationMeta('totalSets');
@override
late final GeneratedColumn<int> totalSets = GeneratedColumn<int>(
'total_sets', aliasedName, false,
type: DriftSqlType.int, requiredDuringInsert: true);
static const VerificationMeta _totalRepsMeta =
const VerificationMeta('totalReps');
@override
late final GeneratedColumn<String> totalReps = GeneratedColumn<String>(
'total_reps', aliasedName, false,
additionalChecks:
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32),
type: DriftSqlType.string,
requiredDuringInsert: true);
static const VerificationMeta _restBeforeSetsMeta =
const VerificationMeta('restBeforeSets');
@override
late final GeneratedColumn<int> restBeforeSets = GeneratedColumn<int>(
'rest_before_sets', aliasedName, true,
type: DriftSqlType.int, requiredDuringInsert: false);
static const VerificationMeta _restBetweenSetsMeta =
const VerificationMeta('restBetweenSets');
@override
late final GeneratedColumn<int> restBetweenSets = GeneratedColumn<int>(
'rest_between_sets', aliasedName, true,
type: DriftSqlType.int, requiredDuringInsert: false);
static const VerificationMeta _restBetweenRepsMeta =
const VerificationMeta('restBetweenReps');
@override
late final GeneratedColumn<int> restBetweenReps = GeneratedColumn<int>(
'rest_between_reps', aliasedName, true,
type: DriftSqlType.int, requiredDuringInsert: false);
static const VerificationMeta _restAfterSetsMeta =
const VerificationMeta('restAfterSets');
@override
late final GeneratedColumn<int> restAfterSets = GeneratedColumn<int>(
'rest_after_sets', aliasedName, true,
type: DriftSqlType.int, requiredDuringInsert: false);
static const VerificationMeta _repTypeMeta =
const VerificationMeta('repType');
@override
late final GeneratedColumnWithTypeConverter<RepType, String> repType =
GeneratedColumn<String>('rep_type', aliasedName, false,
type: DriftSqlType.string, requiredDuringInsert: true)
.withConverter<RepType>($ActionsTable.$converterrepType);
static const VerificationMeta _repLengthMeta =
const VerificationMeta('repLength');
@override
late final GeneratedColumn<int> repLength = GeneratedColumn<int>(
'rep_length', aliasedName, true,
type: DriftSqlType.int, requiredDuringInsert: false);
static const VerificationMeta _repWeightsMeta =
const VerificationMeta('repWeights');
@override
late final GeneratedColumn<String> repWeights = GeneratedColumn<String>(
'rep_weights', aliasedName, true,
type: DriftSqlType.string, requiredDuringInsert: false);
static const VerificationMeta _setWeightsMeta =
const VerificationMeta('setWeights');
@override
late final GeneratedColumn<String> setWeights = GeneratedColumn<String>(
'set_weights', aliasedName, true,
type: DriftSqlType.string, requiredDuringInsert: false);
static const VerificationMeta _isAlternatingMeta =
const VerificationMeta('isAlternating');
@override
late final GeneratedColumn<bool> isAlternating = GeneratedColumn<bool>(
'is_alternating', aliasedName, false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_alternating" IN (0, 1))'),
defaultValue: Variable(false));
static const VerificationMeta _tempoMeta = const VerificationMeta('tempo');
@override
late final GeneratedColumn<String> tempo = GeneratedColumn<String>(
'tempo', aliasedName, true,
additionalChecks:
GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36),
type: DriftSqlType.string,
requiredDuringInsert: false);
static const VerificationMeta _setMeta = const VerificationMeta('set'); static const VerificationMeta _setMeta = const VerificationMeta('set');
@override @override
late final GeneratedColumn<String> set = GeneratedColumn<String>( late final GeneratedColumn<String> set = GeneratedColumn<String>(
@ -1464,8 +1546,25 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
requiredDuringInsert: false, requiredDuringInsert: false,
defaultValue: Variable(DateTime.now())); defaultValue: Variable(DateTime.now()));
@override @override
List<GeneratedColumn> get $columns => List<GeneratedColumn> get $columns => [
[id, title, description, set, createdAt]; id,
title,
description,
totalSets,
totalReps,
restBeforeSets,
restBetweenSets,
restBetweenReps,
restAfterSets,
repType,
repLength,
repWeights,
setWeights,
isAlternating,
tempo,
set,
createdAt
];
@override @override
String get aliasedName => _alias ?? actualTableName; String get aliasedName => _alias ?? actualTableName;
@override @override
@ -1491,6 +1590,69 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
} else if (isInserting) { } else if (isInserting) {
context.missing(_descriptionMeta); 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')) { if (data.containsKey('set')) {
context.handle( context.handle(
_setMeta, set.isAcceptableOrUnknown(data['set']!, _setMeta)); _setMeta, set.isAcceptableOrUnknown(data['set']!, _setMeta));
@ -1516,6 +1678,31 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
.read(DriftSqlType.string, data['${effectivePrefix}title'])!, .read(DriftSqlType.string, data['${effectivePrefix}title'])!,
description: attachedDatabase.typeMapping description: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}body'])!, .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 set: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}set'])!, .read(DriftSqlType.string, data['${effectivePrefix}set'])!,
createdAt: attachedDatabase.typeMapping createdAt: attachedDatabase.typeMapping
@ -1527,18 +1714,45 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
$ActionsTable createAlias(String alias) { $ActionsTable createAlias(String alias) {
return $ActionsTable(attachedDatabase, alias); return $ActionsTable(attachedDatabase, alias);
} }
static JsonTypeConverter2<RepType, String, String> $converterrepType =
const EnumNameConverter<RepType>(RepType.values);
} }
class Action extends DataClass implements Insertable<Action> { class Action extends DataClass implements Insertable<Action> {
final int id; final int id;
final String title; final String title;
final String description; 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 String set;
final DateTime createdAt; final DateTime createdAt;
const Action( const Action(
{required this.id, {required this.id,
required this.title, required this.title,
required this.description, 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.set,
required this.createdAt}); required this.createdAt});
@override @override
@ -1547,6 +1761,37 @@ class Action extends DataClass implements Insertable<Action> {
map['id'] = Variable<int>(id); map['id'] = Variable<int>(id);
map['title'] = Variable<String>(title); map['title'] = Variable<String>(title);
map['body'] = Variable<String>(description); map['body'] = Variable<String>(description);
map['total_sets'] = Variable<int>(totalSets);
map['total_reps'] = Variable<String>(totalReps);
if (!nullToAbsent || restBeforeSets != null) {
map['rest_before_sets'] = Variable<int>(restBeforeSets);
}
if (!nullToAbsent || restBetweenSets != null) {
map['rest_between_sets'] = Variable<int>(restBetweenSets);
}
if (!nullToAbsent || restBetweenReps != null) {
map['rest_between_reps'] = Variable<int>(restBetweenReps);
}
if (!nullToAbsent || restAfterSets != null) {
map['rest_after_sets'] = Variable<int>(restAfterSets);
}
{
map['rep_type'] =
Variable<String>($ActionsTable.$converterrepType.toSql(repType));
}
if (!nullToAbsent || repLength != null) {
map['rep_length'] = Variable<int>(repLength);
}
if (!nullToAbsent || repWeights != null) {
map['rep_weights'] = Variable<String>(repWeights);
}
if (!nullToAbsent || setWeights != null) {
map['set_weights'] = Variable<String>(setWeights);
}
map['is_alternating'] = Variable<bool>(isAlternating);
if (!nullToAbsent || tempo != null) {
map['tempo'] = Variable<String>(tempo);
}
map['set'] = Variable<String>(set); map['set'] = Variable<String>(set);
map['created_at'] = Variable<DateTime>(createdAt); map['created_at'] = Variable<DateTime>(createdAt);
return map; return map;
@ -1557,6 +1802,33 @@ class Action extends DataClass implements Insertable<Action> {
id: Value(id), id: Value(id),
title: Value(title), title: Value(title),
description: Value(description), 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), set: Value(set),
createdAt: Value(createdAt), createdAt: Value(createdAt),
); );
@ -1569,6 +1841,19 @@ class Action extends DataClass implements Insertable<Action> {
id: serializer.fromJson<int>(json['id']), id: serializer.fromJson<int>(json['id']),
title: serializer.fromJson<String>(json['title']), title: serializer.fromJson<String>(json['title']),
description: serializer.fromJson<String>(json['description']), description: serializer.fromJson<String>(json['description']),
totalSets: serializer.fromJson<int>(json['totalSets']),
totalReps: serializer.fromJson<String>(json['totalReps']),
restBeforeSets: serializer.fromJson<int?>(json['restBeforeSets']),
restBetweenSets: serializer.fromJson<int?>(json['restBetweenSets']),
restBetweenReps: serializer.fromJson<int?>(json['restBetweenReps']),
restAfterSets: serializer.fromJson<int?>(json['restAfterSets']),
repType: $ActionsTable.$converterrepType
.fromJson(serializer.fromJson<String>(json['repType'])),
repLength: serializer.fromJson<int?>(json['repLength']),
repWeights: serializer.fromJson<String?>(json['repWeights']),
setWeights: serializer.fromJson<String?>(json['setWeights']),
isAlternating: serializer.fromJson<bool>(json['isAlternating']),
tempo: serializer.fromJson<String?>(json['tempo']),
set: serializer.fromJson<String>(json['set']), set: serializer.fromJson<String>(json['set']),
createdAt: serializer.fromJson<DateTime>(json['createdAt']), createdAt: serializer.fromJson<DateTime>(json['createdAt']),
); );
@ -1580,6 +1865,19 @@ class Action extends DataClass implements Insertable<Action> {
'id': serializer.toJson<int>(id), 'id': serializer.toJson<int>(id),
'title': serializer.toJson<String>(title), 'title': serializer.toJson<String>(title),
'description': serializer.toJson<String>(description), 'description': serializer.toJson<String>(description),
'totalSets': serializer.toJson<int>(totalSets),
'totalReps': serializer.toJson<String>(totalReps),
'restBeforeSets': serializer.toJson<int?>(restBeforeSets),
'restBetweenSets': serializer.toJson<int?>(restBetweenSets),
'restBetweenReps': serializer.toJson<int?>(restBetweenReps),
'restAfterSets': serializer.toJson<int?>(restAfterSets),
'repType': serializer
.toJson<String>($ActionsTable.$converterrepType.toJson(repType)),
'repLength': serializer.toJson<int?>(repLength),
'repWeights': serializer.toJson<String?>(repWeights),
'setWeights': serializer.toJson<String?>(setWeights),
'isAlternating': serializer.toJson<bool>(isAlternating),
'tempo': serializer.toJson<String?>(tempo),
'set': serializer.toJson<String>(set), 'set': serializer.toJson<String>(set),
'createdAt': serializer.toJson<DateTime>(createdAt), 'createdAt': serializer.toJson<DateTime>(createdAt),
}; };
@ -1589,12 +1887,42 @@ class Action extends DataClass implements Insertable<Action> {
{int? id, {int? id,
String? title, String? title,
String? description, String? description,
int? totalSets,
String? totalReps,
Value<int?> restBeforeSets = const Value.absent(),
Value<int?> restBetweenSets = const Value.absent(),
Value<int?> restBetweenReps = const Value.absent(),
Value<int?> restAfterSets = const Value.absent(),
RepType? repType,
Value<int?> repLength = const Value.absent(),
Value<String?> repWeights = const Value.absent(),
Value<String?> setWeights = const Value.absent(),
bool? isAlternating,
Value<String?> tempo = const Value.absent(),
String? set, String? set,
DateTime? createdAt}) => DateTime? createdAt}) =>
Action( Action(
id: id ?? this.id, id: id ?? this.id,
title: title ?? this.title, title: title ?? this.title,
description: description ?? this.description, 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, set: set ?? this.set,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
); );
@ -1604,6 +1932,30 @@ class Action extends DataClass implements Insertable<Action> {
title: data.title.present ? data.title.value : this.title, title: data.title.present ? data.title.value : this.title,
description: description:
data.description.present ? data.description.value : this.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, set: data.set.present ? data.set.value : this.set,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
); );
@ -1615,6 +1967,18 @@ class Action extends DataClass implements Insertable<Action> {
..write('id: $id, ') ..write('id: $id, ')
..write('title: $title, ') ..write('title: $title, ')
..write('description: $description, ') ..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('set: $set, ')
..write('createdAt: $createdAt') ..write('createdAt: $createdAt')
..write(')')) ..write(')'))
@ -1622,7 +1986,24 @@ class Action extends DataClass implements Insertable<Action> {
} }
@override @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 @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || identical(this, other) ||
@ -1630,6 +2011,18 @@ class Action extends DataClass implements Insertable<Action> {
other.id == this.id && other.id == this.id &&
other.title == this.title && other.title == this.title &&
other.description == this.description && 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.set == this.set &&
other.createdAt == this.createdAt); other.createdAt == this.createdAt);
} }
@ -1638,12 +2031,36 @@ class ActionsCompanion extends UpdateCompanion<Action> {
final Value<int> id; final Value<int> id;
final Value<String> title; final Value<String> title;
final Value<String> description; final Value<String> description;
final Value<int> totalSets;
final Value<String> totalReps;
final Value<int?> restBeforeSets;
final Value<int?> restBetweenSets;
final Value<int?> restBetweenReps;
final Value<int?> restAfterSets;
final Value<RepType> repType;
final Value<int?> repLength;
final Value<String?> repWeights;
final Value<String?> setWeights;
final Value<bool> isAlternating;
final Value<String?> tempo;
final Value<String> set; final Value<String> set;
final Value<DateTime> createdAt; final Value<DateTime> createdAt;
const ActionsCompanion({ const ActionsCompanion({
this.id = const Value.absent(), this.id = const Value.absent(),
this.title = const Value.absent(), this.title = const Value.absent(),
this.description = 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.set = const Value.absent(),
this.createdAt = const Value.absent(), this.createdAt = const Value.absent(),
}); });
@ -1651,15 +2068,42 @@ class ActionsCompanion extends UpdateCompanion<Action> {
this.id = const Value.absent(), this.id = const Value.absent(),
required String title, required String title,
required String description, 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, required String set,
this.createdAt = const Value.absent(), this.createdAt = const Value.absent(),
}) : title = Value(title), }) : title = Value(title),
description = Value(description), description = Value(description),
totalSets = Value(totalSets),
totalReps = Value(totalReps),
repType = Value(repType),
set = Value(set); set = Value(set);
static Insertable<Action> custom({ static Insertable<Action> custom({
Expression<int>? id, Expression<int>? id,
Expression<String>? title, Expression<String>? title,
Expression<String>? description, Expression<String>? description,
Expression<int>? totalSets,
Expression<String>? totalReps,
Expression<int>? restBeforeSets,
Expression<int>? restBetweenSets,
Expression<int>? restBetweenReps,
Expression<int>? restAfterSets,
Expression<String>? repType,
Expression<int>? repLength,
Expression<String>? repWeights,
Expression<String>? setWeights,
Expression<bool>? isAlternating,
Expression<String>? tempo,
Expression<String>? set, Expression<String>? set,
Expression<DateTime>? createdAt, Expression<DateTime>? createdAt,
}) { }) {
@ -1667,6 +2111,18 @@ class ActionsCompanion extends UpdateCompanion<Action> {
if (id != null) 'id': id, if (id != null) 'id': id,
if (title != null) 'title': title, if (title != null) 'title': title,
if (description != null) 'body': description, 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 (set != null) 'set': set,
if (createdAt != null) 'created_at': createdAt, if (createdAt != null) 'created_at': createdAt,
}); });
@ -1676,12 +2132,36 @@ class ActionsCompanion extends UpdateCompanion<Action> {
{Value<int>? id, {Value<int>? id,
Value<String>? title, Value<String>? title,
Value<String>? description, Value<String>? description,
Value<int>? totalSets,
Value<String>? totalReps,
Value<int?>? restBeforeSets,
Value<int?>? restBetweenSets,
Value<int?>? restBetweenReps,
Value<int?>? restAfterSets,
Value<RepType>? repType,
Value<int?>? repLength,
Value<String?>? repWeights,
Value<String?>? setWeights,
Value<bool>? isAlternating,
Value<String?>? tempo,
Value<String>? set, Value<String>? set,
Value<DateTime>? createdAt}) { Value<DateTime>? createdAt}) {
return ActionsCompanion( return ActionsCompanion(
id: id ?? this.id, id: id ?? this.id,
title: title ?? this.title, title: title ?? this.title,
description: description ?? this.description, 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, set: set ?? this.set,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
); );
@ -1699,6 +2179,43 @@ class ActionsCompanion extends UpdateCompanion<Action> {
if (description.present) { if (description.present) {
map['body'] = Variable<String>(description.value); map['body'] = Variable<String>(description.value);
} }
if (totalSets.present) {
map['total_sets'] = Variable<int>(totalSets.value);
}
if (totalReps.present) {
map['total_reps'] = Variable<String>(totalReps.value);
}
if (restBeforeSets.present) {
map['rest_before_sets'] = Variable<int>(restBeforeSets.value);
}
if (restBetweenSets.present) {
map['rest_between_sets'] = Variable<int>(restBetweenSets.value);
}
if (restBetweenReps.present) {
map['rest_between_reps'] = Variable<int>(restBetweenReps.value);
}
if (restAfterSets.present) {
map['rest_after_sets'] = Variable<int>(restAfterSets.value);
}
if (repType.present) {
map['rep_type'] = Variable<String>(
$ActionsTable.$converterrepType.toSql(repType.value));
}
if (repLength.present) {
map['rep_length'] = Variable<int>(repLength.value);
}
if (repWeights.present) {
map['rep_weights'] = Variable<String>(repWeights.value);
}
if (setWeights.present) {
map['set_weights'] = Variable<String>(setWeights.value);
}
if (isAlternating.present) {
map['is_alternating'] = Variable<bool>(isAlternating.value);
}
if (tempo.present) {
map['tempo'] = Variable<String>(tempo.value);
}
if (set.present) { if (set.present) {
map['set'] = Variable<String>(set.value); map['set'] = Variable<String>(set.value);
} }
@ -1714,6 +2231,18 @@ class ActionsCompanion extends UpdateCompanion<Action> {
..write('id: $id, ') ..write('id: $id, ')
..write('title: $title, ') ..write('title: $title, ')
..write('description: $description, ') ..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('set: $set, ')
..write('createdAt: $createdAt') ..write('createdAt: $createdAt')
..write(')')) ..write(')'))
@ -3871,6 +4400,18 @@ typedef $$ActionsTableCreateCompanionBuilder = ActionsCompanion Function({
Value<int> id, Value<int> id,
required String title, required String title,
required String description, required String description,
required int totalSets,
required String totalReps,
Value<int?> restBeforeSets,
Value<int?> restBetweenSets,
Value<int?> restBetweenReps,
Value<int?> restAfterSets,
required RepType repType,
Value<int?> repLength,
Value<String?> repWeights,
Value<String?> setWeights,
Value<bool> isAlternating,
Value<String?> tempo,
required String set, required String set,
Value<DateTime> createdAt, Value<DateTime> createdAt,
}); });
@ -3878,6 +4419,18 @@ typedef $$ActionsTableUpdateCompanionBuilder = ActionsCompanion Function({
Value<int> id, Value<int> id,
Value<String> title, Value<String> title,
Value<String> description, Value<String> description,
Value<int> totalSets,
Value<String> totalReps,
Value<int?> restBeforeSets,
Value<int?> restBetweenSets,
Value<int?> restBetweenReps,
Value<int?> restAfterSets,
Value<RepType> repType,
Value<int?> repLength,
Value<String?> repWeights,
Value<String?> setWeights,
Value<bool> isAlternating,
Value<String?> tempo,
Value<String> set, Value<String> set,
Value<DateTime> createdAt, Value<DateTime> createdAt,
}); });
@ -3922,6 +4475,47 @@ class $$ActionsTableFilterComposer
ColumnFilters<String> get description => $composableBuilder( ColumnFilters<String> get description => $composableBuilder(
column: $table.description, builder: (column) => ColumnFilters(column)); column: $table.description, builder: (column) => ColumnFilters(column));
ColumnFilters<int> get totalSets => $composableBuilder(
column: $table.totalSets, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get totalReps => $composableBuilder(
column: $table.totalReps, builder: (column) => ColumnFilters(column));
ColumnFilters<int> get restBeforeSets => $composableBuilder(
column: $table.restBeforeSets,
builder: (column) => ColumnFilters(column));
ColumnFilters<int> get restBetweenSets => $composableBuilder(
column: $table.restBetweenSets,
builder: (column) => ColumnFilters(column));
ColumnFilters<int> get restBetweenReps => $composableBuilder(
column: $table.restBetweenReps,
builder: (column) => ColumnFilters(column));
ColumnFilters<int> get restAfterSets => $composableBuilder(
column: $table.restAfterSets, builder: (column) => ColumnFilters(column));
ColumnWithTypeConverterFilters<RepType, RepType, String> get repType =>
$composableBuilder(
column: $table.repType,
builder: (column) => ColumnWithTypeConverterFilters(column));
ColumnFilters<int> get repLength => $composableBuilder(
column: $table.repLength, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get repWeights => $composableBuilder(
column: $table.repWeights, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get setWeights => $composableBuilder(
column: $table.setWeights, builder: (column) => ColumnFilters(column));
ColumnFilters<bool> get isAlternating => $composableBuilder(
column: $table.isAlternating, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get tempo => $composableBuilder(
column: $table.tempo, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get set => $composableBuilder( ColumnFilters<String> get set => $composableBuilder(
column: $table.set, builder: (column) => ColumnFilters(column)); column: $table.set, builder: (column) => ColumnFilters(column));
@ -3968,6 +4562,47 @@ class $$ActionsTableOrderingComposer
ColumnOrderings<String> get description => $composableBuilder( ColumnOrderings<String> get description => $composableBuilder(
column: $table.description, builder: (column) => ColumnOrderings(column)); column: $table.description, builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get totalSets => $composableBuilder(
column: $table.totalSets, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get totalReps => $composableBuilder(
column: $table.totalReps, builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get restBeforeSets => $composableBuilder(
column: $table.restBeforeSets,
builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get restBetweenSets => $composableBuilder(
column: $table.restBetweenSets,
builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get restBetweenReps => $composableBuilder(
column: $table.restBetweenReps,
builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get restAfterSets => $composableBuilder(
column: $table.restAfterSets,
builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get repType => $composableBuilder(
column: $table.repType, builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get repLength => $composableBuilder(
column: $table.repLength, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get repWeights => $composableBuilder(
column: $table.repWeights, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get setWeights => $composableBuilder(
column: $table.setWeights, builder: (column) => ColumnOrderings(column));
ColumnOrderings<bool> get isAlternating => $composableBuilder(
column: $table.isAlternating,
builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get tempo => $composableBuilder(
column: $table.tempo, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get set => $composableBuilder( ColumnOrderings<String> get set => $composableBuilder(
column: $table.set, builder: (column) => ColumnOrderings(column)); column: $table.set, builder: (column) => ColumnOrderings(column));
@ -3993,6 +4628,42 @@ class $$ActionsTableAnnotationComposer
GeneratedColumn<String> get description => $composableBuilder( GeneratedColumn<String> get description => $composableBuilder(
column: $table.description, builder: (column) => column); column: $table.description, builder: (column) => column);
GeneratedColumn<int> get totalSets =>
$composableBuilder(column: $table.totalSets, builder: (column) => column);
GeneratedColumn<String> get totalReps =>
$composableBuilder(column: $table.totalReps, builder: (column) => column);
GeneratedColumn<int> get restBeforeSets => $composableBuilder(
column: $table.restBeforeSets, builder: (column) => column);
GeneratedColumn<int> get restBetweenSets => $composableBuilder(
column: $table.restBetweenSets, builder: (column) => column);
GeneratedColumn<int> get restBetweenReps => $composableBuilder(
column: $table.restBetweenReps, builder: (column) => column);
GeneratedColumn<int> get restAfterSets => $composableBuilder(
column: $table.restAfterSets, builder: (column) => column);
GeneratedColumnWithTypeConverter<RepType, String> get repType =>
$composableBuilder(column: $table.repType, builder: (column) => column);
GeneratedColumn<int> get repLength =>
$composableBuilder(column: $table.repLength, builder: (column) => column);
GeneratedColumn<String> get repWeights => $composableBuilder(
column: $table.repWeights, builder: (column) => column);
GeneratedColumn<String> get setWeights => $composableBuilder(
column: $table.setWeights, builder: (column) => column);
GeneratedColumn<bool> get isAlternating => $composableBuilder(
column: $table.isAlternating, builder: (column) => column);
GeneratedColumn<String> get tempo =>
$composableBuilder(column: $table.tempo, builder: (column) => column);
GeneratedColumn<String> get set => GeneratedColumn<String> get set =>
$composableBuilder(column: $table.set, builder: (column) => column); $composableBuilder(column: $table.set, builder: (column) => column);
@ -4047,6 +4718,18 @@ class $$ActionsTableTableManager extends RootTableManager<
Value<int> id = const Value.absent(), Value<int> id = const Value.absent(),
Value<String> title = const Value.absent(), Value<String> title = const Value.absent(),
Value<String> description = const Value.absent(), Value<String> description = const Value.absent(),
Value<int> totalSets = const Value.absent(),
Value<String> totalReps = const Value.absent(),
Value<int?> restBeforeSets = const Value.absent(),
Value<int?> restBetweenSets = const Value.absent(),
Value<int?> restBetweenReps = const Value.absent(),
Value<int?> restAfterSets = const Value.absent(),
Value<RepType> repType = const Value.absent(),
Value<int?> repLength = const Value.absent(),
Value<String?> repWeights = const Value.absent(),
Value<String?> setWeights = const Value.absent(),
Value<bool> isAlternating = const Value.absent(),
Value<String?> tempo = const Value.absent(),
Value<String> set = const Value.absent(), Value<String> set = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(), Value<DateTime> createdAt = const Value.absent(),
}) => }) =>
@ -4054,6 +4737,18 @@ class $$ActionsTableTableManager extends RootTableManager<
id: id, id: id,
title: title, title: title,
description: description, 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, set: set,
createdAt: createdAt, createdAt: createdAt,
), ),
@ -4061,6 +4756,18 @@ class $$ActionsTableTableManager extends RootTableManager<
Value<int> id = const Value.absent(), Value<int> id = const Value.absent(),
required String title, required String title,
required String description, required String description,
required int totalSets,
required String totalReps,
Value<int?> restBeforeSets = const Value.absent(),
Value<int?> restBetweenSets = const Value.absent(),
Value<int?> restBetweenReps = const Value.absent(),
Value<int?> restAfterSets = const Value.absent(),
required RepType repType,
Value<int?> repLength = const Value.absent(),
Value<String?> repWeights = const Value.absent(),
Value<String?> setWeights = const Value.absent(),
Value<bool> isAlternating = const Value.absent(),
Value<String?> tempo = const Value.absent(),
required String set, required String set,
Value<DateTime> createdAt = const Value.absent(), Value<DateTime> createdAt = const Value.absent(),
}) => }) =>
@ -4068,6 +4775,18 @@ class $$ActionsTableTableManager extends RootTableManager<
id: id, id: id,
title: title, title: title,
description: description, 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, set: set,
createdAt: createdAt, createdAt: createdAt,
), ),

View File

@ -3073,6 +3073,427 @@ i1.GeneratedColumn<String> _column_41(String aliasedName) =>
additionalChecks: i1.GeneratedColumn.checkTextLength( additionalChecks: i1.GeneratedColumn.checkTextLength(
minTextLength: 3, maxTextLength: 64), minTextLength: 3, maxTextLength: 64),
type: i1.DriftSqlType.string); type: i1.DriftSqlType.string);
final class Schema21 extends i0.VersionedSchema {
Schema21({required super.database}) : super(version: 21);
@override
late final List<i1.DatabaseSchemaEntity> 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<int> get id =>
columnsByName['id']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get title =>
columnsByName['title']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get description =>
columnsByName['body']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get totalSets =>
columnsByName['total_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get totalReps =>
columnsByName['total_reps']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get restBeforeSets =>
columnsByName['rest_before_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restBetweenSets =>
columnsByName['rest_between_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restBetweenReps =>
columnsByName['rest_between_reps']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restAfterSets =>
columnsByName['rest_after_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get repType =>
columnsByName['rep_type']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get repLength =>
columnsByName['rep_length']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get repWeight =>
columnsByName['rep_weight']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<bool> get isAlternating =>
columnsByName['is_alternating']! as i1.GeneratedColumn<bool>;
i1.GeneratedColumn<String> get tempo =>
columnsByName['tempo']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get set =>
columnsByName['set']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<DateTime> get createdAt =>
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}
i1.GeneratedColumn<int> _column_42(String aliasedName) =>
i1.GeneratedColumn<int>('total_sets', aliasedName, false,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<String> _column_43(String aliasedName) =>
i1.GeneratedColumn<String>('total_reps', aliasedName, false,
additionalChecks: i1.GeneratedColumn.checkTextLength(
minTextLength: 1, maxTextLength: 32),
type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_44(String aliasedName) =>
i1.GeneratedColumn<int>('rest_before_sets', aliasedName, true,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<int> _column_45(String aliasedName) =>
i1.GeneratedColumn<int>('rest_between_sets', aliasedName, true,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<int> _column_46(String aliasedName) =>
i1.GeneratedColumn<int>('rest_between_reps', aliasedName, true,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<int> _column_47(String aliasedName) =>
i1.GeneratedColumn<int>('rest_after_sets', aliasedName, true,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<String> _column_48(String aliasedName) =>
i1.GeneratedColumn<String>('rep_type', aliasedName, false,
type: i1.DriftSqlType.string);
i1.GeneratedColumn<int> _column_49(String aliasedName) =>
i1.GeneratedColumn<int>('rep_length', aliasedName, true,
type: i1.DriftSqlType.int);
i1.GeneratedColumn<String> _column_50(String aliasedName) =>
i1.GeneratedColumn<String>('rep_weight', aliasedName, true,
type: i1.DriftSqlType.string);
i1.GeneratedColumn<bool> _column_51(String aliasedName) =>
i1.GeneratedColumn<bool>('is_alternating', aliasedName, false,
type: i1.DriftSqlType.bool,
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
'CHECK ("is_alternating" IN (0, 1))'),
defaultValue: Variable(false));
i1.GeneratedColumn<String> _column_52(String aliasedName) =>
i1.GeneratedColumn<String>('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<i1.DatabaseSchemaEntity> 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<int> get id =>
columnsByName['id']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get title =>
columnsByName['title']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get description =>
columnsByName['body']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get totalSets =>
columnsByName['total_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get totalReps =>
columnsByName['total_reps']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get restBeforeSets =>
columnsByName['rest_before_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restBetweenSets =>
columnsByName['rest_between_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restBetweenReps =>
columnsByName['rest_between_reps']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get restAfterSets =>
columnsByName['rest_after_sets']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get repType =>
columnsByName['rep_type']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<int> get repLength =>
columnsByName['rep_length']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get repWeights =>
columnsByName['rep_weights']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get setWeights =>
columnsByName['set_weights']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<bool> get isAlternating =>
columnsByName['is_alternating']! as i1.GeneratedColumn<bool>;
i1.GeneratedColumn<String> get tempo =>
columnsByName['tempo']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get set =>
columnsByName['set']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<DateTime> get createdAt =>
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
}
i1.GeneratedColumn<String> _column_53(String aliasedName) =>
i1.GeneratedColumn<String>('rep_weights', aliasedName, true,
type: i1.DriftSqlType.string);
i1.GeneratedColumn<String> _column_54(String aliasedName) =>
i1.GeneratedColumn<String>('set_weights', aliasedName, true,
type: i1.DriftSqlType.string);
i0.MigrationStepWithVersion migrationSteps({ i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2, required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3, required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
@ -3093,6 +3514,8 @@ i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema18 schema) from17To18, required Future<void> Function(i1.Migrator m, Schema18 schema) from17To18,
required Future<void> Function(i1.Migrator m, Schema19 schema) from18To19, required Future<void> Function(i1.Migrator m, Schema19 schema) from18To19,
required Future<void> Function(i1.Migrator m, Schema20 schema) from19To20, required Future<void> Function(i1.Migrator m, Schema20 schema) from19To20,
required Future<void> Function(i1.Migrator m, Schema21 schema) from20To21,
required Future<void> Function(i1.Migrator m, Schema22 schema) from21To22,
}) { }) {
return (currentVersion, database) async { return (currentVersion, database) async {
switch (currentVersion) { switch (currentVersion) {
@ -3191,6 +3614,16 @@ i0.MigrationStepWithVersion migrationSteps({
final migrator = i1.Migrator(database, schema); final migrator = i1.Migrator(database, schema);
await from19To20(migrator, schema); await from19To20(migrator, schema);
return 20; 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: default:
throw ArgumentError.value('Unknown migration from $currentVersion'); throw ArgumentError.value('Unknown migration from $currentVersion');
} }
@ -3217,6 +3650,8 @@ i1.OnUpgrade stepByStep({
required Future<void> Function(i1.Migrator m, Schema18 schema) from17To18, required Future<void> Function(i1.Migrator m, Schema18 schema) from17To18,
required Future<void> Function(i1.Migrator m, Schema19 schema) from18To19, required Future<void> Function(i1.Migrator m, Schema19 schema) from18To19,
required Future<void> Function(i1.Migrator m, Schema20 schema) from19To20, required Future<void> Function(i1.Migrator m, Schema20 schema) from19To20,
required Future<void> Function(i1.Migrator m, Schema21 schema) from20To21,
required Future<void> Function(i1.Migrator m, Schema22 schema) from21To22,
}) => }) =>
i0.VersionedSchema.stepByStepHelper( i0.VersionedSchema.stepByStepHelper(
step: migrationSteps( step: migrationSteps(
@ -3239,4 +3674,6 @@ i1.OnUpgrade stepByStep({
from17To18: from17To18, from17To18: from17To18,
from18To19: from18To19, from18To19: from18To19,
from19To20: from19To20, from19To20: from19To20,
from20To21: from20To21,
from21To22: from21To22,
)); ));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -182,6 +182,17 @@ Future<void> seedDb(AppDatabase database) async {
title: 'Test action $k', title: 'Test action $k',
description: 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.', '$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)])) set: actionTypes[random.nextInt(actionTypes.length)]))
.then((actionId) async { .then((actionId) async {
// add activity action association // add activity action association

View File

@ -23,6 +23,8 @@ import 'schema_v7.dart' as v7;
import 'schema_v8.dart' as v8; import 'schema_v8.dart' as v8;
import 'schema_v9.dart' as v9; import 'schema_v9.dart' as v9;
import 'schema_v20.dart' as v20; import 'schema_v20.dart' as v20;
import 'schema_v21.dart' as v21;
import 'schema_v22.dart' as v22;
class GeneratedHelper implements SchemaInstantiationHelper { class GeneratedHelper implements SchemaInstantiationHelper {
@override @override
@ -68,6 +70,10 @@ class GeneratedHelper implements SchemaInstantiationHelper {
return v9.DatabaseAtV9(db); return v9.DatabaseAtV9(db);
case 20: case 20:
return v20.DatabaseAtV20(db); return v20.DatabaseAtV20(db);
case 21:
return v21.DatabaseAtV21(db);
case 22:
return v22.DatabaseAtV22(db);
default: default:
throw MissingSchemaException(version, versions); throw MissingSchemaException(version, versions);
} }
@ -93,6 +99,8 @@ class GeneratedHelper implements SchemaInstantiationHelper {
17, 17,
18, 18,
19, 19,
20 20,
21,
22
]; ];
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff