Étend le modèle Drift (tables.dart, app_database.dart/.g.dart), les entités du domaine, les ports et use cases pour poser les fondations du score chronométré. build_runner OK, flutter analyze propre, 39/39 tests verts, build APK debug validé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28609 lines
1007 KiB
Dart
28609 lines
1007 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $WorkoutTemplatesTable extends WorkoutTemplates
|
|
with TableInfo<$WorkoutTemplatesTable, WorkoutTemplate> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WorkoutTemplatesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastStartedAtMeta = const VerificationMeta(
|
|
'lastStartedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastStartedAt =
|
|
GeneratedColumn<DateTime>(
|
|
'last_started_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
lastStartedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'workout_templates';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<WorkoutTemplate> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('last_started_at')) {
|
|
context.handle(
|
|
_lastStartedAtMeta,
|
|
lastStartedAt.isAcceptableOrUnknown(
|
|
data['last_started_at']!,
|
|
_lastStartedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WorkoutTemplate map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WorkoutTemplate(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
lastStartedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_started_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WorkoutTemplatesTable createAlias(String alias) {
|
|
return $WorkoutTemplatesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WorkoutTemplate extends DataClass implements Insertable<WorkoutTemplate> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String name;
|
|
final DateTime? lastStartedAt;
|
|
const WorkoutTemplate({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.name,
|
|
this.lastStartedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || lastStartedAt != null) {
|
|
map['last_started_at'] = Variable<DateTime>(lastStartedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
WorkoutTemplatesCompanion toCompanion(bool nullToAbsent) {
|
|
return WorkoutTemplatesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
name: Value(name),
|
|
lastStartedAt: lastStartedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastStartedAt),
|
|
);
|
|
}
|
|
|
|
factory WorkoutTemplate.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WorkoutTemplate(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
lastStartedAt: serializer.fromJson<DateTime?>(json['lastStartedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'name': serializer.toJson<String>(name),
|
|
'lastStartedAt': serializer.toJson<DateTime?>(lastStartedAt),
|
|
};
|
|
}
|
|
|
|
WorkoutTemplate copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? name,
|
|
Value<DateTime?> lastStartedAt = const Value.absent(),
|
|
}) => WorkoutTemplate(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: name ?? this.name,
|
|
lastStartedAt: lastStartedAt.present
|
|
? lastStartedAt.value
|
|
: this.lastStartedAt,
|
|
);
|
|
WorkoutTemplate copyWithCompanion(WorkoutTemplatesCompanion data) {
|
|
return WorkoutTemplate(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
lastStartedAt: data.lastStartedAt.present
|
|
? data.lastStartedAt.value
|
|
: this.lastStartedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplate(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('lastStartedAt: $lastStartedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
lastStartedAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WorkoutTemplate &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.name == this.name &&
|
|
other.lastStartedAt == this.lastStartedAt);
|
|
}
|
|
|
|
class WorkoutTemplatesCompanion extends UpdateCompanion<WorkoutTemplate> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> name;
|
|
final Value<DateTime?> lastStartedAt;
|
|
final Value<int> rowid;
|
|
const WorkoutTemplatesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.lastStartedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
WorkoutTemplatesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String name,
|
|
this.lastStartedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
name = Value(name);
|
|
static Insertable<WorkoutTemplate> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? name,
|
|
Expression<DateTime>? lastStartedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (name != null) 'name': name,
|
|
if (lastStartedAt != null) 'last_started_at': lastStartedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
WorkoutTemplatesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? name,
|
|
Value<DateTime?>? lastStartedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return WorkoutTemplatesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
name: name ?? this.name,
|
|
lastStartedAt: lastStartedAt ?? this.lastStartedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (lastStartedAt.present) {
|
|
map['last_started_at'] = Variable<DateTime>(lastStartedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplatesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('lastStartedAt: $lastStartedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ActiveWorkoutSessionsTable extends ActiveWorkoutSessions
|
|
with TableInfo<$ActiveWorkoutSessionsTable, ActiveWorkoutSession> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ActiveWorkoutSessionsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sourceWorkoutTemplateIdMeta =
|
|
const VerificationMeta('sourceWorkoutTemplateId');
|
|
@override
|
|
late final GeneratedColumn<String> sourceWorkoutTemplateId =
|
|
GeneratedColumn<String>(
|
|
'source_workout_template_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES workout_templates (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _pausedAtMeta = const VerificationMeta(
|
|
'pausedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> pausedAt = GeneratedColumn<DateTime>(
|
|
'paused_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _endedAtMeta = const VerificationMeta(
|
|
'endedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> endedAt = GeneratedColumn<DateTime>(
|
|
'ended_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastPersistedAtMeta = const VerificationMeta(
|
|
'lastPersistedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastPersistedAt =
|
|
GeneratedColumn<DateTime>(
|
|
'last_persisted_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _elapsedActiveMsMeta = const VerificationMeta(
|
|
'elapsedActiveMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> elapsedActiveMs = GeneratedColumn<int>(
|
|
'elapsed_active_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _currentProgramIndexMeta =
|
|
const VerificationMeta('currentProgramIndex');
|
|
@override
|
|
late final GeneratedColumn<int> currentProgramIndex = GeneratedColumn<int>(
|
|
'current_program_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _currentExerciseIndexMeta =
|
|
const VerificationMeta('currentExerciseIndex');
|
|
@override
|
|
late final GeneratedColumn<int> currentExerciseIndex = GeneratedColumn<int>(
|
|
'current_exercise_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _currentSetIndexMeta = const VerificationMeta(
|
|
'currentSetIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> currentSetIndex = GeneratedColumn<int>(
|
|
'current_set_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _resolvedTemplateSnapshotJsonMeta =
|
|
const VerificationMeta('resolvedTemplateSnapshotJson');
|
|
@override
|
|
late final GeneratedColumn<String> resolvedTemplateSnapshotJson =
|
|
GeneratedColumn<String>(
|
|
'resolved_template_snapshot_json',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
sourceWorkoutTemplateId,
|
|
status,
|
|
startedAt,
|
|
pausedAt,
|
|
endedAt,
|
|
lastPersistedAt,
|
|
elapsedActiveMs,
|
|
currentProgramIndex,
|
|
currentExerciseIndex,
|
|
currentSetIndex,
|
|
resolvedTemplateSnapshotJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'active_workout_sessions';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ActiveWorkoutSession> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('source_workout_template_id')) {
|
|
context.handle(
|
|
_sourceWorkoutTemplateIdMeta,
|
|
sourceWorkoutTemplateId.isAcceptableOrUnknown(
|
|
data['source_workout_template_id']!,
|
|
_sourceWorkoutTemplateIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_statusMeta);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('paused_at')) {
|
|
context.handle(
|
|
_pausedAtMeta,
|
|
pausedAt.isAcceptableOrUnknown(data['paused_at']!, _pausedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('ended_at')) {
|
|
context.handle(
|
|
_endedAtMeta,
|
|
endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('last_persisted_at')) {
|
|
context.handle(
|
|
_lastPersistedAtMeta,
|
|
lastPersistedAt.isAcceptableOrUnknown(
|
|
data['last_persisted_at']!,
|
|
_lastPersistedAtMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastPersistedAtMeta);
|
|
}
|
|
if (data.containsKey('elapsed_active_ms')) {
|
|
context.handle(
|
|
_elapsedActiveMsMeta,
|
|
elapsedActiveMs.isAcceptableOrUnknown(
|
|
data['elapsed_active_ms']!,
|
|
_elapsedActiveMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_elapsedActiveMsMeta);
|
|
}
|
|
if (data.containsKey('current_program_index')) {
|
|
context.handle(
|
|
_currentProgramIndexMeta,
|
|
currentProgramIndex.isAcceptableOrUnknown(
|
|
data['current_program_index']!,
|
|
_currentProgramIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_currentProgramIndexMeta);
|
|
}
|
|
if (data.containsKey('current_exercise_index')) {
|
|
context.handle(
|
|
_currentExerciseIndexMeta,
|
|
currentExerciseIndex.isAcceptableOrUnknown(
|
|
data['current_exercise_index']!,
|
|
_currentExerciseIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_currentExerciseIndexMeta);
|
|
}
|
|
if (data.containsKey('current_set_index')) {
|
|
context.handle(
|
|
_currentSetIndexMeta,
|
|
currentSetIndex.isAcceptableOrUnknown(
|
|
data['current_set_index']!,
|
|
_currentSetIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_currentSetIndexMeta);
|
|
}
|
|
if (data.containsKey('resolved_template_snapshot_json')) {
|
|
context.handle(
|
|
_resolvedTemplateSnapshotJsonMeta,
|
|
resolvedTemplateSnapshotJson.isAcceptableOrUnknown(
|
|
data['resolved_template_snapshot_json']!,
|
|
_resolvedTemplateSnapshotJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_resolvedTemplateSnapshotJsonMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActiveWorkoutSession map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActiveWorkoutSession(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
sourceWorkoutTemplateId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_workout_template_id'],
|
|
),
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
pausedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}paused_at'],
|
|
),
|
|
endedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}ended_at'],
|
|
),
|
|
lastPersistedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_persisted_at'],
|
|
)!,
|
|
elapsedActiveMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}elapsed_active_ms'],
|
|
)!,
|
|
currentProgramIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}current_program_index'],
|
|
)!,
|
|
currentExerciseIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}current_exercise_index'],
|
|
)!,
|
|
currentSetIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}current_set_index'],
|
|
)!,
|
|
resolvedTemplateSnapshotJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}resolved_template_snapshot_json'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ActiveWorkoutSessionsTable createAlias(String alias) {
|
|
return $ActiveWorkoutSessionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActiveWorkoutSession extends DataClass
|
|
implements Insertable<ActiveWorkoutSession> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String? sourceWorkoutTemplateId;
|
|
final String status;
|
|
final DateTime startedAt;
|
|
final DateTime? pausedAt;
|
|
final DateTime? endedAt;
|
|
final DateTime lastPersistedAt;
|
|
final int elapsedActiveMs;
|
|
final int currentProgramIndex;
|
|
final int currentExerciseIndex;
|
|
final int currentSetIndex;
|
|
final String resolvedTemplateSnapshotJson;
|
|
const ActiveWorkoutSession({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
this.sourceWorkoutTemplateId,
|
|
required this.status,
|
|
required this.startedAt,
|
|
this.pausedAt,
|
|
this.endedAt,
|
|
required this.lastPersistedAt,
|
|
required this.elapsedActiveMs,
|
|
required this.currentProgramIndex,
|
|
required this.currentExerciseIndex,
|
|
required this.currentSetIndex,
|
|
required this.resolvedTemplateSnapshotJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
if (!nullToAbsent || sourceWorkoutTemplateId != null) {
|
|
map['source_workout_template_id'] = Variable<String>(
|
|
sourceWorkoutTemplateId,
|
|
);
|
|
}
|
|
map['status'] = Variable<String>(status);
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
if (!nullToAbsent || pausedAt != null) {
|
|
map['paused_at'] = Variable<DateTime>(pausedAt);
|
|
}
|
|
if (!nullToAbsent || endedAt != null) {
|
|
map['ended_at'] = Variable<DateTime>(endedAt);
|
|
}
|
|
map['last_persisted_at'] = Variable<DateTime>(lastPersistedAt);
|
|
map['elapsed_active_ms'] = Variable<int>(elapsedActiveMs);
|
|
map['current_program_index'] = Variable<int>(currentProgramIndex);
|
|
map['current_exercise_index'] = Variable<int>(currentExerciseIndex);
|
|
map['current_set_index'] = Variable<int>(currentSetIndex);
|
|
map['resolved_template_snapshot_json'] = Variable<String>(
|
|
resolvedTemplateSnapshotJson,
|
|
);
|
|
return map;
|
|
}
|
|
|
|
ActiveWorkoutSessionsCompanion toCompanion(bool nullToAbsent) {
|
|
return ActiveWorkoutSessionsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceWorkoutTemplateId),
|
|
status: Value(status),
|
|
startedAt: Value(startedAt),
|
|
pausedAt: pausedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(pausedAt),
|
|
endedAt: endedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(endedAt),
|
|
lastPersistedAt: Value(lastPersistedAt),
|
|
elapsedActiveMs: Value(elapsedActiveMs),
|
|
currentProgramIndex: Value(currentProgramIndex),
|
|
currentExerciseIndex: Value(currentExerciseIndex),
|
|
currentSetIndex: Value(currentSetIndex),
|
|
resolvedTemplateSnapshotJson: Value(resolvedTemplateSnapshotJson),
|
|
);
|
|
}
|
|
|
|
factory ActiveWorkoutSession.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActiveWorkoutSession(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
sourceWorkoutTemplateId: serializer.fromJson<String?>(
|
|
json['sourceWorkoutTemplateId'],
|
|
),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
startedAt: serializer.fromJson<DateTime>(json['startedAt']),
|
|
pausedAt: serializer.fromJson<DateTime?>(json['pausedAt']),
|
|
endedAt: serializer.fromJson<DateTime?>(json['endedAt']),
|
|
lastPersistedAt: serializer.fromJson<DateTime>(json['lastPersistedAt']),
|
|
elapsedActiveMs: serializer.fromJson<int>(json['elapsedActiveMs']),
|
|
currentProgramIndex: serializer.fromJson<int>(
|
|
json['currentProgramIndex'],
|
|
),
|
|
currentExerciseIndex: serializer.fromJson<int>(
|
|
json['currentExerciseIndex'],
|
|
),
|
|
currentSetIndex: serializer.fromJson<int>(json['currentSetIndex']),
|
|
resolvedTemplateSnapshotJson: serializer.fromJson<String>(
|
|
json['resolvedTemplateSnapshotJson'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'sourceWorkoutTemplateId': serializer.toJson<String?>(
|
|
sourceWorkoutTemplateId,
|
|
),
|
|
'status': serializer.toJson<String>(status),
|
|
'startedAt': serializer.toJson<DateTime>(startedAt),
|
|
'pausedAt': serializer.toJson<DateTime?>(pausedAt),
|
|
'endedAt': serializer.toJson<DateTime?>(endedAt),
|
|
'lastPersistedAt': serializer.toJson<DateTime>(lastPersistedAt),
|
|
'elapsedActiveMs': serializer.toJson<int>(elapsedActiveMs),
|
|
'currentProgramIndex': serializer.toJson<int>(currentProgramIndex),
|
|
'currentExerciseIndex': serializer.toJson<int>(currentExerciseIndex),
|
|
'currentSetIndex': serializer.toJson<int>(currentSetIndex),
|
|
'resolvedTemplateSnapshotJson': serializer.toJson<String>(
|
|
resolvedTemplateSnapshotJson,
|
|
),
|
|
};
|
|
}
|
|
|
|
ActiveWorkoutSession copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
String? status,
|
|
DateTime? startedAt,
|
|
Value<DateTime?> pausedAt = const Value.absent(),
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
DateTime? lastPersistedAt,
|
|
int? elapsedActiveMs,
|
|
int? currentProgramIndex,
|
|
int? currentExerciseIndex,
|
|
int? currentSetIndex,
|
|
String? resolvedTemplateSnapshotJson,
|
|
}) => ActiveWorkoutSession(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId.present
|
|
? sourceWorkoutTemplateId.value
|
|
: this.sourceWorkoutTemplateId,
|
|
status: status ?? this.status,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
pausedAt: pausedAt.present ? pausedAt.value : this.pausedAt,
|
|
endedAt: endedAt.present ? endedAt.value : this.endedAt,
|
|
lastPersistedAt: lastPersistedAt ?? this.lastPersistedAt,
|
|
elapsedActiveMs: elapsedActiveMs ?? this.elapsedActiveMs,
|
|
currentProgramIndex: currentProgramIndex ?? this.currentProgramIndex,
|
|
currentExerciseIndex: currentExerciseIndex ?? this.currentExerciseIndex,
|
|
currentSetIndex: currentSetIndex ?? this.currentSetIndex,
|
|
resolvedTemplateSnapshotJson:
|
|
resolvedTemplateSnapshotJson ?? this.resolvedTemplateSnapshotJson,
|
|
);
|
|
ActiveWorkoutSession copyWithCompanion(ActiveWorkoutSessionsCompanion data) {
|
|
return ActiveWorkoutSession(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
sourceWorkoutTemplateId: data.sourceWorkoutTemplateId.present
|
|
? data.sourceWorkoutTemplateId.value
|
|
: this.sourceWorkoutTemplateId,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
pausedAt: data.pausedAt.present ? data.pausedAt.value : this.pausedAt,
|
|
endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt,
|
|
lastPersistedAt: data.lastPersistedAt.present
|
|
? data.lastPersistedAt.value
|
|
: this.lastPersistedAt,
|
|
elapsedActiveMs: data.elapsedActiveMs.present
|
|
? data.elapsedActiveMs.value
|
|
: this.elapsedActiveMs,
|
|
currentProgramIndex: data.currentProgramIndex.present
|
|
? data.currentProgramIndex.value
|
|
: this.currentProgramIndex,
|
|
currentExerciseIndex: data.currentExerciseIndex.present
|
|
? data.currentExerciseIndex.value
|
|
: this.currentExerciseIndex,
|
|
currentSetIndex: data.currentSetIndex.present
|
|
? data.currentSetIndex.value
|
|
: this.currentSetIndex,
|
|
resolvedTemplateSnapshotJson: data.resolvedTemplateSnapshotJson.present
|
|
? data.resolvedTemplateSnapshotJson.value
|
|
: this.resolvedTemplateSnapshotJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveWorkoutSession(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('sourceWorkoutTemplateId: $sourceWorkoutTemplateId, ')
|
|
..write('status: $status, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('pausedAt: $pausedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('lastPersistedAt: $lastPersistedAt, ')
|
|
..write('elapsedActiveMs: $elapsedActiveMs, ')
|
|
..write('currentProgramIndex: $currentProgramIndex, ')
|
|
..write('currentExerciseIndex: $currentExerciseIndex, ')
|
|
..write('currentSetIndex: $currentSetIndex, ')
|
|
..write('resolvedTemplateSnapshotJson: $resolvedTemplateSnapshotJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
sourceWorkoutTemplateId,
|
|
status,
|
|
startedAt,
|
|
pausedAt,
|
|
endedAt,
|
|
lastPersistedAt,
|
|
elapsedActiveMs,
|
|
currentProgramIndex,
|
|
currentExerciseIndex,
|
|
currentSetIndex,
|
|
resolvedTemplateSnapshotJson,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActiveWorkoutSession &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.sourceWorkoutTemplateId == this.sourceWorkoutTemplateId &&
|
|
other.status == this.status &&
|
|
other.startedAt == this.startedAt &&
|
|
other.pausedAt == this.pausedAt &&
|
|
other.endedAt == this.endedAt &&
|
|
other.lastPersistedAt == this.lastPersistedAt &&
|
|
other.elapsedActiveMs == this.elapsedActiveMs &&
|
|
other.currentProgramIndex == this.currentProgramIndex &&
|
|
other.currentExerciseIndex == this.currentExerciseIndex &&
|
|
other.currentSetIndex == this.currentSetIndex &&
|
|
other.resolvedTemplateSnapshotJson ==
|
|
this.resolvedTemplateSnapshotJson);
|
|
}
|
|
|
|
class ActiveWorkoutSessionsCompanion
|
|
extends UpdateCompanion<ActiveWorkoutSession> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String?> sourceWorkoutTemplateId;
|
|
final Value<String> status;
|
|
final Value<DateTime> startedAt;
|
|
final Value<DateTime?> pausedAt;
|
|
final Value<DateTime?> endedAt;
|
|
final Value<DateTime> lastPersistedAt;
|
|
final Value<int> elapsedActiveMs;
|
|
final Value<int> currentProgramIndex;
|
|
final Value<int> currentExerciseIndex;
|
|
final Value<int> currentSetIndex;
|
|
final Value<String> resolvedTemplateSnapshotJson;
|
|
final Value<int> rowid;
|
|
const ActiveWorkoutSessionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.sourceWorkoutTemplateId = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.pausedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
this.lastPersistedAt = const Value.absent(),
|
|
this.elapsedActiveMs = const Value.absent(),
|
|
this.currentProgramIndex = const Value.absent(),
|
|
this.currentExerciseIndex = const Value.absent(),
|
|
this.currentSetIndex = const Value.absent(),
|
|
this.resolvedTemplateSnapshotJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ActiveWorkoutSessionsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.sourceWorkoutTemplateId = const Value.absent(),
|
|
required String status,
|
|
required DateTime startedAt,
|
|
this.pausedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
required DateTime lastPersistedAt,
|
|
required int elapsedActiveMs,
|
|
required int currentProgramIndex,
|
|
required int currentExerciseIndex,
|
|
required int currentSetIndex,
|
|
required String resolvedTemplateSnapshotJson,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
status = Value(status),
|
|
startedAt = Value(startedAt),
|
|
lastPersistedAt = Value(lastPersistedAt),
|
|
elapsedActiveMs = Value(elapsedActiveMs),
|
|
currentProgramIndex = Value(currentProgramIndex),
|
|
currentExerciseIndex = Value(currentExerciseIndex),
|
|
currentSetIndex = Value(currentSetIndex),
|
|
resolvedTemplateSnapshotJson = Value(resolvedTemplateSnapshotJson);
|
|
static Insertable<ActiveWorkoutSession> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? sourceWorkoutTemplateId,
|
|
Expression<String>? status,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<DateTime>? pausedAt,
|
|
Expression<DateTime>? endedAt,
|
|
Expression<DateTime>? lastPersistedAt,
|
|
Expression<int>? elapsedActiveMs,
|
|
Expression<int>? currentProgramIndex,
|
|
Expression<int>? currentExerciseIndex,
|
|
Expression<int>? currentSetIndex,
|
|
Expression<String>? resolvedTemplateSnapshotJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (sourceWorkoutTemplateId != null)
|
|
'source_workout_template_id': sourceWorkoutTemplateId,
|
|
if (status != null) 'status': status,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (pausedAt != null) 'paused_at': pausedAt,
|
|
if (endedAt != null) 'ended_at': endedAt,
|
|
if (lastPersistedAt != null) 'last_persisted_at': lastPersistedAt,
|
|
if (elapsedActiveMs != null) 'elapsed_active_ms': elapsedActiveMs,
|
|
if (currentProgramIndex != null)
|
|
'current_program_index': currentProgramIndex,
|
|
if (currentExerciseIndex != null)
|
|
'current_exercise_index': currentExerciseIndex,
|
|
if (currentSetIndex != null) 'current_set_index': currentSetIndex,
|
|
if (resolvedTemplateSnapshotJson != null)
|
|
'resolved_template_snapshot_json': resolvedTemplateSnapshotJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ActiveWorkoutSessionsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String?>? sourceWorkoutTemplateId,
|
|
Value<String>? status,
|
|
Value<DateTime>? startedAt,
|
|
Value<DateTime?>? pausedAt,
|
|
Value<DateTime?>? endedAt,
|
|
Value<DateTime>? lastPersistedAt,
|
|
Value<int>? elapsedActiveMs,
|
|
Value<int>? currentProgramIndex,
|
|
Value<int>? currentExerciseIndex,
|
|
Value<int>? currentSetIndex,
|
|
Value<String>? resolvedTemplateSnapshotJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ActiveWorkoutSessionsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
sourceWorkoutTemplateId:
|
|
sourceWorkoutTemplateId ?? this.sourceWorkoutTemplateId,
|
|
status: status ?? this.status,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
pausedAt: pausedAt ?? this.pausedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
lastPersistedAt: lastPersistedAt ?? this.lastPersistedAt,
|
|
elapsedActiveMs: elapsedActiveMs ?? this.elapsedActiveMs,
|
|
currentProgramIndex: currentProgramIndex ?? this.currentProgramIndex,
|
|
currentExerciseIndex: currentExerciseIndex ?? this.currentExerciseIndex,
|
|
currentSetIndex: currentSetIndex ?? this.currentSetIndex,
|
|
resolvedTemplateSnapshotJson:
|
|
resolvedTemplateSnapshotJson ?? this.resolvedTemplateSnapshotJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (sourceWorkoutTemplateId.present) {
|
|
map['source_workout_template_id'] = Variable<String>(
|
|
sourceWorkoutTemplateId.value,
|
|
);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (pausedAt.present) {
|
|
map['paused_at'] = Variable<DateTime>(pausedAt.value);
|
|
}
|
|
if (endedAt.present) {
|
|
map['ended_at'] = Variable<DateTime>(endedAt.value);
|
|
}
|
|
if (lastPersistedAt.present) {
|
|
map['last_persisted_at'] = Variable<DateTime>(lastPersistedAt.value);
|
|
}
|
|
if (elapsedActiveMs.present) {
|
|
map['elapsed_active_ms'] = Variable<int>(elapsedActiveMs.value);
|
|
}
|
|
if (currentProgramIndex.present) {
|
|
map['current_program_index'] = Variable<int>(currentProgramIndex.value);
|
|
}
|
|
if (currentExerciseIndex.present) {
|
|
map['current_exercise_index'] = Variable<int>(currentExerciseIndex.value);
|
|
}
|
|
if (currentSetIndex.present) {
|
|
map['current_set_index'] = Variable<int>(currentSetIndex.value);
|
|
}
|
|
if (resolvedTemplateSnapshotJson.present) {
|
|
map['resolved_template_snapshot_json'] = Variable<String>(
|
|
resolvedTemplateSnapshotJson.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveWorkoutSessionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('sourceWorkoutTemplateId: $sourceWorkoutTemplateId, ')
|
|
..write('status: $status, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('pausedAt: $pausedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('lastPersistedAt: $lastPersistedAt, ')
|
|
..write('elapsedActiveMs: $elapsedActiveMs, ')
|
|
..write('currentProgramIndex: $currentProgramIndex, ')
|
|
..write('currentExerciseIndex: $currentExerciseIndex, ')
|
|
..write('currentSetIndex: $currentSetIndex, ')
|
|
..write(
|
|
'resolvedTemplateSnapshotJson: $resolvedTemplateSnapshotJson, ',
|
|
)
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ActiveRestStatesTable extends ActiveRestStates
|
|
with TableInfo<$ActiveRestStatesTable, ActiveRestState> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ActiveRestStatesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _activeWorkoutSessionIdMeta =
|
|
const VerificationMeta('activeWorkoutSessionId');
|
|
@override
|
|
late final GeneratedColumn<String> activeWorkoutSessionId =
|
|
GeneratedColumn<String>(
|
|
'active_workout_session_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES active_workout_sessions (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _afterProgramIndexMeta = const VerificationMeta(
|
|
'afterProgramIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> afterProgramIndex = GeneratedColumn<int>(
|
|
'after_program_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _afterExerciseIndexMeta =
|
|
const VerificationMeta('afterExerciseIndex');
|
|
@override
|
|
late final GeneratedColumn<int> afterExerciseIndex = GeneratedColumn<int>(
|
|
'after_exercise_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _afterSetIndexMeta = const VerificationMeta(
|
|
'afterSetIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> afterSetIndex = GeneratedColumn<int>(
|
|
'after_set_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _plannedRestSecondsMeta =
|
|
const VerificationMeta('plannedRestSeconds');
|
|
@override
|
|
late final GeneratedColumn<int> plannedRestSeconds = GeneratedColumn<int>(
|
|
'planned_rest_seconds',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _adjustedRestSecondsMeta =
|
|
const VerificationMeta('adjustedRestSeconds');
|
|
@override
|
|
late final GeneratedColumn<int> adjustedRestSeconds = GeneratedColumn<int>(
|
|
'adjusted_rest_seconds',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _endedAtMeta = const VerificationMeta(
|
|
'endedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> endedAt = GeneratedColumn<DateTime>(
|
|
'ended_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _skippedAtMeta = const VerificationMeta(
|
|
'skippedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> skippedAt = GeneratedColumn<DateTime>(
|
|
'skipped_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
afterProgramIndex,
|
|
afterExerciseIndex,
|
|
afterSetIndex,
|
|
plannedRestSeconds,
|
|
adjustedRestSeconds,
|
|
startedAt,
|
|
endedAt,
|
|
skippedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'active_rest_states';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ActiveRestState> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('active_workout_session_id')) {
|
|
context.handle(
|
|
_activeWorkoutSessionIdMeta,
|
|
activeWorkoutSessionId.isAcceptableOrUnknown(
|
|
data['active_workout_session_id']!,
|
|
_activeWorkoutSessionIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_activeWorkoutSessionIdMeta);
|
|
}
|
|
if (data.containsKey('after_program_index')) {
|
|
context.handle(
|
|
_afterProgramIndexMeta,
|
|
afterProgramIndex.isAcceptableOrUnknown(
|
|
data['after_program_index']!,
|
|
_afterProgramIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_afterProgramIndexMeta);
|
|
}
|
|
if (data.containsKey('after_exercise_index')) {
|
|
context.handle(
|
|
_afterExerciseIndexMeta,
|
|
afterExerciseIndex.isAcceptableOrUnknown(
|
|
data['after_exercise_index']!,
|
|
_afterExerciseIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_afterExerciseIndexMeta);
|
|
}
|
|
if (data.containsKey('after_set_index')) {
|
|
context.handle(
|
|
_afterSetIndexMeta,
|
|
afterSetIndex.isAcceptableOrUnknown(
|
|
data['after_set_index']!,
|
|
_afterSetIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_afterSetIndexMeta);
|
|
}
|
|
if (data.containsKey('planned_rest_seconds')) {
|
|
context.handle(
|
|
_plannedRestSecondsMeta,
|
|
plannedRestSeconds.isAcceptableOrUnknown(
|
|
data['planned_rest_seconds']!,
|
|
_plannedRestSecondsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_plannedRestSecondsMeta);
|
|
}
|
|
if (data.containsKey('adjusted_rest_seconds')) {
|
|
context.handle(
|
|
_adjustedRestSecondsMeta,
|
|
adjustedRestSeconds.isAcceptableOrUnknown(
|
|
data['adjusted_rest_seconds']!,
|
|
_adjustedRestSecondsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_adjustedRestSecondsMeta);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('ended_at')) {
|
|
context.handle(
|
|
_endedAtMeta,
|
|
endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('skipped_at')) {
|
|
context.handle(
|
|
_skippedAtMeta,
|
|
skippedAt.isAcceptableOrUnknown(data['skipped_at']!, _skippedAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActiveRestState map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActiveRestState(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
activeWorkoutSessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}active_workout_session_id'],
|
|
)!,
|
|
afterProgramIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}after_program_index'],
|
|
)!,
|
|
afterExerciseIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}after_exercise_index'],
|
|
)!,
|
|
afterSetIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}after_set_index'],
|
|
)!,
|
|
plannedRestSeconds: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}planned_rest_seconds'],
|
|
)!,
|
|
adjustedRestSeconds: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}adjusted_rest_seconds'],
|
|
)!,
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
endedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}ended_at'],
|
|
),
|
|
skippedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}skipped_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ActiveRestStatesTable createAlias(String alias) {
|
|
return $ActiveRestStatesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActiveRestState extends DataClass implements Insertable<ActiveRestState> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String activeWorkoutSessionId;
|
|
final int afterProgramIndex;
|
|
final int afterExerciseIndex;
|
|
final int afterSetIndex;
|
|
final int plannedRestSeconds;
|
|
final int adjustedRestSeconds;
|
|
final DateTime startedAt;
|
|
final DateTime? endedAt;
|
|
final DateTime? skippedAt;
|
|
const ActiveRestState({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.activeWorkoutSessionId,
|
|
required this.afterProgramIndex,
|
|
required this.afterExerciseIndex,
|
|
required this.afterSetIndex,
|
|
required this.plannedRestSeconds,
|
|
required this.adjustedRestSeconds,
|
|
required this.startedAt,
|
|
this.endedAt,
|
|
this.skippedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['active_workout_session_id'] = Variable<String>(activeWorkoutSessionId);
|
|
map['after_program_index'] = Variable<int>(afterProgramIndex);
|
|
map['after_exercise_index'] = Variable<int>(afterExerciseIndex);
|
|
map['after_set_index'] = Variable<int>(afterSetIndex);
|
|
map['planned_rest_seconds'] = Variable<int>(plannedRestSeconds);
|
|
map['adjusted_rest_seconds'] = Variable<int>(adjustedRestSeconds);
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
if (!nullToAbsent || endedAt != null) {
|
|
map['ended_at'] = Variable<DateTime>(endedAt);
|
|
}
|
|
if (!nullToAbsent || skippedAt != null) {
|
|
map['skipped_at'] = Variable<DateTime>(skippedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ActiveRestStatesCompanion toCompanion(bool nullToAbsent) {
|
|
return ActiveRestStatesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
activeWorkoutSessionId: Value(activeWorkoutSessionId),
|
|
afterProgramIndex: Value(afterProgramIndex),
|
|
afterExerciseIndex: Value(afterExerciseIndex),
|
|
afterSetIndex: Value(afterSetIndex),
|
|
plannedRestSeconds: Value(plannedRestSeconds),
|
|
adjustedRestSeconds: Value(adjustedRestSeconds),
|
|
startedAt: Value(startedAt),
|
|
endedAt: endedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(endedAt),
|
|
skippedAt: skippedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(skippedAt),
|
|
);
|
|
}
|
|
|
|
factory ActiveRestState.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActiveRestState(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
activeWorkoutSessionId: serializer.fromJson<String>(
|
|
json['activeWorkoutSessionId'],
|
|
),
|
|
afterProgramIndex: serializer.fromJson<int>(json['afterProgramIndex']),
|
|
afterExerciseIndex: serializer.fromJson<int>(json['afterExerciseIndex']),
|
|
afterSetIndex: serializer.fromJson<int>(json['afterSetIndex']),
|
|
plannedRestSeconds: serializer.fromJson<int>(json['plannedRestSeconds']),
|
|
adjustedRestSeconds: serializer.fromJson<int>(
|
|
json['adjustedRestSeconds'],
|
|
),
|
|
startedAt: serializer.fromJson<DateTime>(json['startedAt']),
|
|
endedAt: serializer.fromJson<DateTime?>(json['endedAt']),
|
|
skippedAt: serializer.fromJson<DateTime?>(json['skippedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'activeWorkoutSessionId': serializer.toJson<String>(
|
|
activeWorkoutSessionId,
|
|
),
|
|
'afterProgramIndex': serializer.toJson<int>(afterProgramIndex),
|
|
'afterExerciseIndex': serializer.toJson<int>(afterExerciseIndex),
|
|
'afterSetIndex': serializer.toJson<int>(afterSetIndex),
|
|
'plannedRestSeconds': serializer.toJson<int>(plannedRestSeconds),
|
|
'adjustedRestSeconds': serializer.toJson<int>(adjustedRestSeconds),
|
|
'startedAt': serializer.toJson<DateTime>(startedAt),
|
|
'endedAt': serializer.toJson<DateTime?>(endedAt),
|
|
'skippedAt': serializer.toJson<DateTime?>(skippedAt),
|
|
};
|
|
}
|
|
|
|
ActiveRestState copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? activeWorkoutSessionId,
|
|
int? afterProgramIndex,
|
|
int? afterExerciseIndex,
|
|
int? afterSetIndex,
|
|
int? plannedRestSeconds,
|
|
int? adjustedRestSeconds,
|
|
DateTime? startedAt,
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
Value<DateTime?> skippedAt = const Value.absent(),
|
|
}) => ActiveRestState(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
afterProgramIndex: afterProgramIndex ?? this.afterProgramIndex,
|
|
afterExerciseIndex: afterExerciseIndex ?? this.afterExerciseIndex,
|
|
afterSetIndex: afterSetIndex ?? this.afterSetIndex,
|
|
plannedRestSeconds: plannedRestSeconds ?? this.plannedRestSeconds,
|
|
adjustedRestSeconds: adjustedRestSeconds ?? this.adjustedRestSeconds,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt.present ? endedAt.value : this.endedAt,
|
|
skippedAt: skippedAt.present ? skippedAt.value : this.skippedAt,
|
|
);
|
|
ActiveRestState copyWithCompanion(ActiveRestStatesCompanion data) {
|
|
return ActiveRestState(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId: data.activeWorkoutSessionId.present
|
|
? data.activeWorkoutSessionId.value
|
|
: this.activeWorkoutSessionId,
|
|
afterProgramIndex: data.afterProgramIndex.present
|
|
? data.afterProgramIndex.value
|
|
: this.afterProgramIndex,
|
|
afterExerciseIndex: data.afterExerciseIndex.present
|
|
? data.afterExerciseIndex.value
|
|
: this.afterExerciseIndex,
|
|
afterSetIndex: data.afterSetIndex.present
|
|
? data.afterSetIndex.value
|
|
: this.afterSetIndex,
|
|
plannedRestSeconds: data.plannedRestSeconds.present
|
|
? data.plannedRestSeconds.value
|
|
: this.plannedRestSeconds,
|
|
adjustedRestSeconds: data.adjustedRestSeconds.present
|
|
? data.adjustedRestSeconds.value
|
|
: this.adjustedRestSeconds,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt,
|
|
skippedAt: data.skippedAt.present ? data.skippedAt.value : this.skippedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveRestState(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('afterProgramIndex: $afterProgramIndex, ')
|
|
..write('afterExerciseIndex: $afterExerciseIndex, ')
|
|
..write('afterSetIndex: $afterSetIndex, ')
|
|
..write('plannedRestSeconds: $plannedRestSeconds, ')
|
|
..write('adjustedRestSeconds: $adjustedRestSeconds, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('skippedAt: $skippedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
afterProgramIndex,
|
|
afterExerciseIndex,
|
|
afterSetIndex,
|
|
plannedRestSeconds,
|
|
adjustedRestSeconds,
|
|
startedAt,
|
|
endedAt,
|
|
skippedAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActiveRestState &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.activeWorkoutSessionId == this.activeWorkoutSessionId &&
|
|
other.afterProgramIndex == this.afterProgramIndex &&
|
|
other.afterExerciseIndex == this.afterExerciseIndex &&
|
|
other.afterSetIndex == this.afterSetIndex &&
|
|
other.plannedRestSeconds == this.plannedRestSeconds &&
|
|
other.adjustedRestSeconds == this.adjustedRestSeconds &&
|
|
other.startedAt == this.startedAt &&
|
|
other.endedAt == this.endedAt &&
|
|
other.skippedAt == this.skippedAt);
|
|
}
|
|
|
|
class ActiveRestStatesCompanion extends UpdateCompanion<ActiveRestState> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> activeWorkoutSessionId;
|
|
final Value<int> afterProgramIndex;
|
|
final Value<int> afterExerciseIndex;
|
|
final Value<int> afterSetIndex;
|
|
final Value<int> plannedRestSeconds;
|
|
final Value<int> adjustedRestSeconds;
|
|
final Value<DateTime> startedAt;
|
|
final Value<DateTime?> endedAt;
|
|
final Value<DateTime?> skippedAt;
|
|
final Value<int> rowid;
|
|
const ActiveRestStatesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.activeWorkoutSessionId = const Value.absent(),
|
|
this.afterProgramIndex = const Value.absent(),
|
|
this.afterExerciseIndex = const Value.absent(),
|
|
this.afterSetIndex = const Value.absent(),
|
|
this.plannedRestSeconds = const Value.absent(),
|
|
this.adjustedRestSeconds = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
this.skippedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ActiveRestStatesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required int afterProgramIndex,
|
|
required int afterExerciseIndex,
|
|
required int afterSetIndex,
|
|
required int plannedRestSeconds,
|
|
required int adjustedRestSeconds,
|
|
required DateTime startedAt,
|
|
this.endedAt = const Value.absent(),
|
|
this.skippedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
activeWorkoutSessionId = Value(activeWorkoutSessionId),
|
|
afterProgramIndex = Value(afterProgramIndex),
|
|
afterExerciseIndex = Value(afterExerciseIndex),
|
|
afterSetIndex = Value(afterSetIndex),
|
|
plannedRestSeconds = Value(plannedRestSeconds),
|
|
adjustedRestSeconds = Value(adjustedRestSeconds),
|
|
startedAt = Value(startedAt);
|
|
static Insertable<ActiveRestState> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? activeWorkoutSessionId,
|
|
Expression<int>? afterProgramIndex,
|
|
Expression<int>? afterExerciseIndex,
|
|
Expression<int>? afterSetIndex,
|
|
Expression<int>? plannedRestSeconds,
|
|
Expression<int>? adjustedRestSeconds,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<DateTime>? endedAt,
|
|
Expression<DateTime>? skippedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (activeWorkoutSessionId != null)
|
|
'active_workout_session_id': activeWorkoutSessionId,
|
|
if (afterProgramIndex != null) 'after_program_index': afterProgramIndex,
|
|
if (afterExerciseIndex != null)
|
|
'after_exercise_index': afterExerciseIndex,
|
|
if (afterSetIndex != null) 'after_set_index': afterSetIndex,
|
|
if (plannedRestSeconds != null)
|
|
'planned_rest_seconds': plannedRestSeconds,
|
|
if (adjustedRestSeconds != null)
|
|
'adjusted_rest_seconds': adjustedRestSeconds,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (endedAt != null) 'ended_at': endedAt,
|
|
if (skippedAt != null) 'skipped_at': skippedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ActiveRestStatesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? activeWorkoutSessionId,
|
|
Value<int>? afterProgramIndex,
|
|
Value<int>? afterExerciseIndex,
|
|
Value<int>? afterSetIndex,
|
|
Value<int>? plannedRestSeconds,
|
|
Value<int>? adjustedRestSeconds,
|
|
Value<DateTime>? startedAt,
|
|
Value<DateTime?>? endedAt,
|
|
Value<DateTime?>? skippedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ActiveRestStatesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
afterProgramIndex: afterProgramIndex ?? this.afterProgramIndex,
|
|
afterExerciseIndex: afterExerciseIndex ?? this.afterExerciseIndex,
|
|
afterSetIndex: afterSetIndex ?? this.afterSetIndex,
|
|
plannedRestSeconds: plannedRestSeconds ?? this.plannedRestSeconds,
|
|
adjustedRestSeconds: adjustedRestSeconds ?? this.adjustedRestSeconds,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
skippedAt: skippedAt ?? this.skippedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (activeWorkoutSessionId.present) {
|
|
map['active_workout_session_id'] = Variable<String>(
|
|
activeWorkoutSessionId.value,
|
|
);
|
|
}
|
|
if (afterProgramIndex.present) {
|
|
map['after_program_index'] = Variable<int>(afterProgramIndex.value);
|
|
}
|
|
if (afterExerciseIndex.present) {
|
|
map['after_exercise_index'] = Variable<int>(afterExerciseIndex.value);
|
|
}
|
|
if (afterSetIndex.present) {
|
|
map['after_set_index'] = Variable<int>(afterSetIndex.value);
|
|
}
|
|
if (plannedRestSeconds.present) {
|
|
map['planned_rest_seconds'] = Variable<int>(plannedRestSeconds.value);
|
|
}
|
|
if (adjustedRestSeconds.present) {
|
|
map['adjusted_rest_seconds'] = Variable<int>(adjustedRestSeconds.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (endedAt.present) {
|
|
map['ended_at'] = Variable<DateTime>(endedAt.value);
|
|
}
|
|
if (skippedAt.present) {
|
|
map['skipped_at'] = Variable<DateTime>(skippedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveRestStatesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('afterProgramIndex: $afterProgramIndex, ')
|
|
..write('afterExerciseIndex: $afterExerciseIndex, ')
|
|
..write('afterSetIndex: $afterSetIndex, ')
|
|
..write('plannedRestSeconds: $plannedRestSeconds, ')
|
|
..write('adjustedRestSeconds: $adjustedRestSeconds, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('skippedAt: $skippedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ActiveScoreStopwatchStatesTable extends ActiveScoreStopwatchStates
|
|
with
|
|
TableInfo<$ActiveScoreStopwatchStatesTable, ActiveScoreStopwatchState> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ActiveScoreStopwatchStatesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _activeWorkoutSessionIdMeta =
|
|
const VerificationMeta('activeWorkoutSessionId');
|
|
@override
|
|
late final GeneratedColumn<String> activeWorkoutSessionId =
|
|
GeneratedColumn<String>(
|
|
'active_workout_session_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES active_workout_sessions (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _programIndexMeta = const VerificationMeta(
|
|
'programIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> programIndex = GeneratedColumn<int>(
|
|
'program_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseIndexMeta = const VerificationMeta(
|
|
'exerciseIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> exerciseIndex = GeneratedColumn<int>(
|
|
'exercise_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _setIndexMeta = const VerificationMeta(
|
|
'setIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> setIndex = GeneratedColumn<int>(
|
|
'set_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _accumulatedMsMeta = const VerificationMeta(
|
|
'accumulatedMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> accumulatedMs = GeneratedColumn<int>(
|
|
'accumulated_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _stoppedAtMeta = const VerificationMeta(
|
|
'stoppedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> stoppedAt = GeneratedColumn<DateTime>(
|
|
'stopped_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
status,
|
|
startedAt,
|
|
accumulatedMs,
|
|
stoppedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'active_score_stopwatch_states';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ActiveScoreStopwatchState> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('active_workout_session_id')) {
|
|
context.handle(
|
|
_activeWorkoutSessionIdMeta,
|
|
activeWorkoutSessionId.isAcceptableOrUnknown(
|
|
data['active_workout_session_id']!,
|
|
_activeWorkoutSessionIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_activeWorkoutSessionIdMeta);
|
|
}
|
|
if (data.containsKey('program_index')) {
|
|
context.handle(
|
|
_programIndexMeta,
|
|
programIndex.isAcceptableOrUnknown(
|
|
data['program_index']!,
|
|
_programIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIndexMeta);
|
|
}
|
|
if (data.containsKey('exercise_index')) {
|
|
context.handle(
|
|
_exerciseIndexMeta,
|
|
exerciseIndex.isAcceptableOrUnknown(
|
|
data['exercise_index']!,
|
|
_exerciseIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseIndexMeta);
|
|
}
|
|
if (data.containsKey('set_index')) {
|
|
context.handle(
|
|
_setIndexMeta,
|
|
setIndex.isAcceptableOrUnknown(data['set_index']!, _setIndexMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_setIndexMeta);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_statusMeta);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('accumulated_ms')) {
|
|
context.handle(
|
|
_accumulatedMsMeta,
|
|
accumulatedMs.isAcceptableOrUnknown(
|
|
data['accumulated_ms']!,
|
|
_accumulatedMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_accumulatedMsMeta);
|
|
}
|
|
if (data.containsKey('stopped_at')) {
|
|
context.handle(
|
|
_stoppedAtMeta,
|
|
stoppedAt.isAcceptableOrUnknown(data['stopped_at']!, _stoppedAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActiveScoreStopwatchState map(
|
|
Map<String, dynamic> data, {
|
|
String? tablePrefix,
|
|
}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActiveScoreStopwatchState(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
activeWorkoutSessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}active_workout_session_id'],
|
|
)!,
|
|
programIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}program_index'],
|
|
)!,
|
|
exerciseIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}exercise_index'],
|
|
)!,
|
|
setIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}set_index'],
|
|
)!,
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
accumulatedMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}accumulated_ms'],
|
|
)!,
|
|
stoppedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}stopped_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ActiveScoreStopwatchStatesTable createAlias(String alias) {
|
|
return $ActiveScoreStopwatchStatesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActiveScoreStopwatchState extends DataClass
|
|
implements Insertable<ActiveScoreStopwatchState> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String activeWorkoutSessionId;
|
|
final int programIndex;
|
|
final int exerciseIndex;
|
|
final int setIndex;
|
|
final String status;
|
|
final DateTime startedAt;
|
|
final int accumulatedMs;
|
|
final DateTime? stoppedAt;
|
|
const ActiveScoreStopwatchState({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.activeWorkoutSessionId,
|
|
required this.programIndex,
|
|
required this.exerciseIndex,
|
|
required this.setIndex,
|
|
required this.status,
|
|
required this.startedAt,
|
|
required this.accumulatedMs,
|
|
this.stoppedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['active_workout_session_id'] = Variable<String>(activeWorkoutSessionId);
|
|
map['program_index'] = Variable<int>(programIndex);
|
|
map['exercise_index'] = Variable<int>(exerciseIndex);
|
|
map['set_index'] = Variable<int>(setIndex);
|
|
map['status'] = Variable<String>(status);
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
map['accumulated_ms'] = Variable<int>(accumulatedMs);
|
|
if (!nullToAbsent || stoppedAt != null) {
|
|
map['stopped_at'] = Variable<DateTime>(stoppedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ActiveScoreStopwatchStatesCompanion toCompanion(bool nullToAbsent) {
|
|
return ActiveScoreStopwatchStatesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
activeWorkoutSessionId: Value(activeWorkoutSessionId),
|
|
programIndex: Value(programIndex),
|
|
exerciseIndex: Value(exerciseIndex),
|
|
setIndex: Value(setIndex),
|
|
status: Value(status),
|
|
startedAt: Value(startedAt),
|
|
accumulatedMs: Value(accumulatedMs),
|
|
stoppedAt: stoppedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(stoppedAt),
|
|
);
|
|
}
|
|
|
|
factory ActiveScoreStopwatchState.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActiveScoreStopwatchState(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
activeWorkoutSessionId: serializer.fromJson<String>(
|
|
json['activeWorkoutSessionId'],
|
|
),
|
|
programIndex: serializer.fromJson<int>(json['programIndex']),
|
|
exerciseIndex: serializer.fromJson<int>(json['exerciseIndex']),
|
|
setIndex: serializer.fromJson<int>(json['setIndex']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
startedAt: serializer.fromJson<DateTime>(json['startedAt']),
|
|
accumulatedMs: serializer.fromJson<int>(json['accumulatedMs']),
|
|
stoppedAt: serializer.fromJson<DateTime?>(json['stoppedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'activeWorkoutSessionId': serializer.toJson<String>(
|
|
activeWorkoutSessionId,
|
|
),
|
|
'programIndex': serializer.toJson<int>(programIndex),
|
|
'exerciseIndex': serializer.toJson<int>(exerciseIndex),
|
|
'setIndex': serializer.toJson<int>(setIndex),
|
|
'status': serializer.toJson<String>(status),
|
|
'startedAt': serializer.toJson<DateTime>(startedAt),
|
|
'accumulatedMs': serializer.toJson<int>(accumulatedMs),
|
|
'stoppedAt': serializer.toJson<DateTime?>(stoppedAt),
|
|
};
|
|
}
|
|
|
|
ActiveScoreStopwatchState copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? activeWorkoutSessionId,
|
|
int? programIndex,
|
|
int? exerciseIndex,
|
|
int? setIndex,
|
|
String? status,
|
|
DateTime? startedAt,
|
|
int? accumulatedMs,
|
|
Value<DateTime?> stoppedAt = const Value.absent(),
|
|
}) => ActiveScoreStopwatchState(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
status: status ?? this.status,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
accumulatedMs: accumulatedMs ?? this.accumulatedMs,
|
|
stoppedAt: stoppedAt.present ? stoppedAt.value : this.stoppedAt,
|
|
);
|
|
ActiveScoreStopwatchState copyWithCompanion(
|
|
ActiveScoreStopwatchStatesCompanion data,
|
|
) {
|
|
return ActiveScoreStopwatchState(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId: data.activeWorkoutSessionId.present
|
|
? data.activeWorkoutSessionId.value
|
|
: this.activeWorkoutSessionId,
|
|
programIndex: data.programIndex.present
|
|
? data.programIndex.value
|
|
: this.programIndex,
|
|
exerciseIndex: data.exerciseIndex.present
|
|
? data.exerciseIndex.value
|
|
: this.exerciseIndex,
|
|
setIndex: data.setIndex.present ? data.setIndex.value : this.setIndex,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
accumulatedMs: data.accumulatedMs.present
|
|
? data.accumulatedMs.value
|
|
: this.accumulatedMs,
|
|
stoppedAt: data.stoppedAt.present ? data.stoppedAt.value : this.stoppedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveScoreStopwatchState(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('status: $status, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('accumulatedMs: $accumulatedMs, ')
|
|
..write('stoppedAt: $stoppedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
status,
|
|
startedAt,
|
|
accumulatedMs,
|
|
stoppedAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActiveScoreStopwatchState &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.activeWorkoutSessionId == this.activeWorkoutSessionId &&
|
|
other.programIndex == this.programIndex &&
|
|
other.exerciseIndex == this.exerciseIndex &&
|
|
other.setIndex == this.setIndex &&
|
|
other.status == this.status &&
|
|
other.startedAt == this.startedAt &&
|
|
other.accumulatedMs == this.accumulatedMs &&
|
|
other.stoppedAt == this.stoppedAt);
|
|
}
|
|
|
|
class ActiveScoreStopwatchStatesCompanion
|
|
extends UpdateCompanion<ActiveScoreStopwatchState> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> activeWorkoutSessionId;
|
|
final Value<int> programIndex;
|
|
final Value<int> exerciseIndex;
|
|
final Value<int> setIndex;
|
|
final Value<String> status;
|
|
final Value<DateTime> startedAt;
|
|
final Value<int> accumulatedMs;
|
|
final Value<DateTime?> stoppedAt;
|
|
final Value<int> rowid;
|
|
const ActiveScoreStopwatchStatesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.activeWorkoutSessionId = const Value.absent(),
|
|
this.programIndex = const Value.absent(),
|
|
this.exerciseIndex = const Value.absent(),
|
|
this.setIndex = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.accumulatedMs = const Value.absent(),
|
|
this.stoppedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ActiveScoreStopwatchStatesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String status,
|
|
required DateTime startedAt,
|
|
required int accumulatedMs,
|
|
this.stoppedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
activeWorkoutSessionId = Value(activeWorkoutSessionId),
|
|
programIndex = Value(programIndex),
|
|
exerciseIndex = Value(exerciseIndex),
|
|
setIndex = Value(setIndex),
|
|
status = Value(status),
|
|
startedAt = Value(startedAt),
|
|
accumulatedMs = Value(accumulatedMs);
|
|
static Insertable<ActiveScoreStopwatchState> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? activeWorkoutSessionId,
|
|
Expression<int>? programIndex,
|
|
Expression<int>? exerciseIndex,
|
|
Expression<int>? setIndex,
|
|
Expression<String>? status,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<int>? accumulatedMs,
|
|
Expression<DateTime>? stoppedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (activeWorkoutSessionId != null)
|
|
'active_workout_session_id': activeWorkoutSessionId,
|
|
if (programIndex != null) 'program_index': programIndex,
|
|
if (exerciseIndex != null) 'exercise_index': exerciseIndex,
|
|
if (setIndex != null) 'set_index': setIndex,
|
|
if (status != null) 'status': status,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (accumulatedMs != null) 'accumulated_ms': accumulatedMs,
|
|
if (stoppedAt != null) 'stopped_at': stoppedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ActiveScoreStopwatchStatesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? activeWorkoutSessionId,
|
|
Value<int>? programIndex,
|
|
Value<int>? exerciseIndex,
|
|
Value<int>? setIndex,
|
|
Value<String>? status,
|
|
Value<DateTime>? startedAt,
|
|
Value<int>? accumulatedMs,
|
|
Value<DateTime?>? stoppedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ActiveScoreStopwatchStatesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
status: status ?? this.status,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
accumulatedMs: accumulatedMs ?? this.accumulatedMs,
|
|
stoppedAt: stoppedAt ?? this.stoppedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (activeWorkoutSessionId.present) {
|
|
map['active_workout_session_id'] = Variable<String>(
|
|
activeWorkoutSessionId.value,
|
|
);
|
|
}
|
|
if (programIndex.present) {
|
|
map['program_index'] = Variable<int>(programIndex.value);
|
|
}
|
|
if (exerciseIndex.present) {
|
|
map['exercise_index'] = Variable<int>(exerciseIndex.value);
|
|
}
|
|
if (setIndex.present) {
|
|
map['set_index'] = Variable<int>(setIndex.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (accumulatedMs.present) {
|
|
map['accumulated_ms'] = Variable<int>(accumulatedMs.value);
|
|
}
|
|
if (stoppedAt.present) {
|
|
map['stopped_at'] = Variable<DateTime>(stoppedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveScoreStopwatchStatesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('status: $status, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('accumulatedMs: $accumulatedMs, ')
|
|
..write('stoppedAt: $stoppedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ActiveSetResultsTable extends ActiveSetResults
|
|
with TableInfo<$ActiveSetResultsTable, ActiveSetResult> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ActiveSetResultsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _activeWorkoutSessionIdMeta =
|
|
const VerificationMeta('activeWorkoutSessionId');
|
|
@override
|
|
late final GeneratedColumn<String> activeWorkoutSessionId =
|
|
GeneratedColumn<String>(
|
|
'active_workout_session_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES active_workout_sessions (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _programSnapshotIdMeta = const VerificationMeta(
|
|
'programSnapshotId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> programSnapshotId =
|
|
GeneratedColumn<String>(
|
|
'program_snapshot_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseSnapshotIdMeta =
|
|
const VerificationMeta('exerciseSnapshotId');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseSnapshotId =
|
|
GeneratedColumn<String>(
|
|
'exercise_snapshot_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _programIndexMeta = const VerificationMeta(
|
|
'programIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> programIndex = GeneratedColumn<int>(
|
|
'program_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseIndexMeta = const VerificationMeta(
|
|
'exerciseIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> exerciseIndex = GeneratedColumn<int>(
|
|
'exercise_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _setIndexMeta = const VerificationMeta(
|
|
'setIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> setIndex = GeneratedColumn<int>(
|
|
'set_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _completedAtMeta = const VerificationMeta(
|
|
'completedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> completedAt = GeneratedColumn<DateTime>(
|
|
'completed_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualTimeMsMeta = const VerificationMeta(
|
|
'actualTimeMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualTimeMs = GeneratedColumn<int>(
|
|
'actual_time_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualRepsMeta = const VerificationMeta(
|
|
'actualReps',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualReps = GeneratedColumn<int>(
|
|
'actual_reps',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualScoreMeta = const VerificationMeta(
|
|
'actualScore',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> actualScore = GeneratedColumn<double>(
|
|
'actual_score',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualScoreTimeMsMeta = const VerificationMeta(
|
|
'actualScoreTimeMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualScoreTimeMs = GeneratedColumn<int>(
|
|
'actual_score_time_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreInputModeSnapshotMeta =
|
|
const VerificationMeta('scoreInputModeSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreInputModeSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_input_mode_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('manual'),
|
|
);
|
|
static const VerificationMeta _scoreLabelSnapshotMeta =
|
|
const VerificationMeta('scoreLabelSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreLabelSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_label_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreUnitSnapshotMeta = const VerificationMeta(
|
|
'scoreUnitSnapshot',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreUnitSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_unit_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('completed'),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
programSnapshotId,
|
|
exerciseSnapshotId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
startedAt,
|
|
completedAt,
|
|
actualTimeMs,
|
|
actualReps,
|
|
actualScore,
|
|
actualScoreTimeMs,
|
|
scoreInputModeSnapshot,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
note,
|
|
status,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'active_set_results';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ActiveSetResult> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('active_workout_session_id')) {
|
|
context.handle(
|
|
_activeWorkoutSessionIdMeta,
|
|
activeWorkoutSessionId.isAcceptableOrUnknown(
|
|
data['active_workout_session_id']!,
|
|
_activeWorkoutSessionIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_activeWorkoutSessionIdMeta);
|
|
}
|
|
if (data.containsKey('program_snapshot_id')) {
|
|
context.handle(
|
|
_programSnapshotIdMeta,
|
|
programSnapshotId.isAcceptableOrUnknown(
|
|
data['program_snapshot_id']!,
|
|
_programSnapshotIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programSnapshotIdMeta);
|
|
}
|
|
if (data.containsKey('exercise_snapshot_id')) {
|
|
context.handle(
|
|
_exerciseSnapshotIdMeta,
|
|
exerciseSnapshotId.isAcceptableOrUnknown(
|
|
data['exercise_snapshot_id']!,
|
|
_exerciseSnapshotIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseSnapshotIdMeta);
|
|
}
|
|
if (data.containsKey('program_index')) {
|
|
context.handle(
|
|
_programIndexMeta,
|
|
programIndex.isAcceptableOrUnknown(
|
|
data['program_index']!,
|
|
_programIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIndexMeta);
|
|
}
|
|
if (data.containsKey('exercise_index')) {
|
|
context.handle(
|
|
_exerciseIndexMeta,
|
|
exerciseIndex.isAcceptableOrUnknown(
|
|
data['exercise_index']!,
|
|
_exerciseIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseIndexMeta);
|
|
}
|
|
if (data.containsKey('set_index')) {
|
|
context.handle(
|
|
_setIndexMeta,
|
|
setIndex.isAcceptableOrUnknown(data['set_index']!, _setIndexMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_setIndexMeta);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('completed_at')) {
|
|
context.handle(
|
|
_completedAtMeta,
|
|
completedAt.isAcceptableOrUnknown(
|
|
data['completed_at']!,
|
|
_completedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_time_ms')) {
|
|
context.handle(
|
|
_actualTimeMsMeta,
|
|
actualTimeMs.isAcceptableOrUnknown(
|
|
data['actual_time_ms']!,
|
|
_actualTimeMsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_reps')) {
|
|
context.handle(
|
|
_actualRepsMeta,
|
|
actualReps.isAcceptableOrUnknown(data['actual_reps']!, _actualRepsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_score')) {
|
|
context.handle(
|
|
_actualScoreMeta,
|
|
actualScore.isAcceptableOrUnknown(
|
|
data['actual_score']!,
|
|
_actualScoreMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_score_time_ms')) {
|
|
context.handle(
|
|
_actualScoreTimeMsMeta,
|
|
actualScoreTimeMs.isAcceptableOrUnknown(
|
|
data['actual_score_time_ms']!,
|
|
_actualScoreTimeMsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_input_mode_snapshot')) {
|
|
context.handle(
|
|
_scoreInputModeSnapshotMeta,
|
|
scoreInputModeSnapshot.isAcceptableOrUnknown(
|
|
data['score_input_mode_snapshot']!,
|
|
_scoreInputModeSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_label_snapshot')) {
|
|
context.handle(
|
|
_scoreLabelSnapshotMeta,
|
|
scoreLabelSnapshot.isAcceptableOrUnknown(
|
|
data['score_label_snapshot']!,
|
|
_scoreLabelSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_unit_snapshot')) {
|
|
context.handle(
|
|
_scoreUnitSnapshotMeta,
|
|
scoreUnitSnapshot.isAcceptableOrUnknown(
|
|
data['score_unit_snapshot']!,
|
|
_scoreUnitSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActiveSetResult map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActiveSetResult(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
activeWorkoutSessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}active_workout_session_id'],
|
|
)!,
|
|
programSnapshotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_snapshot_id'],
|
|
)!,
|
|
exerciseSnapshotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_snapshot_id'],
|
|
)!,
|
|
programIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}program_index'],
|
|
)!,
|
|
exerciseIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}exercise_index'],
|
|
)!,
|
|
setIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}set_index'],
|
|
)!,
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
),
|
|
completedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}completed_at'],
|
|
),
|
|
actualTimeMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_time_ms'],
|
|
),
|
|
actualReps: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_reps'],
|
|
),
|
|
actualScore: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}actual_score'],
|
|
),
|
|
actualScoreTimeMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_score_time_ms'],
|
|
),
|
|
scoreInputModeSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_input_mode_snapshot'],
|
|
)!,
|
|
scoreLabelSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_label_snapshot'],
|
|
),
|
|
scoreUnitSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_unit_snapshot'],
|
|
),
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ActiveSetResultsTable createAlias(String alias) {
|
|
return $ActiveSetResultsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActiveSetResult extends DataClass implements Insertable<ActiveSetResult> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String activeWorkoutSessionId;
|
|
final String programSnapshotId;
|
|
final String exerciseSnapshotId;
|
|
final int programIndex;
|
|
final int exerciseIndex;
|
|
final int setIndex;
|
|
final DateTime? startedAt;
|
|
final DateTime? completedAt;
|
|
final int? actualTimeMs;
|
|
final int? actualReps;
|
|
final double? actualScore;
|
|
final int? actualScoreTimeMs;
|
|
final String scoreInputModeSnapshot;
|
|
final String? scoreLabelSnapshot;
|
|
final String? scoreUnitSnapshot;
|
|
final String? note;
|
|
final String status;
|
|
const ActiveSetResult({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.activeWorkoutSessionId,
|
|
required this.programSnapshotId,
|
|
required this.exerciseSnapshotId,
|
|
required this.programIndex,
|
|
required this.exerciseIndex,
|
|
required this.setIndex,
|
|
this.startedAt,
|
|
this.completedAt,
|
|
this.actualTimeMs,
|
|
this.actualReps,
|
|
this.actualScore,
|
|
this.actualScoreTimeMs,
|
|
required this.scoreInputModeSnapshot,
|
|
this.scoreLabelSnapshot,
|
|
this.scoreUnitSnapshot,
|
|
this.note,
|
|
required this.status,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['active_workout_session_id'] = Variable<String>(activeWorkoutSessionId);
|
|
map['program_snapshot_id'] = Variable<String>(programSnapshotId);
|
|
map['exercise_snapshot_id'] = Variable<String>(exerciseSnapshotId);
|
|
map['program_index'] = Variable<int>(programIndex);
|
|
map['exercise_index'] = Variable<int>(exerciseIndex);
|
|
map['set_index'] = Variable<int>(setIndex);
|
|
if (!nullToAbsent || startedAt != null) {
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
}
|
|
if (!nullToAbsent || completedAt != null) {
|
|
map['completed_at'] = Variable<DateTime>(completedAt);
|
|
}
|
|
if (!nullToAbsent || actualTimeMs != null) {
|
|
map['actual_time_ms'] = Variable<int>(actualTimeMs);
|
|
}
|
|
if (!nullToAbsent || actualReps != null) {
|
|
map['actual_reps'] = Variable<int>(actualReps);
|
|
}
|
|
if (!nullToAbsent || actualScore != null) {
|
|
map['actual_score'] = Variable<double>(actualScore);
|
|
}
|
|
if (!nullToAbsent || actualScoreTimeMs != null) {
|
|
map['actual_score_time_ms'] = Variable<int>(actualScoreTimeMs);
|
|
}
|
|
map['score_input_mode_snapshot'] = Variable<String>(scoreInputModeSnapshot);
|
|
if (!nullToAbsent || scoreLabelSnapshot != null) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot);
|
|
}
|
|
if (!nullToAbsent || scoreUnitSnapshot != null) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot);
|
|
}
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
map['status'] = Variable<String>(status);
|
|
return map;
|
|
}
|
|
|
|
ActiveSetResultsCompanion toCompanion(bool nullToAbsent) {
|
|
return ActiveSetResultsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
activeWorkoutSessionId: Value(activeWorkoutSessionId),
|
|
programSnapshotId: Value(programSnapshotId),
|
|
exerciseSnapshotId: Value(exerciseSnapshotId),
|
|
programIndex: Value(programIndex),
|
|
exerciseIndex: Value(exerciseIndex),
|
|
setIndex: Value(setIndex),
|
|
startedAt: startedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(startedAt),
|
|
completedAt: completedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(completedAt),
|
|
actualTimeMs: actualTimeMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualTimeMs),
|
|
actualReps: actualReps == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualReps),
|
|
actualScore: actualScore == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualScore),
|
|
actualScoreTimeMs: actualScoreTimeMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualScoreTimeMs),
|
|
scoreInputModeSnapshot: Value(scoreInputModeSnapshot),
|
|
scoreLabelSnapshot: scoreLabelSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreLabelSnapshot),
|
|
scoreUnitSnapshot: scoreUnitSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreUnitSnapshot),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
status: Value(status),
|
|
);
|
|
}
|
|
|
|
factory ActiveSetResult.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActiveSetResult(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
activeWorkoutSessionId: serializer.fromJson<String>(
|
|
json['activeWorkoutSessionId'],
|
|
),
|
|
programSnapshotId: serializer.fromJson<String>(json['programSnapshotId']),
|
|
exerciseSnapshotId: serializer.fromJson<String>(
|
|
json['exerciseSnapshotId'],
|
|
),
|
|
programIndex: serializer.fromJson<int>(json['programIndex']),
|
|
exerciseIndex: serializer.fromJson<int>(json['exerciseIndex']),
|
|
setIndex: serializer.fromJson<int>(json['setIndex']),
|
|
startedAt: serializer.fromJson<DateTime?>(json['startedAt']),
|
|
completedAt: serializer.fromJson<DateTime?>(json['completedAt']),
|
|
actualTimeMs: serializer.fromJson<int?>(json['actualTimeMs']),
|
|
actualReps: serializer.fromJson<int?>(json['actualReps']),
|
|
actualScore: serializer.fromJson<double?>(json['actualScore']),
|
|
actualScoreTimeMs: serializer.fromJson<int?>(json['actualScoreTimeMs']),
|
|
scoreInputModeSnapshot: serializer.fromJson<String>(
|
|
json['scoreInputModeSnapshot'],
|
|
),
|
|
scoreLabelSnapshot: serializer.fromJson<String?>(
|
|
json['scoreLabelSnapshot'],
|
|
),
|
|
scoreUnitSnapshot: serializer.fromJson<String?>(
|
|
json['scoreUnitSnapshot'],
|
|
),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'activeWorkoutSessionId': serializer.toJson<String>(
|
|
activeWorkoutSessionId,
|
|
),
|
|
'programSnapshotId': serializer.toJson<String>(programSnapshotId),
|
|
'exerciseSnapshotId': serializer.toJson<String>(exerciseSnapshotId),
|
|
'programIndex': serializer.toJson<int>(programIndex),
|
|
'exerciseIndex': serializer.toJson<int>(exerciseIndex),
|
|
'setIndex': serializer.toJson<int>(setIndex),
|
|
'startedAt': serializer.toJson<DateTime?>(startedAt),
|
|
'completedAt': serializer.toJson<DateTime?>(completedAt),
|
|
'actualTimeMs': serializer.toJson<int?>(actualTimeMs),
|
|
'actualReps': serializer.toJson<int?>(actualReps),
|
|
'actualScore': serializer.toJson<double?>(actualScore),
|
|
'actualScoreTimeMs': serializer.toJson<int?>(actualScoreTimeMs),
|
|
'scoreInputModeSnapshot': serializer.toJson<String>(
|
|
scoreInputModeSnapshot,
|
|
),
|
|
'scoreLabelSnapshot': serializer.toJson<String?>(scoreLabelSnapshot),
|
|
'scoreUnitSnapshot': serializer.toJson<String?>(scoreUnitSnapshot),
|
|
'note': serializer.toJson<String?>(note),
|
|
'status': serializer.toJson<String>(status),
|
|
};
|
|
}
|
|
|
|
ActiveSetResult copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? activeWorkoutSessionId,
|
|
String? programSnapshotId,
|
|
String? exerciseSnapshotId,
|
|
int? programIndex,
|
|
int? exerciseIndex,
|
|
int? setIndex,
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
String? scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
String? status,
|
|
}) => ActiveSetResult(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
programSnapshotId: programSnapshotId ?? this.programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId ?? this.exerciseSnapshotId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
startedAt: startedAt.present ? startedAt.value : this.startedAt,
|
|
completedAt: completedAt.present ? completedAt.value : this.completedAt,
|
|
actualTimeMs: actualTimeMs.present ? actualTimeMs.value : this.actualTimeMs,
|
|
actualReps: actualReps.present ? actualReps.value : this.actualReps,
|
|
actualScore: actualScore.present ? actualScore.value : this.actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs.present
|
|
? actualScoreTimeMs.value
|
|
: this.actualScoreTimeMs,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot.present
|
|
? scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot.present
|
|
? scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
note: note.present ? note.value : this.note,
|
|
status: status ?? this.status,
|
|
);
|
|
ActiveSetResult copyWithCompanion(ActiveSetResultsCompanion data) {
|
|
return ActiveSetResult(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
activeWorkoutSessionId: data.activeWorkoutSessionId.present
|
|
? data.activeWorkoutSessionId.value
|
|
: this.activeWorkoutSessionId,
|
|
programSnapshotId: data.programSnapshotId.present
|
|
? data.programSnapshotId.value
|
|
: this.programSnapshotId,
|
|
exerciseSnapshotId: data.exerciseSnapshotId.present
|
|
? data.exerciseSnapshotId.value
|
|
: this.exerciseSnapshotId,
|
|
programIndex: data.programIndex.present
|
|
? data.programIndex.value
|
|
: this.programIndex,
|
|
exerciseIndex: data.exerciseIndex.present
|
|
? data.exerciseIndex.value
|
|
: this.exerciseIndex,
|
|
setIndex: data.setIndex.present ? data.setIndex.value : this.setIndex,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
completedAt: data.completedAt.present
|
|
? data.completedAt.value
|
|
: this.completedAt,
|
|
actualTimeMs: data.actualTimeMs.present
|
|
? data.actualTimeMs.value
|
|
: this.actualTimeMs,
|
|
actualReps: data.actualReps.present
|
|
? data.actualReps.value
|
|
: this.actualReps,
|
|
actualScore: data.actualScore.present
|
|
? data.actualScore.value
|
|
: this.actualScore,
|
|
actualScoreTimeMs: data.actualScoreTimeMs.present
|
|
? data.actualScoreTimeMs.value
|
|
: this.actualScoreTimeMs,
|
|
scoreInputModeSnapshot: data.scoreInputModeSnapshot.present
|
|
? data.scoreInputModeSnapshot.value
|
|
: this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: data.scoreLabelSnapshot.present
|
|
? data.scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: data.scoreUnitSnapshot.present
|
|
? data.scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveSetResult(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('programSnapshotId: $programSnapshotId, ')
|
|
..write('exerciseSnapshotId: $exerciseSnapshotId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('completedAt: $completedAt, ')
|
|
..write('actualTimeMs: $actualTimeMs, ')
|
|
..write('actualReps: $actualReps, ')
|
|
..write('actualScore: $actualScore, ')
|
|
..write('actualScoreTimeMs: $actualScoreTimeMs, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('note: $note, ')
|
|
..write('status: $status')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
activeWorkoutSessionId,
|
|
programSnapshotId,
|
|
exerciseSnapshotId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
startedAt,
|
|
completedAt,
|
|
actualTimeMs,
|
|
actualReps,
|
|
actualScore,
|
|
actualScoreTimeMs,
|
|
scoreInputModeSnapshot,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
note,
|
|
status,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActiveSetResult &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.activeWorkoutSessionId == this.activeWorkoutSessionId &&
|
|
other.programSnapshotId == this.programSnapshotId &&
|
|
other.exerciseSnapshotId == this.exerciseSnapshotId &&
|
|
other.programIndex == this.programIndex &&
|
|
other.exerciseIndex == this.exerciseIndex &&
|
|
other.setIndex == this.setIndex &&
|
|
other.startedAt == this.startedAt &&
|
|
other.completedAt == this.completedAt &&
|
|
other.actualTimeMs == this.actualTimeMs &&
|
|
other.actualReps == this.actualReps &&
|
|
other.actualScore == this.actualScore &&
|
|
other.actualScoreTimeMs == this.actualScoreTimeMs &&
|
|
other.scoreInputModeSnapshot == this.scoreInputModeSnapshot &&
|
|
other.scoreLabelSnapshot == this.scoreLabelSnapshot &&
|
|
other.scoreUnitSnapshot == this.scoreUnitSnapshot &&
|
|
other.note == this.note &&
|
|
other.status == this.status);
|
|
}
|
|
|
|
class ActiveSetResultsCompanion extends UpdateCompanion<ActiveSetResult> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> activeWorkoutSessionId;
|
|
final Value<String> programSnapshotId;
|
|
final Value<String> exerciseSnapshotId;
|
|
final Value<int> programIndex;
|
|
final Value<int> exerciseIndex;
|
|
final Value<int> setIndex;
|
|
final Value<DateTime?> startedAt;
|
|
final Value<DateTime?> completedAt;
|
|
final Value<int?> actualTimeMs;
|
|
final Value<int?> actualReps;
|
|
final Value<double?> actualScore;
|
|
final Value<int?> actualScoreTimeMs;
|
|
final Value<String> scoreInputModeSnapshot;
|
|
final Value<String?> scoreLabelSnapshot;
|
|
final Value<String?> scoreUnitSnapshot;
|
|
final Value<String?> note;
|
|
final Value<String> status;
|
|
final Value<int> rowid;
|
|
const ActiveSetResultsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.activeWorkoutSessionId = const Value.absent(),
|
|
this.programSnapshotId = const Value.absent(),
|
|
this.exerciseSnapshotId = const Value.absent(),
|
|
this.programIndex = const Value.absent(),
|
|
this.exerciseIndex = const Value.absent(),
|
|
this.setIndex = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.completedAt = const Value.absent(),
|
|
this.actualTimeMs = const Value.absent(),
|
|
this.actualReps = const Value.absent(),
|
|
this.actualScore = const Value.absent(),
|
|
this.actualScoreTimeMs = const Value.absent(),
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ActiveSetResultsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
this.startedAt = const Value.absent(),
|
|
this.completedAt = const Value.absent(),
|
|
this.actualTimeMs = const Value.absent(),
|
|
this.actualReps = const Value.absent(),
|
|
this.actualScore = const Value.absent(),
|
|
this.actualScoreTimeMs = const Value.absent(),
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
activeWorkoutSessionId = Value(activeWorkoutSessionId),
|
|
programSnapshotId = Value(programSnapshotId),
|
|
exerciseSnapshotId = Value(exerciseSnapshotId),
|
|
programIndex = Value(programIndex),
|
|
exerciseIndex = Value(exerciseIndex),
|
|
setIndex = Value(setIndex);
|
|
static Insertable<ActiveSetResult> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? activeWorkoutSessionId,
|
|
Expression<String>? programSnapshotId,
|
|
Expression<String>? exerciseSnapshotId,
|
|
Expression<int>? programIndex,
|
|
Expression<int>? exerciseIndex,
|
|
Expression<int>? setIndex,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<DateTime>? completedAt,
|
|
Expression<int>? actualTimeMs,
|
|
Expression<int>? actualReps,
|
|
Expression<double>? actualScore,
|
|
Expression<int>? actualScoreTimeMs,
|
|
Expression<String>? scoreInputModeSnapshot,
|
|
Expression<String>? scoreLabelSnapshot,
|
|
Expression<String>? scoreUnitSnapshot,
|
|
Expression<String>? note,
|
|
Expression<String>? status,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (activeWorkoutSessionId != null)
|
|
'active_workout_session_id': activeWorkoutSessionId,
|
|
if (programSnapshotId != null) 'program_snapshot_id': programSnapshotId,
|
|
if (exerciseSnapshotId != null)
|
|
'exercise_snapshot_id': exerciseSnapshotId,
|
|
if (programIndex != null) 'program_index': programIndex,
|
|
if (exerciseIndex != null) 'exercise_index': exerciseIndex,
|
|
if (setIndex != null) 'set_index': setIndex,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (completedAt != null) 'completed_at': completedAt,
|
|
if (actualTimeMs != null) 'actual_time_ms': actualTimeMs,
|
|
if (actualReps != null) 'actual_reps': actualReps,
|
|
if (actualScore != null) 'actual_score': actualScore,
|
|
if (actualScoreTimeMs != null) 'actual_score_time_ms': actualScoreTimeMs,
|
|
if (scoreInputModeSnapshot != null)
|
|
'score_input_mode_snapshot': scoreInputModeSnapshot,
|
|
if (scoreLabelSnapshot != null)
|
|
'score_label_snapshot': scoreLabelSnapshot,
|
|
if (scoreUnitSnapshot != null) 'score_unit_snapshot': scoreUnitSnapshot,
|
|
if (note != null) 'note': note,
|
|
if (status != null) 'status': status,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ActiveSetResultsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? activeWorkoutSessionId,
|
|
Value<String>? programSnapshotId,
|
|
Value<String>? exerciseSnapshotId,
|
|
Value<int>? programIndex,
|
|
Value<int>? exerciseIndex,
|
|
Value<int>? setIndex,
|
|
Value<DateTime?>? startedAt,
|
|
Value<DateTime?>? completedAt,
|
|
Value<int?>? actualTimeMs,
|
|
Value<int?>? actualReps,
|
|
Value<double?>? actualScore,
|
|
Value<int?>? actualScoreTimeMs,
|
|
Value<String>? scoreInputModeSnapshot,
|
|
Value<String?>? scoreLabelSnapshot,
|
|
Value<String?>? scoreUnitSnapshot,
|
|
Value<String?>? note,
|
|
Value<String>? status,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ActiveSetResultsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
activeWorkoutSessionId:
|
|
activeWorkoutSessionId ?? this.activeWorkoutSessionId,
|
|
programSnapshotId: programSnapshotId ?? this.programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId ?? this.exerciseSnapshotId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
completedAt: completedAt ?? this.completedAt,
|
|
actualTimeMs: actualTimeMs ?? this.actualTimeMs,
|
|
actualReps: actualReps ?? this.actualReps,
|
|
actualScore: actualScore ?? this.actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs ?? this.actualScoreTimeMs,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot ?? this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot ?? this.scoreUnitSnapshot,
|
|
note: note ?? this.note,
|
|
status: status ?? this.status,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (activeWorkoutSessionId.present) {
|
|
map['active_workout_session_id'] = Variable<String>(
|
|
activeWorkoutSessionId.value,
|
|
);
|
|
}
|
|
if (programSnapshotId.present) {
|
|
map['program_snapshot_id'] = Variable<String>(programSnapshotId.value);
|
|
}
|
|
if (exerciseSnapshotId.present) {
|
|
map['exercise_snapshot_id'] = Variable<String>(exerciseSnapshotId.value);
|
|
}
|
|
if (programIndex.present) {
|
|
map['program_index'] = Variable<int>(programIndex.value);
|
|
}
|
|
if (exerciseIndex.present) {
|
|
map['exercise_index'] = Variable<int>(exerciseIndex.value);
|
|
}
|
|
if (setIndex.present) {
|
|
map['set_index'] = Variable<int>(setIndex.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (completedAt.present) {
|
|
map['completed_at'] = Variable<DateTime>(completedAt.value);
|
|
}
|
|
if (actualTimeMs.present) {
|
|
map['actual_time_ms'] = Variable<int>(actualTimeMs.value);
|
|
}
|
|
if (actualReps.present) {
|
|
map['actual_reps'] = Variable<int>(actualReps.value);
|
|
}
|
|
if (actualScore.present) {
|
|
map['actual_score'] = Variable<double>(actualScore.value);
|
|
}
|
|
if (actualScoreTimeMs.present) {
|
|
map['actual_score_time_ms'] = Variable<int>(actualScoreTimeMs.value);
|
|
}
|
|
if (scoreInputModeSnapshot.present) {
|
|
map['score_input_mode_snapshot'] = Variable<String>(
|
|
scoreInputModeSnapshot.value,
|
|
);
|
|
}
|
|
if (scoreLabelSnapshot.present) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot.value);
|
|
}
|
|
if (scoreUnitSnapshot.present) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot.value);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActiveSetResultsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('activeWorkoutSessionId: $activeWorkoutSessionId, ')
|
|
..write('programSnapshotId: $programSnapshotId, ')
|
|
..write('exerciseSnapshotId: $exerciseSnapshotId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('completedAt: $completedAt, ')
|
|
..write('actualTimeMs: $actualTimeMs, ')
|
|
..write('actualReps: $actualReps, ')
|
|
..write('actualScore: $actualScore, ')
|
|
..write('actualScoreTimeMs: $actualScoreTimeMs, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('note: $note, ')
|
|
..write('status: $status, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ChangeLogEntriesTable extends ChangeLogEntries
|
|
with TableInfo<$ChangeLogEntriesTable, ChangeLogEntry> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ChangeLogEntriesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _entityTypeMeta = const VerificationMeta(
|
|
'entityType',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> entityType = GeneratedColumn<String>(
|
|
'entity_type',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _entityIdMeta = const VerificationMeta(
|
|
'entityId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> entityId = GeneratedColumn<String>(
|
|
'entity_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _operationMeta = const VerificationMeta(
|
|
'operation',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> operation = GeneratedColumn<String>(
|
|
'operation',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _payloadHashMeta = const VerificationMeta(
|
|
'payloadHash',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> payloadHash = GeneratedColumn<String>(
|
|
'payload_hash',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _syncedAtMeta = const VerificationMeta(
|
|
'syncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> syncedAt = GeneratedColumn<DateTime>(
|
|
'synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
entityType,
|
|
entityId,
|
|
operation,
|
|
payloadHash,
|
|
localRevision,
|
|
originDeviceId,
|
|
createdAt,
|
|
syncedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'change_log';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ChangeLogEntry> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('entity_type')) {
|
|
context.handle(
|
|
_entityTypeMeta,
|
|
entityType.isAcceptableOrUnknown(data['entity_type']!, _entityTypeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_entityTypeMeta);
|
|
}
|
|
if (data.containsKey('entity_id')) {
|
|
context.handle(
|
|
_entityIdMeta,
|
|
entityId.isAcceptableOrUnknown(data['entity_id']!, _entityIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_entityIdMeta);
|
|
}
|
|
if (data.containsKey('operation')) {
|
|
context.handle(
|
|
_operationMeta,
|
|
operation.isAcceptableOrUnknown(data['operation']!, _operationMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_operationMeta);
|
|
}
|
|
if (data.containsKey('payload_hash')) {
|
|
context.handle(
|
|
_payloadHashMeta,
|
|
payloadHash.isAcceptableOrUnknown(
|
|
data['payload_hash']!,
|
|
_payloadHashMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('synced_at')) {
|
|
context.handle(
|
|
_syncedAtMeta,
|
|
syncedAt.isAcceptableOrUnknown(data['synced_at']!, _syncedAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ChangeLogEntry map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ChangeLogEntry(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
entityType: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}entity_type'],
|
|
)!,
|
|
entityId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}entity_id'],
|
|
)!,
|
|
operation: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}operation'],
|
|
)!,
|
|
payloadHash: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}payload_hash'],
|
|
),
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
syncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}synced_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ChangeLogEntriesTable createAlias(String alias) {
|
|
return $ChangeLogEntriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ChangeLogEntry extends DataClass implements Insertable<ChangeLogEntry> {
|
|
final String id;
|
|
final String entityType;
|
|
final String entityId;
|
|
final String operation;
|
|
final String? payloadHash;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final DateTime createdAt;
|
|
final DateTime? syncedAt;
|
|
const ChangeLogEntry({
|
|
required this.id,
|
|
required this.entityType,
|
|
required this.entityId,
|
|
required this.operation,
|
|
this.payloadHash,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
required this.createdAt,
|
|
this.syncedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['entity_type'] = Variable<String>(entityType);
|
|
map['entity_id'] = Variable<String>(entityId);
|
|
map['operation'] = Variable<String>(operation);
|
|
if (!nullToAbsent || payloadHash != null) {
|
|
map['payload_hash'] = Variable<String>(payloadHash);
|
|
}
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
if (!nullToAbsent || syncedAt != null) {
|
|
map['synced_at'] = Variable<DateTime>(syncedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ChangeLogEntriesCompanion toCompanion(bool nullToAbsent) {
|
|
return ChangeLogEntriesCompanion(
|
|
id: Value(id),
|
|
entityType: Value(entityType),
|
|
entityId: Value(entityId),
|
|
operation: Value(operation),
|
|
payloadHash: payloadHash == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(payloadHash),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
createdAt: Value(createdAt),
|
|
syncedAt: syncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(syncedAt),
|
|
);
|
|
}
|
|
|
|
factory ChangeLogEntry.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ChangeLogEntry(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
entityType: serializer.fromJson<String>(json['entityType']),
|
|
entityId: serializer.fromJson<String>(json['entityId']),
|
|
operation: serializer.fromJson<String>(json['operation']),
|
|
payloadHash: serializer.fromJson<String?>(json['payloadHash']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
syncedAt: serializer.fromJson<DateTime?>(json['syncedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'entityType': serializer.toJson<String>(entityType),
|
|
'entityId': serializer.toJson<String>(entityId),
|
|
'operation': serializer.toJson<String>(operation),
|
|
'payloadHash': serializer.toJson<String?>(payloadHash),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'syncedAt': serializer.toJson<DateTime?>(syncedAt),
|
|
};
|
|
}
|
|
|
|
ChangeLogEntry copyWith({
|
|
String? id,
|
|
String? entityType,
|
|
String? entityId,
|
|
String? operation,
|
|
Value<String?> payloadHash = const Value.absent(),
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
DateTime? createdAt,
|
|
Value<DateTime?> syncedAt = const Value.absent(),
|
|
}) => ChangeLogEntry(
|
|
id: id ?? this.id,
|
|
entityType: entityType ?? this.entityType,
|
|
entityId: entityId ?? this.entityId,
|
|
operation: operation ?? this.operation,
|
|
payloadHash: payloadHash.present ? payloadHash.value : this.payloadHash,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
syncedAt: syncedAt.present ? syncedAt.value : this.syncedAt,
|
|
);
|
|
ChangeLogEntry copyWithCompanion(ChangeLogEntriesCompanion data) {
|
|
return ChangeLogEntry(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
entityType: data.entityType.present
|
|
? data.entityType.value
|
|
: this.entityType,
|
|
entityId: data.entityId.present ? data.entityId.value : this.entityId,
|
|
operation: data.operation.present ? data.operation.value : this.operation,
|
|
payloadHash: data.payloadHash.present
|
|
? data.payloadHash.value
|
|
: this.payloadHash,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
syncedAt: data.syncedAt.present ? data.syncedAt.value : this.syncedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ChangeLogEntry(')
|
|
..write('id: $id, ')
|
|
..write('entityType: $entityType, ')
|
|
..write('entityId: $entityId, ')
|
|
..write('operation: $operation, ')
|
|
..write('payloadHash: $payloadHash, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('syncedAt: $syncedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
entityType,
|
|
entityId,
|
|
operation,
|
|
payloadHash,
|
|
localRevision,
|
|
originDeviceId,
|
|
createdAt,
|
|
syncedAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ChangeLogEntry &&
|
|
other.id == this.id &&
|
|
other.entityType == this.entityType &&
|
|
other.entityId == this.entityId &&
|
|
other.operation == this.operation &&
|
|
other.payloadHash == this.payloadHash &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.createdAt == this.createdAt &&
|
|
other.syncedAt == this.syncedAt);
|
|
}
|
|
|
|
class ChangeLogEntriesCompanion extends UpdateCompanion<ChangeLogEntry> {
|
|
final Value<String> id;
|
|
final Value<String> entityType;
|
|
final Value<String> entityId;
|
|
final Value<String> operation;
|
|
final Value<String?> payloadHash;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime?> syncedAt;
|
|
final Value<int> rowid;
|
|
const ChangeLogEntriesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.entityType = const Value.absent(),
|
|
this.entityId = const Value.absent(),
|
|
this.operation = const Value.absent(),
|
|
this.payloadHash = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.syncedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ChangeLogEntriesCompanion.insert({
|
|
required String id,
|
|
required String entityType,
|
|
required String entityId,
|
|
required String operation,
|
|
this.payloadHash = const Value.absent(),
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
required DateTime createdAt,
|
|
this.syncedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
entityType = Value(entityType),
|
|
entityId = Value(entityId),
|
|
operation = Value(operation),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<ChangeLogEntry> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? entityType,
|
|
Expression<String>? entityId,
|
|
Expression<String>? operation,
|
|
Expression<String>? payloadHash,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? syncedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (entityType != null) 'entity_type': entityType,
|
|
if (entityId != null) 'entity_id': entityId,
|
|
if (operation != null) 'operation': operation,
|
|
if (payloadHash != null) 'payload_hash': payloadHash,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (syncedAt != null) 'synced_at': syncedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ChangeLogEntriesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? entityType,
|
|
Value<String>? entityId,
|
|
Value<String>? operation,
|
|
Value<String?>? payloadHash,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime?>? syncedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ChangeLogEntriesCompanion(
|
|
id: id ?? this.id,
|
|
entityType: entityType ?? this.entityType,
|
|
entityId: entityId ?? this.entityId,
|
|
operation: operation ?? this.operation,
|
|
payloadHash: payloadHash ?? this.payloadHash,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
syncedAt: syncedAt ?? this.syncedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (entityType.present) {
|
|
map['entity_type'] = Variable<String>(entityType.value);
|
|
}
|
|
if (entityId.present) {
|
|
map['entity_id'] = Variable<String>(entityId.value);
|
|
}
|
|
if (operation.present) {
|
|
map['operation'] = Variable<String>(operation.value);
|
|
}
|
|
if (payloadHash.present) {
|
|
map['payload_hash'] = Variable<String>(payloadHash.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (syncedAt.present) {
|
|
map['synced_at'] = Variable<DateTime>(syncedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ChangeLogEntriesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('entityType: $entityType, ')
|
|
..write('entityId: $entityId, ')
|
|
..write('operation: $operation, ')
|
|
..write('payloadHash: $payloadHash, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('syncedAt: $syncedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $MediaAssetsTable extends MediaAssets
|
|
with TableInfo<$MediaAssetsTable, MediaAsset> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MediaAssetsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _kindMeta = const VerificationMeta('kind');
|
|
@override
|
|
late final GeneratedColumn<String> kind = GeneratedColumn<String>(
|
|
'kind',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _localUriMeta = const VerificationMeta(
|
|
'localUri',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> localUri = GeneratedColumn<String>(
|
|
'local_uri',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _mimeTypeMeta = const VerificationMeta(
|
|
'mimeType',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> mimeType = GeneratedColumn<String>(
|
|
'mime_type',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sizeBytesMeta = const VerificationMeta(
|
|
'sizeBytes',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sizeBytes = GeneratedColumn<int>(
|
|
'size_bytes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _widthMeta = const VerificationMeta('width');
|
|
@override
|
|
late final GeneratedColumn<int> width = GeneratedColumn<int>(
|
|
'width',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _heightMeta = const VerificationMeta('height');
|
|
@override
|
|
late final GeneratedColumn<int> height = GeneratedColumn<int>(
|
|
'height',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _durationMsMeta = const VerificationMeta(
|
|
'durationMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> durationMs = GeneratedColumn<int>(
|
|
'duration_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _checksumMeta = const VerificationMeta(
|
|
'checksum',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> checksum = GeneratedColumn<String>(
|
|
'checksum',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteUriMeta = const VerificationMeta(
|
|
'remoteUri',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteUri = GeneratedColumn<String>(
|
|
'remote_uri',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _thumbnailLocalUriMeta = const VerificationMeta(
|
|
'thumbnailLocalUri',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> thumbnailLocalUri =
|
|
GeneratedColumn<String>(
|
|
'thumbnail_local_uri',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
kind,
|
|
localUri,
|
|
mimeType,
|
|
sizeBytes,
|
|
width,
|
|
height,
|
|
durationMs,
|
|
checksum,
|
|
remoteUri,
|
|
thumbnailLocalUri,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'media_assets';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<MediaAsset> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('kind')) {
|
|
context.handle(
|
|
_kindMeta,
|
|
kind.isAcceptableOrUnknown(data['kind']!, _kindMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_kindMeta);
|
|
}
|
|
if (data.containsKey('local_uri')) {
|
|
context.handle(
|
|
_localUriMeta,
|
|
localUri.isAcceptableOrUnknown(data['local_uri']!, _localUriMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localUriMeta);
|
|
}
|
|
if (data.containsKey('mime_type')) {
|
|
context.handle(
|
|
_mimeTypeMeta,
|
|
mimeType.isAcceptableOrUnknown(data['mime_type']!, _mimeTypeMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('size_bytes')) {
|
|
context.handle(
|
|
_sizeBytesMeta,
|
|
sizeBytes.isAcceptableOrUnknown(data['size_bytes']!, _sizeBytesMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('width')) {
|
|
context.handle(
|
|
_widthMeta,
|
|
width.isAcceptableOrUnknown(data['width']!, _widthMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('height')) {
|
|
context.handle(
|
|
_heightMeta,
|
|
height.isAcceptableOrUnknown(data['height']!, _heightMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('duration_ms')) {
|
|
context.handle(
|
|
_durationMsMeta,
|
|
durationMs.isAcceptableOrUnknown(data['duration_ms']!, _durationMsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('checksum')) {
|
|
context.handle(
|
|
_checksumMeta,
|
|
checksum.isAcceptableOrUnknown(data['checksum']!, _checksumMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_uri')) {
|
|
context.handle(
|
|
_remoteUriMeta,
|
|
remoteUri.isAcceptableOrUnknown(data['remote_uri']!, _remoteUriMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('thumbnail_local_uri')) {
|
|
context.handle(
|
|
_thumbnailLocalUriMeta,
|
|
thumbnailLocalUri.isAcceptableOrUnknown(
|
|
data['thumbnail_local_uri']!,
|
|
_thumbnailLocalUriMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
MediaAsset map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return MediaAsset(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
kind: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kind'],
|
|
)!,
|
|
localUri: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}local_uri'],
|
|
)!,
|
|
mimeType: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}mime_type'],
|
|
),
|
|
sizeBytes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}size_bytes'],
|
|
),
|
|
width: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}width'],
|
|
),
|
|
height: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}height'],
|
|
),
|
|
durationMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}duration_ms'],
|
|
),
|
|
checksum: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}checksum'],
|
|
),
|
|
remoteUri: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_uri'],
|
|
),
|
|
thumbnailLocalUri: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}thumbnail_local_uri'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MediaAssetsTable createAlias(String alias) {
|
|
return $MediaAssetsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class MediaAsset extends DataClass implements Insertable<MediaAsset> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String kind;
|
|
final String localUri;
|
|
final String? mimeType;
|
|
final int? sizeBytes;
|
|
final int? width;
|
|
final int? height;
|
|
final int? durationMs;
|
|
final String? checksum;
|
|
final String? remoteUri;
|
|
final String? thumbnailLocalUri;
|
|
const MediaAsset({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.kind,
|
|
required this.localUri,
|
|
this.mimeType,
|
|
this.sizeBytes,
|
|
this.width,
|
|
this.height,
|
|
this.durationMs,
|
|
this.checksum,
|
|
this.remoteUri,
|
|
this.thumbnailLocalUri,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['kind'] = Variable<String>(kind);
|
|
map['local_uri'] = Variable<String>(localUri);
|
|
if (!nullToAbsent || mimeType != null) {
|
|
map['mime_type'] = Variable<String>(mimeType);
|
|
}
|
|
if (!nullToAbsent || sizeBytes != null) {
|
|
map['size_bytes'] = Variable<int>(sizeBytes);
|
|
}
|
|
if (!nullToAbsent || width != null) {
|
|
map['width'] = Variable<int>(width);
|
|
}
|
|
if (!nullToAbsent || height != null) {
|
|
map['height'] = Variable<int>(height);
|
|
}
|
|
if (!nullToAbsent || durationMs != null) {
|
|
map['duration_ms'] = Variable<int>(durationMs);
|
|
}
|
|
if (!nullToAbsent || checksum != null) {
|
|
map['checksum'] = Variable<String>(checksum);
|
|
}
|
|
if (!nullToAbsent || remoteUri != null) {
|
|
map['remote_uri'] = Variable<String>(remoteUri);
|
|
}
|
|
if (!nullToAbsent || thumbnailLocalUri != null) {
|
|
map['thumbnail_local_uri'] = Variable<String>(thumbnailLocalUri);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
MediaAssetsCompanion toCompanion(bool nullToAbsent) {
|
|
return MediaAssetsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
kind: Value(kind),
|
|
localUri: Value(localUri),
|
|
mimeType: mimeType == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(mimeType),
|
|
sizeBytes: sizeBytes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sizeBytes),
|
|
width: width == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(width),
|
|
height: height == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(height),
|
|
durationMs: durationMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(durationMs),
|
|
checksum: checksum == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(checksum),
|
|
remoteUri: remoteUri == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteUri),
|
|
thumbnailLocalUri: thumbnailLocalUri == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(thumbnailLocalUri),
|
|
);
|
|
}
|
|
|
|
factory MediaAsset.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return MediaAsset(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
kind: serializer.fromJson<String>(json['kind']),
|
|
localUri: serializer.fromJson<String>(json['localUri']),
|
|
mimeType: serializer.fromJson<String?>(json['mimeType']),
|
|
sizeBytes: serializer.fromJson<int?>(json['sizeBytes']),
|
|
width: serializer.fromJson<int?>(json['width']),
|
|
height: serializer.fromJson<int?>(json['height']),
|
|
durationMs: serializer.fromJson<int?>(json['durationMs']),
|
|
checksum: serializer.fromJson<String?>(json['checksum']),
|
|
remoteUri: serializer.fromJson<String?>(json['remoteUri']),
|
|
thumbnailLocalUri: serializer.fromJson<String?>(
|
|
json['thumbnailLocalUri'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'kind': serializer.toJson<String>(kind),
|
|
'localUri': serializer.toJson<String>(localUri),
|
|
'mimeType': serializer.toJson<String?>(mimeType),
|
|
'sizeBytes': serializer.toJson<int?>(sizeBytes),
|
|
'width': serializer.toJson<int?>(width),
|
|
'height': serializer.toJson<int?>(height),
|
|
'durationMs': serializer.toJson<int?>(durationMs),
|
|
'checksum': serializer.toJson<String?>(checksum),
|
|
'remoteUri': serializer.toJson<String?>(remoteUri),
|
|
'thumbnailLocalUri': serializer.toJson<String?>(thumbnailLocalUri),
|
|
};
|
|
}
|
|
|
|
MediaAsset copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? kind,
|
|
String? localUri,
|
|
Value<String?> mimeType = const Value.absent(),
|
|
Value<int?> sizeBytes = const Value.absent(),
|
|
Value<int?> width = const Value.absent(),
|
|
Value<int?> height = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> checksum = const Value.absent(),
|
|
Value<String?> remoteUri = const Value.absent(),
|
|
Value<String?> thumbnailLocalUri = const Value.absent(),
|
|
}) => MediaAsset(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
kind: kind ?? this.kind,
|
|
localUri: localUri ?? this.localUri,
|
|
mimeType: mimeType.present ? mimeType.value : this.mimeType,
|
|
sizeBytes: sizeBytes.present ? sizeBytes.value : this.sizeBytes,
|
|
width: width.present ? width.value : this.width,
|
|
height: height.present ? height.value : this.height,
|
|
durationMs: durationMs.present ? durationMs.value : this.durationMs,
|
|
checksum: checksum.present ? checksum.value : this.checksum,
|
|
remoteUri: remoteUri.present ? remoteUri.value : this.remoteUri,
|
|
thumbnailLocalUri: thumbnailLocalUri.present
|
|
? thumbnailLocalUri.value
|
|
: this.thumbnailLocalUri,
|
|
);
|
|
MediaAsset copyWithCompanion(MediaAssetsCompanion data) {
|
|
return MediaAsset(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
kind: data.kind.present ? data.kind.value : this.kind,
|
|
localUri: data.localUri.present ? data.localUri.value : this.localUri,
|
|
mimeType: data.mimeType.present ? data.mimeType.value : this.mimeType,
|
|
sizeBytes: data.sizeBytes.present ? data.sizeBytes.value : this.sizeBytes,
|
|
width: data.width.present ? data.width.value : this.width,
|
|
height: data.height.present ? data.height.value : this.height,
|
|
durationMs: data.durationMs.present
|
|
? data.durationMs.value
|
|
: this.durationMs,
|
|
checksum: data.checksum.present ? data.checksum.value : this.checksum,
|
|
remoteUri: data.remoteUri.present ? data.remoteUri.value : this.remoteUri,
|
|
thumbnailLocalUri: data.thumbnailLocalUri.present
|
|
? data.thumbnailLocalUri.value
|
|
: this.thumbnailLocalUri,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MediaAsset(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('kind: $kind, ')
|
|
..write('localUri: $localUri, ')
|
|
..write('mimeType: $mimeType, ')
|
|
..write('sizeBytes: $sizeBytes, ')
|
|
..write('width: $width, ')
|
|
..write('height: $height, ')
|
|
..write('durationMs: $durationMs, ')
|
|
..write('checksum: $checksum, ')
|
|
..write('remoteUri: $remoteUri, ')
|
|
..write('thumbnailLocalUri: $thumbnailLocalUri')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
kind,
|
|
localUri,
|
|
mimeType,
|
|
sizeBytes,
|
|
width,
|
|
height,
|
|
durationMs,
|
|
checksum,
|
|
remoteUri,
|
|
thumbnailLocalUri,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is MediaAsset &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.kind == this.kind &&
|
|
other.localUri == this.localUri &&
|
|
other.mimeType == this.mimeType &&
|
|
other.sizeBytes == this.sizeBytes &&
|
|
other.width == this.width &&
|
|
other.height == this.height &&
|
|
other.durationMs == this.durationMs &&
|
|
other.checksum == this.checksum &&
|
|
other.remoteUri == this.remoteUri &&
|
|
other.thumbnailLocalUri == this.thumbnailLocalUri);
|
|
}
|
|
|
|
class MediaAssetsCompanion extends UpdateCompanion<MediaAsset> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> kind;
|
|
final Value<String> localUri;
|
|
final Value<String?> mimeType;
|
|
final Value<int?> sizeBytes;
|
|
final Value<int?> width;
|
|
final Value<int?> height;
|
|
final Value<int?> durationMs;
|
|
final Value<String?> checksum;
|
|
final Value<String?> remoteUri;
|
|
final Value<String?> thumbnailLocalUri;
|
|
final Value<int> rowid;
|
|
const MediaAssetsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.kind = const Value.absent(),
|
|
this.localUri = const Value.absent(),
|
|
this.mimeType = const Value.absent(),
|
|
this.sizeBytes = const Value.absent(),
|
|
this.width = const Value.absent(),
|
|
this.height = const Value.absent(),
|
|
this.durationMs = const Value.absent(),
|
|
this.checksum = const Value.absent(),
|
|
this.remoteUri = const Value.absent(),
|
|
this.thumbnailLocalUri = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
MediaAssetsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String kind,
|
|
required String localUri,
|
|
this.mimeType = const Value.absent(),
|
|
this.sizeBytes = const Value.absent(),
|
|
this.width = const Value.absent(),
|
|
this.height = const Value.absent(),
|
|
this.durationMs = const Value.absent(),
|
|
this.checksum = const Value.absent(),
|
|
this.remoteUri = const Value.absent(),
|
|
this.thumbnailLocalUri = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
kind = Value(kind),
|
|
localUri = Value(localUri);
|
|
static Insertable<MediaAsset> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? kind,
|
|
Expression<String>? localUri,
|
|
Expression<String>? mimeType,
|
|
Expression<int>? sizeBytes,
|
|
Expression<int>? width,
|
|
Expression<int>? height,
|
|
Expression<int>? durationMs,
|
|
Expression<String>? checksum,
|
|
Expression<String>? remoteUri,
|
|
Expression<String>? thumbnailLocalUri,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (kind != null) 'kind': kind,
|
|
if (localUri != null) 'local_uri': localUri,
|
|
if (mimeType != null) 'mime_type': mimeType,
|
|
if (sizeBytes != null) 'size_bytes': sizeBytes,
|
|
if (width != null) 'width': width,
|
|
if (height != null) 'height': height,
|
|
if (durationMs != null) 'duration_ms': durationMs,
|
|
if (checksum != null) 'checksum': checksum,
|
|
if (remoteUri != null) 'remote_uri': remoteUri,
|
|
if (thumbnailLocalUri != null) 'thumbnail_local_uri': thumbnailLocalUri,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
MediaAssetsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? kind,
|
|
Value<String>? localUri,
|
|
Value<String?>? mimeType,
|
|
Value<int?>? sizeBytes,
|
|
Value<int?>? width,
|
|
Value<int?>? height,
|
|
Value<int?>? durationMs,
|
|
Value<String?>? checksum,
|
|
Value<String?>? remoteUri,
|
|
Value<String?>? thumbnailLocalUri,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return MediaAssetsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
kind: kind ?? this.kind,
|
|
localUri: localUri ?? this.localUri,
|
|
mimeType: mimeType ?? this.mimeType,
|
|
sizeBytes: sizeBytes ?? this.sizeBytes,
|
|
width: width ?? this.width,
|
|
height: height ?? this.height,
|
|
durationMs: durationMs ?? this.durationMs,
|
|
checksum: checksum ?? this.checksum,
|
|
remoteUri: remoteUri ?? this.remoteUri,
|
|
thumbnailLocalUri: thumbnailLocalUri ?? this.thumbnailLocalUri,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (kind.present) {
|
|
map['kind'] = Variable<String>(kind.value);
|
|
}
|
|
if (localUri.present) {
|
|
map['local_uri'] = Variable<String>(localUri.value);
|
|
}
|
|
if (mimeType.present) {
|
|
map['mime_type'] = Variable<String>(mimeType.value);
|
|
}
|
|
if (sizeBytes.present) {
|
|
map['size_bytes'] = Variable<int>(sizeBytes.value);
|
|
}
|
|
if (width.present) {
|
|
map['width'] = Variable<int>(width.value);
|
|
}
|
|
if (height.present) {
|
|
map['height'] = Variable<int>(height.value);
|
|
}
|
|
if (durationMs.present) {
|
|
map['duration_ms'] = Variable<int>(durationMs.value);
|
|
}
|
|
if (checksum.present) {
|
|
map['checksum'] = Variable<String>(checksum.value);
|
|
}
|
|
if (remoteUri.present) {
|
|
map['remote_uri'] = Variable<String>(remoteUri.value);
|
|
}
|
|
if (thumbnailLocalUri.present) {
|
|
map['thumbnail_local_uri'] = Variable<String>(thumbnailLocalUri.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MediaAssetsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('kind: $kind, ')
|
|
..write('localUri: $localUri, ')
|
|
..write('mimeType: $mimeType, ')
|
|
..write('sizeBytes: $sizeBytes, ')
|
|
..write('width: $width, ')
|
|
..write('height: $height, ')
|
|
..write('durationMs: $durationMs, ')
|
|
..write('checksum: $checksum, ')
|
|
..write('remoteUri: $remoteUri, ')
|
|
..write('thumbnailLocalUri: $thumbnailLocalUri, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ExercisesTable extends Exercises
|
|
with TableInfo<$ExercisesTable, Exercise> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ExercisesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _descriptionMeta = const VerificationMeta(
|
|
'description',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _imageMediaIdMeta = const VerificationMeta(
|
|
'imageMediaId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> imageMediaId = GeneratedColumn<String>(
|
|
'image_media_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES media_assets (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _videoMediaIdMeta = const VerificationMeta(
|
|
'videoMediaId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> videoMediaId = GeneratedColumn<String>(
|
|
'video_media_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES media_assets (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _hasTimeMeasureMeta = const VerificationMeta(
|
|
'hasTimeMeasure',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> hasTimeMeasure = GeneratedColumn<bool>(
|
|
'has_time_measure',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("has_time_measure" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _hasRepsMeasureMeta = const VerificationMeta(
|
|
'hasRepsMeasure',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> hasRepsMeasure = GeneratedColumn<bool>(
|
|
'has_reps_measure',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("has_reps_measure" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _hasScoreMeasureMeta = const VerificationMeta(
|
|
'hasScoreMeasure',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> hasScoreMeasure = GeneratedColumn<bool>(
|
|
'has_score_measure',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("has_score_measure" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _scoreInputModeMeta = const VerificationMeta(
|
|
'scoreInputMode',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreInputMode = GeneratedColumn<String>(
|
|
'score_input_mode',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('manual'),
|
|
);
|
|
static const VerificationMeta _scoreLabelMeta = const VerificationMeta(
|
|
'scoreLabel',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreLabel = GeneratedColumn<String>(
|
|
'score_label',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreUnitMeta = const VerificationMeta(
|
|
'scoreUnit',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreUnit = GeneratedColumn<String>(
|
|
'score_unit',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _archivedAtMeta = const VerificationMeta(
|
|
'archivedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> archivedAt = GeneratedColumn<DateTime>(
|
|
'archived_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
description,
|
|
imageMediaId,
|
|
videoMediaId,
|
|
hasTimeMeasure,
|
|
hasRepsMeasure,
|
|
hasScoreMeasure,
|
|
scoreInputMode,
|
|
scoreLabel,
|
|
scoreUnit,
|
|
archivedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'exercises';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Exercise> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!,
|
|
_descriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('image_media_id')) {
|
|
context.handle(
|
|
_imageMediaIdMeta,
|
|
imageMediaId.isAcceptableOrUnknown(
|
|
data['image_media_id']!,
|
|
_imageMediaIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('video_media_id')) {
|
|
context.handle(
|
|
_videoMediaIdMeta,
|
|
videoMediaId.isAcceptableOrUnknown(
|
|
data['video_media_id']!,
|
|
_videoMediaIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('has_time_measure')) {
|
|
context.handle(
|
|
_hasTimeMeasureMeta,
|
|
hasTimeMeasure.isAcceptableOrUnknown(
|
|
data['has_time_measure']!,
|
|
_hasTimeMeasureMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_hasTimeMeasureMeta);
|
|
}
|
|
if (data.containsKey('has_reps_measure')) {
|
|
context.handle(
|
|
_hasRepsMeasureMeta,
|
|
hasRepsMeasure.isAcceptableOrUnknown(
|
|
data['has_reps_measure']!,
|
|
_hasRepsMeasureMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_hasRepsMeasureMeta);
|
|
}
|
|
if (data.containsKey('has_score_measure')) {
|
|
context.handle(
|
|
_hasScoreMeasureMeta,
|
|
hasScoreMeasure.isAcceptableOrUnknown(
|
|
data['has_score_measure']!,
|
|
_hasScoreMeasureMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_hasScoreMeasureMeta);
|
|
}
|
|
if (data.containsKey('score_input_mode')) {
|
|
context.handle(
|
|
_scoreInputModeMeta,
|
|
scoreInputMode.isAcceptableOrUnknown(
|
|
data['score_input_mode']!,
|
|
_scoreInputModeMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_label')) {
|
|
context.handle(
|
|
_scoreLabelMeta,
|
|
scoreLabel.isAcceptableOrUnknown(data['score_label']!, _scoreLabelMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('score_unit')) {
|
|
context.handle(
|
|
_scoreUnitMeta,
|
|
scoreUnit.isAcceptableOrUnknown(data['score_unit']!, _scoreUnitMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('archived_at')) {
|
|
context.handle(
|
|
_archivedAtMeta,
|
|
archivedAt.isAcceptableOrUnknown(data['archived_at']!, _archivedAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Exercise map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Exercise(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
description: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}description'],
|
|
),
|
|
imageMediaId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}image_media_id'],
|
|
),
|
|
videoMediaId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}video_media_id'],
|
|
),
|
|
hasTimeMeasure: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}has_time_measure'],
|
|
)!,
|
|
hasRepsMeasure: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}has_reps_measure'],
|
|
)!,
|
|
hasScoreMeasure: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}has_score_measure'],
|
|
)!,
|
|
scoreInputMode: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_input_mode'],
|
|
)!,
|
|
scoreLabel: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_label'],
|
|
),
|
|
scoreUnit: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_unit'],
|
|
),
|
|
archivedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}archived_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ExercisesTable createAlias(String alias) {
|
|
return $ExercisesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Exercise extends DataClass implements Insertable<Exercise> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String name;
|
|
final String? description;
|
|
final String? imageMediaId;
|
|
final String? videoMediaId;
|
|
final bool hasTimeMeasure;
|
|
final bool hasRepsMeasure;
|
|
final bool hasScoreMeasure;
|
|
final String scoreInputMode;
|
|
final String? scoreLabel;
|
|
final String? scoreUnit;
|
|
final DateTime? archivedAt;
|
|
const Exercise({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.name,
|
|
this.description,
|
|
this.imageMediaId,
|
|
this.videoMediaId,
|
|
required this.hasTimeMeasure,
|
|
required this.hasRepsMeasure,
|
|
required this.hasScoreMeasure,
|
|
required this.scoreInputMode,
|
|
this.scoreLabel,
|
|
this.scoreUnit,
|
|
this.archivedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
if (!nullToAbsent || imageMediaId != null) {
|
|
map['image_media_id'] = Variable<String>(imageMediaId);
|
|
}
|
|
if (!nullToAbsent || videoMediaId != null) {
|
|
map['video_media_id'] = Variable<String>(videoMediaId);
|
|
}
|
|
map['has_time_measure'] = Variable<bool>(hasTimeMeasure);
|
|
map['has_reps_measure'] = Variable<bool>(hasRepsMeasure);
|
|
map['has_score_measure'] = Variable<bool>(hasScoreMeasure);
|
|
map['score_input_mode'] = Variable<String>(scoreInputMode);
|
|
if (!nullToAbsent || scoreLabel != null) {
|
|
map['score_label'] = Variable<String>(scoreLabel);
|
|
}
|
|
if (!nullToAbsent || scoreUnit != null) {
|
|
map['score_unit'] = Variable<String>(scoreUnit);
|
|
}
|
|
if (!nullToAbsent || archivedAt != null) {
|
|
map['archived_at'] = Variable<DateTime>(archivedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ExercisesCompanion toCompanion(bool nullToAbsent) {
|
|
return ExercisesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
name: Value(name),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
imageMediaId: imageMediaId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(imageMediaId),
|
|
videoMediaId: videoMediaId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(videoMediaId),
|
|
hasTimeMeasure: Value(hasTimeMeasure),
|
|
hasRepsMeasure: Value(hasRepsMeasure),
|
|
hasScoreMeasure: Value(hasScoreMeasure),
|
|
scoreInputMode: Value(scoreInputMode),
|
|
scoreLabel: scoreLabel == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreLabel),
|
|
scoreUnit: scoreUnit == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreUnit),
|
|
archivedAt: archivedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(archivedAt),
|
|
);
|
|
}
|
|
|
|
factory Exercise.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Exercise(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
imageMediaId: serializer.fromJson<String?>(json['imageMediaId']),
|
|
videoMediaId: serializer.fromJson<String?>(json['videoMediaId']),
|
|
hasTimeMeasure: serializer.fromJson<bool>(json['hasTimeMeasure']),
|
|
hasRepsMeasure: serializer.fromJson<bool>(json['hasRepsMeasure']),
|
|
hasScoreMeasure: serializer.fromJson<bool>(json['hasScoreMeasure']),
|
|
scoreInputMode: serializer.fromJson<String>(json['scoreInputMode']),
|
|
scoreLabel: serializer.fromJson<String?>(json['scoreLabel']),
|
|
scoreUnit: serializer.fromJson<String?>(json['scoreUnit']),
|
|
archivedAt: serializer.fromJson<DateTime?>(json['archivedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'name': serializer.toJson<String>(name),
|
|
'description': serializer.toJson<String?>(description),
|
|
'imageMediaId': serializer.toJson<String?>(imageMediaId),
|
|
'videoMediaId': serializer.toJson<String?>(videoMediaId),
|
|
'hasTimeMeasure': serializer.toJson<bool>(hasTimeMeasure),
|
|
'hasRepsMeasure': serializer.toJson<bool>(hasRepsMeasure),
|
|
'hasScoreMeasure': serializer.toJson<bool>(hasScoreMeasure),
|
|
'scoreInputMode': serializer.toJson<String>(scoreInputMode),
|
|
'scoreLabel': serializer.toJson<String?>(scoreLabel),
|
|
'scoreUnit': serializer.toJson<String?>(scoreUnit),
|
|
'archivedAt': serializer.toJson<DateTime?>(archivedAt),
|
|
};
|
|
}
|
|
|
|
Exercise copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? name,
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> imageMediaId = const Value.absent(),
|
|
Value<String?> videoMediaId = const Value.absent(),
|
|
bool? hasTimeMeasure,
|
|
bool? hasRepsMeasure,
|
|
bool? hasScoreMeasure,
|
|
String? scoreInputMode,
|
|
Value<String?> scoreLabel = const Value.absent(),
|
|
Value<String?> scoreUnit = const Value.absent(),
|
|
Value<DateTime?> archivedAt = const Value.absent(),
|
|
}) => Exercise(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: name ?? this.name,
|
|
description: description.present ? description.value : this.description,
|
|
imageMediaId: imageMediaId.present ? imageMediaId.value : this.imageMediaId,
|
|
videoMediaId: videoMediaId.present ? videoMediaId.value : this.videoMediaId,
|
|
hasTimeMeasure: hasTimeMeasure ?? this.hasTimeMeasure,
|
|
hasRepsMeasure: hasRepsMeasure ?? this.hasRepsMeasure,
|
|
hasScoreMeasure: hasScoreMeasure ?? this.hasScoreMeasure,
|
|
scoreInputMode: scoreInputMode ?? this.scoreInputMode,
|
|
scoreLabel: scoreLabel.present ? scoreLabel.value : this.scoreLabel,
|
|
scoreUnit: scoreUnit.present ? scoreUnit.value : this.scoreUnit,
|
|
archivedAt: archivedAt.present ? archivedAt.value : this.archivedAt,
|
|
);
|
|
Exercise copyWithCompanion(ExercisesCompanion data) {
|
|
return Exercise(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
description: data.description.present
|
|
? data.description.value
|
|
: this.description,
|
|
imageMediaId: data.imageMediaId.present
|
|
? data.imageMediaId.value
|
|
: this.imageMediaId,
|
|
videoMediaId: data.videoMediaId.present
|
|
? data.videoMediaId.value
|
|
: this.videoMediaId,
|
|
hasTimeMeasure: data.hasTimeMeasure.present
|
|
? data.hasTimeMeasure.value
|
|
: this.hasTimeMeasure,
|
|
hasRepsMeasure: data.hasRepsMeasure.present
|
|
? data.hasRepsMeasure.value
|
|
: this.hasRepsMeasure,
|
|
hasScoreMeasure: data.hasScoreMeasure.present
|
|
? data.hasScoreMeasure.value
|
|
: this.hasScoreMeasure,
|
|
scoreInputMode: data.scoreInputMode.present
|
|
? data.scoreInputMode.value
|
|
: this.scoreInputMode,
|
|
scoreLabel: data.scoreLabel.present
|
|
? data.scoreLabel.value
|
|
: this.scoreLabel,
|
|
scoreUnit: data.scoreUnit.present ? data.scoreUnit.value : this.scoreUnit,
|
|
archivedAt: data.archivedAt.present
|
|
? data.archivedAt.value
|
|
: this.archivedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Exercise(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('imageMediaId: $imageMediaId, ')
|
|
..write('videoMediaId: $videoMediaId, ')
|
|
..write('hasTimeMeasure: $hasTimeMeasure, ')
|
|
..write('hasRepsMeasure: $hasRepsMeasure, ')
|
|
..write('hasScoreMeasure: $hasScoreMeasure, ')
|
|
..write('scoreInputMode: $scoreInputMode, ')
|
|
..write('scoreLabel: $scoreLabel, ')
|
|
..write('scoreUnit: $scoreUnit, ')
|
|
..write('archivedAt: $archivedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
description,
|
|
imageMediaId,
|
|
videoMediaId,
|
|
hasTimeMeasure,
|
|
hasRepsMeasure,
|
|
hasScoreMeasure,
|
|
scoreInputMode,
|
|
scoreLabel,
|
|
scoreUnit,
|
|
archivedAt,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Exercise &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.name == this.name &&
|
|
other.description == this.description &&
|
|
other.imageMediaId == this.imageMediaId &&
|
|
other.videoMediaId == this.videoMediaId &&
|
|
other.hasTimeMeasure == this.hasTimeMeasure &&
|
|
other.hasRepsMeasure == this.hasRepsMeasure &&
|
|
other.hasScoreMeasure == this.hasScoreMeasure &&
|
|
other.scoreInputMode == this.scoreInputMode &&
|
|
other.scoreLabel == this.scoreLabel &&
|
|
other.scoreUnit == this.scoreUnit &&
|
|
other.archivedAt == this.archivedAt);
|
|
}
|
|
|
|
class ExercisesCompanion extends UpdateCompanion<Exercise> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> name;
|
|
final Value<String?> description;
|
|
final Value<String?> imageMediaId;
|
|
final Value<String?> videoMediaId;
|
|
final Value<bool> hasTimeMeasure;
|
|
final Value<bool> hasRepsMeasure;
|
|
final Value<bool> hasScoreMeasure;
|
|
final Value<String> scoreInputMode;
|
|
final Value<String?> scoreLabel;
|
|
final Value<String?> scoreUnit;
|
|
final Value<DateTime?> archivedAt;
|
|
final Value<int> rowid;
|
|
const ExercisesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.imageMediaId = const Value.absent(),
|
|
this.videoMediaId = const Value.absent(),
|
|
this.hasTimeMeasure = const Value.absent(),
|
|
this.hasRepsMeasure = const Value.absent(),
|
|
this.hasScoreMeasure = const Value.absent(),
|
|
this.scoreInputMode = const Value.absent(),
|
|
this.scoreLabel = const Value.absent(),
|
|
this.scoreUnit = const Value.absent(),
|
|
this.archivedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ExercisesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String name,
|
|
this.description = const Value.absent(),
|
|
this.imageMediaId = const Value.absent(),
|
|
this.videoMediaId = const Value.absent(),
|
|
required bool hasTimeMeasure,
|
|
required bool hasRepsMeasure,
|
|
required bool hasScoreMeasure,
|
|
this.scoreInputMode = const Value.absent(),
|
|
this.scoreLabel = const Value.absent(),
|
|
this.scoreUnit = const Value.absent(),
|
|
this.archivedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
name = Value(name),
|
|
hasTimeMeasure = Value(hasTimeMeasure),
|
|
hasRepsMeasure = Value(hasRepsMeasure),
|
|
hasScoreMeasure = Value(hasScoreMeasure);
|
|
static Insertable<Exercise> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? name,
|
|
Expression<String>? description,
|
|
Expression<String>? imageMediaId,
|
|
Expression<String>? videoMediaId,
|
|
Expression<bool>? hasTimeMeasure,
|
|
Expression<bool>? hasRepsMeasure,
|
|
Expression<bool>? hasScoreMeasure,
|
|
Expression<String>? scoreInputMode,
|
|
Expression<String>? scoreLabel,
|
|
Expression<String>? scoreUnit,
|
|
Expression<DateTime>? archivedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (name != null) 'name': name,
|
|
if (description != null) 'description': description,
|
|
if (imageMediaId != null) 'image_media_id': imageMediaId,
|
|
if (videoMediaId != null) 'video_media_id': videoMediaId,
|
|
if (hasTimeMeasure != null) 'has_time_measure': hasTimeMeasure,
|
|
if (hasRepsMeasure != null) 'has_reps_measure': hasRepsMeasure,
|
|
if (hasScoreMeasure != null) 'has_score_measure': hasScoreMeasure,
|
|
if (scoreInputMode != null) 'score_input_mode': scoreInputMode,
|
|
if (scoreLabel != null) 'score_label': scoreLabel,
|
|
if (scoreUnit != null) 'score_unit': scoreUnit,
|
|
if (archivedAt != null) 'archived_at': archivedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ExercisesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? name,
|
|
Value<String?>? description,
|
|
Value<String?>? imageMediaId,
|
|
Value<String?>? videoMediaId,
|
|
Value<bool>? hasTimeMeasure,
|
|
Value<bool>? hasRepsMeasure,
|
|
Value<bool>? hasScoreMeasure,
|
|
Value<String>? scoreInputMode,
|
|
Value<String?>? scoreLabel,
|
|
Value<String?>? scoreUnit,
|
|
Value<DateTime?>? archivedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ExercisesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
name: name ?? this.name,
|
|
description: description ?? this.description,
|
|
imageMediaId: imageMediaId ?? this.imageMediaId,
|
|
videoMediaId: videoMediaId ?? this.videoMediaId,
|
|
hasTimeMeasure: hasTimeMeasure ?? this.hasTimeMeasure,
|
|
hasRepsMeasure: hasRepsMeasure ?? this.hasRepsMeasure,
|
|
hasScoreMeasure: hasScoreMeasure ?? this.hasScoreMeasure,
|
|
scoreInputMode: scoreInputMode ?? this.scoreInputMode,
|
|
scoreLabel: scoreLabel ?? this.scoreLabel,
|
|
scoreUnit: scoreUnit ?? this.scoreUnit,
|
|
archivedAt: archivedAt ?? this.archivedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (imageMediaId.present) {
|
|
map['image_media_id'] = Variable<String>(imageMediaId.value);
|
|
}
|
|
if (videoMediaId.present) {
|
|
map['video_media_id'] = Variable<String>(videoMediaId.value);
|
|
}
|
|
if (hasTimeMeasure.present) {
|
|
map['has_time_measure'] = Variable<bool>(hasTimeMeasure.value);
|
|
}
|
|
if (hasRepsMeasure.present) {
|
|
map['has_reps_measure'] = Variable<bool>(hasRepsMeasure.value);
|
|
}
|
|
if (hasScoreMeasure.present) {
|
|
map['has_score_measure'] = Variable<bool>(hasScoreMeasure.value);
|
|
}
|
|
if (scoreInputMode.present) {
|
|
map['score_input_mode'] = Variable<String>(scoreInputMode.value);
|
|
}
|
|
if (scoreLabel.present) {
|
|
map['score_label'] = Variable<String>(scoreLabel.value);
|
|
}
|
|
if (scoreUnit.present) {
|
|
map['score_unit'] = Variable<String>(scoreUnit.value);
|
|
}
|
|
if (archivedAt.present) {
|
|
map['archived_at'] = Variable<DateTime>(archivedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ExercisesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('imageMediaId: $imageMediaId, ')
|
|
..write('videoMediaId: $videoMediaId, ')
|
|
..write('hasTimeMeasure: $hasTimeMeasure, ')
|
|
..write('hasRepsMeasure: $hasRepsMeasure, ')
|
|
..write('hasScoreMeasure: $hasScoreMeasure, ')
|
|
..write('scoreInputMode: $scoreInputMode, ')
|
|
..write('scoreLabel: $scoreLabel, ')
|
|
..write('scoreUnit: $scoreUnit, ')
|
|
..write('archivedAt: $archivedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ProgramsTable extends Programs with TableInfo<$ProgramsTable, Program> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProgramsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _defaultRestSecondsMeta =
|
|
const VerificationMeta('defaultRestSeconds');
|
|
@override
|
|
late final GeneratedColumn<int> defaultRestSeconds = GeneratedColumn<int>(
|
|
'default_rest_seconds',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
defaultRestSeconds,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'programs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Program> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('default_rest_seconds')) {
|
|
context.handle(
|
|
_defaultRestSecondsMeta,
|
|
defaultRestSeconds.isAcceptableOrUnknown(
|
|
data['default_rest_seconds']!,
|
|
_defaultRestSecondsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_defaultRestSecondsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Program map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Program(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
defaultRestSeconds: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}default_rest_seconds'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProgramsTable createAlias(String alias) {
|
|
return $ProgramsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Program extends DataClass implements Insertable<Program> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String name;
|
|
final int defaultRestSeconds;
|
|
const Program({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.name,
|
|
required this.defaultRestSeconds,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['name'] = Variable<String>(name);
|
|
map['default_rest_seconds'] = Variable<int>(defaultRestSeconds);
|
|
return map;
|
|
}
|
|
|
|
ProgramsCompanion toCompanion(bool nullToAbsent) {
|
|
return ProgramsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
name: Value(name),
|
|
defaultRestSeconds: Value(defaultRestSeconds),
|
|
);
|
|
}
|
|
|
|
factory Program.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Program(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
defaultRestSeconds: serializer.fromJson<int>(json['defaultRestSeconds']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'name': serializer.toJson<String>(name),
|
|
'defaultRestSeconds': serializer.toJson<int>(defaultRestSeconds),
|
|
};
|
|
}
|
|
|
|
Program copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? name,
|
|
int? defaultRestSeconds,
|
|
}) => Program(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: name ?? this.name,
|
|
defaultRestSeconds: defaultRestSeconds ?? this.defaultRestSeconds,
|
|
);
|
|
Program copyWithCompanion(ProgramsCompanion data) {
|
|
return Program(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
defaultRestSeconds: data.defaultRestSeconds.present
|
|
? data.defaultRestSeconds.value
|
|
: this.defaultRestSeconds,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Program(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('defaultRestSeconds: $defaultRestSeconds')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
name,
|
|
defaultRestSeconds,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Program &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.name == this.name &&
|
|
other.defaultRestSeconds == this.defaultRestSeconds);
|
|
}
|
|
|
|
class ProgramsCompanion extends UpdateCompanion<Program> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> name;
|
|
final Value<int> defaultRestSeconds;
|
|
final Value<int> rowid;
|
|
const ProgramsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.defaultRestSeconds = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProgramsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String name,
|
|
required int defaultRestSeconds,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
name = Value(name),
|
|
defaultRestSeconds = Value(defaultRestSeconds);
|
|
static Insertable<Program> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? name,
|
|
Expression<int>? defaultRestSeconds,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (name != null) 'name': name,
|
|
if (defaultRestSeconds != null)
|
|
'default_rest_seconds': defaultRestSeconds,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProgramsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? name,
|
|
Value<int>? defaultRestSeconds,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProgramsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
name: name ?? this.name,
|
|
defaultRestSeconds: defaultRestSeconds ?? this.defaultRestSeconds,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (defaultRestSeconds.present) {
|
|
map['default_rest_seconds'] = Variable<int>(defaultRestSeconds.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('name: $name, ')
|
|
..write('defaultRestSeconds: $defaultRestSeconds, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ProgramExercisesTable extends ProgramExercises
|
|
with TableInfo<$ProgramExercisesTable, ProgramExercise> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProgramExercisesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _programIdMeta = const VerificationMeta(
|
|
'programId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> programId = GeneratedColumn<String>(
|
|
'program_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES programs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _sourceExerciseIdMeta = const VerificationMeta(
|
|
'sourceExerciseId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sourceExerciseId = GeneratedColumn<String>(
|
|
'source_exercise_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES exercises (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _positionMeta = const VerificationMeta(
|
|
'position',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseNameSnapshotMeta =
|
|
const VerificationMeta('exerciseNameSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseNameSnapshot =
|
|
GeneratedColumn<String>(
|
|
'exercise_name_snapshot',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseDescriptionSnapshotMeta =
|
|
const VerificationMeta('exerciseDescriptionSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseDescriptionSnapshot =
|
|
GeneratedColumn<String>(
|
|
'exercise_description_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _exerciseImageMediaIdSnapshotMeta =
|
|
const VerificationMeta('exerciseImageMediaIdSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseImageMediaIdSnapshot =
|
|
GeneratedColumn<String>(
|
|
'exercise_image_media_id_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES media_assets (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _exerciseVideoMediaIdSnapshotMeta =
|
|
const VerificationMeta('exerciseVideoMediaIdSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseVideoMediaIdSnapshot =
|
|
GeneratedColumn<String>(
|
|
'exercise_video_media_id_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES media_assets (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _exerciseArchivedSnapshotMeta =
|
|
const VerificationMeta('exerciseArchivedSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> exerciseArchivedSnapshot =
|
|
GeneratedColumn<bool>(
|
|
'exercise_archived_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("exercise_archived_snapshot" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _availableTimeSnapshotMeta =
|
|
const VerificationMeta('availableTimeSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> availableTimeSnapshot =
|
|
GeneratedColumn<bool>(
|
|
'available_time_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("available_time_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _availableRepsSnapshotMeta =
|
|
const VerificationMeta('availableRepsSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> availableRepsSnapshot =
|
|
GeneratedColumn<bool>(
|
|
'available_reps_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("available_reps_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _availableScoreSnapshotMeta =
|
|
const VerificationMeta('availableScoreSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> availableScoreSnapshot =
|
|
GeneratedColumn<bool>(
|
|
'available_score_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("available_score_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _scoreInputModeSnapshotMeta =
|
|
const VerificationMeta('scoreInputModeSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreInputModeSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_input_mode_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('manual'),
|
|
);
|
|
static const VerificationMeta _scoreLabelSnapshotMeta =
|
|
const VerificationMeta('scoreLabelSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreLabelSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_label_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreUnitSnapshotMeta = const VerificationMeta(
|
|
'scoreUnitSnapshot',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreUnitSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_unit_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _setsCountMeta = const VerificationMeta(
|
|
'setsCount',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> setsCount = GeneratedColumn<int>(
|
|
'sets_count',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _timeEnabledMeta = const VerificationMeta(
|
|
'timeEnabled',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> timeEnabled = GeneratedColumn<bool>(
|
|
'time_enabled',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("time_enabled" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _repsEnabledMeta = const VerificationMeta(
|
|
'repsEnabled',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> repsEnabled = GeneratedColumn<bool>(
|
|
'reps_enabled',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("reps_enabled" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _scoreEnabledMeta = const VerificationMeta(
|
|
'scoreEnabled',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> scoreEnabled = GeneratedColumn<bool>(
|
|
'score_enabled',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("score_enabled" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _targetTimeSecondsMeta = const VerificationMeta(
|
|
'targetTimeSeconds',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> targetTimeSeconds = GeneratedColumn<int>(
|
|
'target_time_seconds',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetRepsMeta = const VerificationMeta(
|
|
'targetReps',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> targetReps = GeneratedColumn<int>(
|
|
'target_reps',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreMeta = const VerificationMeta(
|
|
'targetScore',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> targetScore = GeneratedColumn<double>(
|
|
'target_score',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreTimeMsMeta = const VerificationMeta(
|
|
'targetScoreTimeMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> targetScoreTimeMs = GeneratedColumn<int>(
|
|
'target_score_time_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _restSecondsOverrideMeta =
|
|
const VerificationMeta('restSecondsOverride');
|
|
@override
|
|
late final GeneratedColumn<int> restSecondsOverride = GeneratedColumn<int>(
|
|
'rest_seconds_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
programId,
|
|
sourceExerciseId,
|
|
position,
|
|
exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot,
|
|
availableTimeSnapshot,
|
|
availableRepsSnapshot,
|
|
availableScoreSnapshot,
|
|
scoreInputModeSnapshot,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
setsCount,
|
|
timeEnabled,
|
|
repsEnabled,
|
|
scoreEnabled,
|
|
targetTimeSeconds,
|
|
targetReps,
|
|
targetScore,
|
|
targetScoreTimeMs,
|
|
restSecondsOverride,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'program_exercises';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ProgramExercise> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('program_id')) {
|
|
context.handle(
|
|
_programIdMeta,
|
|
programId.isAcceptableOrUnknown(data['program_id']!, _programIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIdMeta);
|
|
}
|
|
if (data.containsKey('source_exercise_id')) {
|
|
context.handle(
|
|
_sourceExerciseIdMeta,
|
|
sourceExerciseId.isAcceptableOrUnknown(
|
|
data['source_exercise_id']!,
|
|
_sourceExerciseIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('position')) {
|
|
context.handle(
|
|
_positionMeta,
|
|
position.isAcceptableOrUnknown(data['position']!, _positionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMeta);
|
|
}
|
|
if (data.containsKey('exercise_name_snapshot')) {
|
|
context.handle(
|
|
_exerciseNameSnapshotMeta,
|
|
exerciseNameSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_name_snapshot']!,
|
|
_exerciseNameSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseNameSnapshotMeta);
|
|
}
|
|
if (data.containsKey('exercise_description_snapshot')) {
|
|
context.handle(
|
|
_exerciseDescriptionSnapshotMeta,
|
|
exerciseDescriptionSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_description_snapshot']!,
|
|
_exerciseDescriptionSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('exercise_image_media_id_snapshot')) {
|
|
context.handle(
|
|
_exerciseImageMediaIdSnapshotMeta,
|
|
exerciseImageMediaIdSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_image_media_id_snapshot']!,
|
|
_exerciseImageMediaIdSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('exercise_video_media_id_snapshot')) {
|
|
context.handle(
|
|
_exerciseVideoMediaIdSnapshotMeta,
|
|
exerciseVideoMediaIdSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_video_media_id_snapshot']!,
|
|
_exerciseVideoMediaIdSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('exercise_archived_snapshot')) {
|
|
context.handle(
|
|
_exerciseArchivedSnapshotMeta,
|
|
exerciseArchivedSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_archived_snapshot']!,
|
|
_exerciseArchivedSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('available_time_snapshot')) {
|
|
context.handle(
|
|
_availableTimeSnapshotMeta,
|
|
availableTimeSnapshot.isAcceptableOrUnknown(
|
|
data['available_time_snapshot']!,
|
|
_availableTimeSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_availableTimeSnapshotMeta);
|
|
}
|
|
if (data.containsKey('available_reps_snapshot')) {
|
|
context.handle(
|
|
_availableRepsSnapshotMeta,
|
|
availableRepsSnapshot.isAcceptableOrUnknown(
|
|
data['available_reps_snapshot']!,
|
|
_availableRepsSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_availableRepsSnapshotMeta);
|
|
}
|
|
if (data.containsKey('available_score_snapshot')) {
|
|
context.handle(
|
|
_availableScoreSnapshotMeta,
|
|
availableScoreSnapshot.isAcceptableOrUnknown(
|
|
data['available_score_snapshot']!,
|
|
_availableScoreSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_availableScoreSnapshotMeta);
|
|
}
|
|
if (data.containsKey('score_input_mode_snapshot')) {
|
|
context.handle(
|
|
_scoreInputModeSnapshotMeta,
|
|
scoreInputModeSnapshot.isAcceptableOrUnknown(
|
|
data['score_input_mode_snapshot']!,
|
|
_scoreInputModeSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_label_snapshot')) {
|
|
context.handle(
|
|
_scoreLabelSnapshotMeta,
|
|
scoreLabelSnapshot.isAcceptableOrUnknown(
|
|
data['score_label_snapshot']!,
|
|
_scoreLabelSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_unit_snapshot')) {
|
|
context.handle(
|
|
_scoreUnitSnapshotMeta,
|
|
scoreUnitSnapshot.isAcceptableOrUnknown(
|
|
data['score_unit_snapshot']!,
|
|
_scoreUnitSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sets_count')) {
|
|
context.handle(
|
|
_setsCountMeta,
|
|
setsCount.isAcceptableOrUnknown(data['sets_count']!, _setsCountMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_setsCountMeta);
|
|
}
|
|
if (data.containsKey('time_enabled')) {
|
|
context.handle(
|
|
_timeEnabledMeta,
|
|
timeEnabled.isAcceptableOrUnknown(
|
|
data['time_enabled']!,
|
|
_timeEnabledMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_timeEnabledMeta);
|
|
}
|
|
if (data.containsKey('reps_enabled')) {
|
|
context.handle(
|
|
_repsEnabledMeta,
|
|
repsEnabled.isAcceptableOrUnknown(
|
|
data['reps_enabled']!,
|
|
_repsEnabledMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_repsEnabledMeta);
|
|
}
|
|
if (data.containsKey('score_enabled')) {
|
|
context.handle(
|
|
_scoreEnabledMeta,
|
|
scoreEnabled.isAcceptableOrUnknown(
|
|
data['score_enabled']!,
|
|
_scoreEnabledMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_scoreEnabledMeta);
|
|
}
|
|
if (data.containsKey('target_time_seconds')) {
|
|
context.handle(
|
|
_targetTimeSecondsMeta,
|
|
targetTimeSeconds.isAcceptableOrUnknown(
|
|
data['target_time_seconds']!,
|
|
_targetTimeSecondsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_reps')) {
|
|
context.handle(
|
|
_targetRepsMeta,
|
|
targetReps.isAcceptableOrUnknown(data['target_reps']!, _targetRepsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score')) {
|
|
context.handle(
|
|
_targetScoreMeta,
|
|
targetScore.isAcceptableOrUnknown(
|
|
data['target_score']!,
|
|
_targetScoreMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score_time_ms')) {
|
|
context.handle(
|
|
_targetScoreTimeMsMeta,
|
|
targetScoreTimeMs.isAcceptableOrUnknown(
|
|
data['target_score_time_ms']!,
|
|
_targetScoreTimeMsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('rest_seconds_override')) {
|
|
context.handle(
|
|
_restSecondsOverrideMeta,
|
|
restSecondsOverride.isAcceptableOrUnknown(
|
|
data['rest_seconds_override']!,
|
|
_restSecondsOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ProgramExercise map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ProgramExercise(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
programId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_id'],
|
|
)!,
|
|
sourceExerciseId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_exercise_id'],
|
|
),
|
|
position: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position'],
|
|
)!,
|
|
exerciseNameSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_name_snapshot'],
|
|
)!,
|
|
exerciseDescriptionSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_description_snapshot'],
|
|
),
|
|
exerciseImageMediaIdSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_image_media_id_snapshot'],
|
|
),
|
|
exerciseVideoMediaIdSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_video_media_id_snapshot'],
|
|
),
|
|
exerciseArchivedSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}exercise_archived_snapshot'],
|
|
)!,
|
|
availableTimeSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}available_time_snapshot'],
|
|
)!,
|
|
availableRepsSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}available_reps_snapshot'],
|
|
)!,
|
|
availableScoreSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}available_score_snapshot'],
|
|
)!,
|
|
scoreInputModeSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_input_mode_snapshot'],
|
|
)!,
|
|
scoreLabelSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_label_snapshot'],
|
|
),
|
|
scoreUnitSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_unit_snapshot'],
|
|
),
|
|
setsCount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sets_count'],
|
|
)!,
|
|
timeEnabled: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}time_enabled'],
|
|
)!,
|
|
repsEnabled: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}reps_enabled'],
|
|
)!,
|
|
scoreEnabled: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}score_enabled'],
|
|
)!,
|
|
targetTimeSeconds: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_time_seconds'],
|
|
),
|
|
targetReps: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_reps'],
|
|
),
|
|
targetScore: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}target_score'],
|
|
),
|
|
targetScoreTimeMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_score_time_ms'],
|
|
),
|
|
restSecondsOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}rest_seconds_override'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProgramExercisesTable createAlias(String alias) {
|
|
return $ProgramExercisesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ProgramExercise extends DataClass implements Insertable<ProgramExercise> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String programId;
|
|
final String? sourceExerciseId;
|
|
final int position;
|
|
final String exerciseNameSnapshot;
|
|
final String? exerciseDescriptionSnapshot;
|
|
final String? exerciseImageMediaIdSnapshot;
|
|
final String? exerciseVideoMediaIdSnapshot;
|
|
final bool exerciseArchivedSnapshot;
|
|
final bool availableTimeSnapshot;
|
|
final bool availableRepsSnapshot;
|
|
final bool availableScoreSnapshot;
|
|
final String scoreInputModeSnapshot;
|
|
final String? scoreLabelSnapshot;
|
|
final String? scoreUnitSnapshot;
|
|
final int setsCount;
|
|
final bool timeEnabled;
|
|
final bool repsEnabled;
|
|
final bool scoreEnabled;
|
|
final int? targetTimeSeconds;
|
|
final int? targetReps;
|
|
final double? targetScore;
|
|
final int? targetScoreTimeMs;
|
|
final int? restSecondsOverride;
|
|
const ProgramExercise({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.programId,
|
|
this.sourceExerciseId,
|
|
required this.position,
|
|
required this.exerciseNameSnapshot,
|
|
this.exerciseDescriptionSnapshot,
|
|
this.exerciseImageMediaIdSnapshot,
|
|
this.exerciseVideoMediaIdSnapshot,
|
|
required this.exerciseArchivedSnapshot,
|
|
required this.availableTimeSnapshot,
|
|
required this.availableRepsSnapshot,
|
|
required this.availableScoreSnapshot,
|
|
required this.scoreInputModeSnapshot,
|
|
this.scoreLabelSnapshot,
|
|
this.scoreUnitSnapshot,
|
|
required this.setsCount,
|
|
required this.timeEnabled,
|
|
required this.repsEnabled,
|
|
required this.scoreEnabled,
|
|
this.targetTimeSeconds,
|
|
this.targetReps,
|
|
this.targetScore,
|
|
this.targetScoreTimeMs,
|
|
this.restSecondsOverride,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['program_id'] = Variable<String>(programId);
|
|
if (!nullToAbsent || sourceExerciseId != null) {
|
|
map['source_exercise_id'] = Variable<String>(sourceExerciseId);
|
|
}
|
|
map['position'] = Variable<int>(position);
|
|
map['exercise_name_snapshot'] = Variable<String>(exerciseNameSnapshot);
|
|
if (!nullToAbsent || exerciseDescriptionSnapshot != null) {
|
|
map['exercise_description_snapshot'] = Variable<String>(
|
|
exerciseDescriptionSnapshot,
|
|
);
|
|
}
|
|
if (!nullToAbsent || exerciseImageMediaIdSnapshot != null) {
|
|
map['exercise_image_media_id_snapshot'] = Variable<String>(
|
|
exerciseImageMediaIdSnapshot,
|
|
);
|
|
}
|
|
if (!nullToAbsent || exerciseVideoMediaIdSnapshot != null) {
|
|
map['exercise_video_media_id_snapshot'] = Variable<String>(
|
|
exerciseVideoMediaIdSnapshot,
|
|
);
|
|
}
|
|
map['exercise_archived_snapshot'] = Variable<bool>(
|
|
exerciseArchivedSnapshot,
|
|
);
|
|
map['available_time_snapshot'] = Variable<bool>(availableTimeSnapshot);
|
|
map['available_reps_snapshot'] = Variable<bool>(availableRepsSnapshot);
|
|
map['available_score_snapshot'] = Variable<bool>(availableScoreSnapshot);
|
|
map['score_input_mode_snapshot'] = Variable<String>(scoreInputModeSnapshot);
|
|
if (!nullToAbsent || scoreLabelSnapshot != null) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot);
|
|
}
|
|
if (!nullToAbsent || scoreUnitSnapshot != null) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot);
|
|
}
|
|
map['sets_count'] = Variable<int>(setsCount);
|
|
map['time_enabled'] = Variable<bool>(timeEnabled);
|
|
map['reps_enabled'] = Variable<bool>(repsEnabled);
|
|
map['score_enabled'] = Variable<bool>(scoreEnabled);
|
|
if (!nullToAbsent || targetTimeSeconds != null) {
|
|
map['target_time_seconds'] = Variable<int>(targetTimeSeconds);
|
|
}
|
|
if (!nullToAbsent || targetReps != null) {
|
|
map['target_reps'] = Variable<int>(targetReps);
|
|
}
|
|
if (!nullToAbsent || targetScore != null) {
|
|
map['target_score'] = Variable<double>(targetScore);
|
|
}
|
|
if (!nullToAbsent || targetScoreTimeMs != null) {
|
|
map['target_score_time_ms'] = Variable<int>(targetScoreTimeMs);
|
|
}
|
|
if (!nullToAbsent || restSecondsOverride != null) {
|
|
map['rest_seconds_override'] = Variable<int>(restSecondsOverride);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ProgramExercisesCompanion toCompanion(bool nullToAbsent) {
|
|
return ProgramExercisesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
programId: Value(programId),
|
|
sourceExerciseId: sourceExerciseId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceExerciseId),
|
|
position: Value(position),
|
|
exerciseNameSnapshot: Value(exerciseNameSnapshot),
|
|
exerciseDescriptionSnapshot:
|
|
exerciseDescriptionSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(exerciseDescriptionSnapshot),
|
|
exerciseImageMediaIdSnapshot:
|
|
exerciseImageMediaIdSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(exerciseImageMediaIdSnapshot),
|
|
exerciseVideoMediaIdSnapshot:
|
|
exerciseVideoMediaIdSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(exerciseVideoMediaIdSnapshot),
|
|
exerciseArchivedSnapshot: Value(exerciseArchivedSnapshot),
|
|
availableTimeSnapshot: Value(availableTimeSnapshot),
|
|
availableRepsSnapshot: Value(availableRepsSnapshot),
|
|
availableScoreSnapshot: Value(availableScoreSnapshot),
|
|
scoreInputModeSnapshot: Value(scoreInputModeSnapshot),
|
|
scoreLabelSnapshot: scoreLabelSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreLabelSnapshot),
|
|
scoreUnitSnapshot: scoreUnitSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreUnitSnapshot),
|
|
setsCount: Value(setsCount),
|
|
timeEnabled: Value(timeEnabled),
|
|
repsEnabled: Value(repsEnabled),
|
|
scoreEnabled: Value(scoreEnabled),
|
|
targetTimeSeconds: targetTimeSeconds == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetTimeSeconds),
|
|
targetReps: targetReps == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetReps),
|
|
targetScore: targetScore == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScore),
|
|
targetScoreTimeMs: targetScoreTimeMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScoreTimeMs),
|
|
restSecondsOverride: restSecondsOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(restSecondsOverride),
|
|
);
|
|
}
|
|
|
|
factory ProgramExercise.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ProgramExercise(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
programId: serializer.fromJson<String>(json['programId']),
|
|
sourceExerciseId: serializer.fromJson<String?>(json['sourceExerciseId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
exerciseNameSnapshot: serializer.fromJson<String>(
|
|
json['exerciseNameSnapshot'],
|
|
),
|
|
exerciseDescriptionSnapshot: serializer.fromJson<String?>(
|
|
json['exerciseDescriptionSnapshot'],
|
|
),
|
|
exerciseImageMediaIdSnapshot: serializer.fromJson<String?>(
|
|
json['exerciseImageMediaIdSnapshot'],
|
|
),
|
|
exerciseVideoMediaIdSnapshot: serializer.fromJson<String?>(
|
|
json['exerciseVideoMediaIdSnapshot'],
|
|
),
|
|
exerciseArchivedSnapshot: serializer.fromJson<bool>(
|
|
json['exerciseArchivedSnapshot'],
|
|
),
|
|
availableTimeSnapshot: serializer.fromJson<bool>(
|
|
json['availableTimeSnapshot'],
|
|
),
|
|
availableRepsSnapshot: serializer.fromJson<bool>(
|
|
json['availableRepsSnapshot'],
|
|
),
|
|
availableScoreSnapshot: serializer.fromJson<bool>(
|
|
json['availableScoreSnapshot'],
|
|
),
|
|
scoreInputModeSnapshot: serializer.fromJson<String>(
|
|
json['scoreInputModeSnapshot'],
|
|
),
|
|
scoreLabelSnapshot: serializer.fromJson<String?>(
|
|
json['scoreLabelSnapshot'],
|
|
),
|
|
scoreUnitSnapshot: serializer.fromJson<String?>(
|
|
json['scoreUnitSnapshot'],
|
|
),
|
|
setsCount: serializer.fromJson<int>(json['setsCount']),
|
|
timeEnabled: serializer.fromJson<bool>(json['timeEnabled']),
|
|
repsEnabled: serializer.fromJson<bool>(json['repsEnabled']),
|
|
scoreEnabled: serializer.fromJson<bool>(json['scoreEnabled']),
|
|
targetTimeSeconds: serializer.fromJson<int?>(json['targetTimeSeconds']),
|
|
targetReps: serializer.fromJson<int?>(json['targetReps']),
|
|
targetScore: serializer.fromJson<double?>(json['targetScore']),
|
|
targetScoreTimeMs: serializer.fromJson<int?>(json['targetScoreTimeMs']),
|
|
restSecondsOverride: serializer.fromJson<int?>(
|
|
json['restSecondsOverride'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'programId': serializer.toJson<String>(programId),
|
|
'sourceExerciseId': serializer.toJson<String?>(sourceExerciseId),
|
|
'position': serializer.toJson<int>(position),
|
|
'exerciseNameSnapshot': serializer.toJson<String>(exerciseNameSnapshot),
|
|
'exerciseDescriptionSnapshot': serializer.toJson<String?>(
|
|
exerciseDescriptionSnapshot,
|
|
),
|
|
'exerciseImageMediaIdSnapshot': serializer.toJson<String?>(
|
|
exerciseImageMediaIdSnapshot,
|
|
),
|
|
'exerciseVideoMediaIdSnapshot': serializer.toJson<String?>(
|
|
exerciseVideoMediaIdSnapshot,
|
|
),
|
|
'exerciseArchivedSnapshot': serializer.toJson<bool>(
|
|
exerciseArchivedSnapshot,
|
|
),
|
|
'availableTimeSnapshot': serializer.toJson<bool>(availableTimeSnapshot),
|
|
'availableRepsSnapshot': serializer.toJson<bool>(availableRepsSnapshot),
|
|
'availableScoreSnapshot': serializer.toJson<bool>(availableScoreSnapshot),
|
|
'scoreInputModeSnapshot': serializer.toJson<String>(
|
|
scoreInputModeSnapshot,
|
|
),
|
|
'scoreLabelSnapshot': serializer.toJson<String?>(scoreLabelSnapshot),
|
|
'scoreUnitSnapshot': serializer.toJson<String?>(scoreUnitSnapshot),
|
|
'setsCount': serializer.toJson<int>(setsCount),
|
|
'timeEnabled': serializer.toJson<bool>(timeEnabled),
|
|
'repsEnabled': serializer.toJson<bool>(repsEnabled),
|
|
'scoreEnabled': serializer.toJson<bool>(scoreEnabled),
|
|
'targetTimeSeconds': serializer.toJson<int?>(targetTimeSeconds),
|
|
'targetReps': serializer.toJson<int?>(targetReps),
|
|
'targetScore': serializer.toJson<double?>(targetScore),
|
|
'targetScoreTimeMs': serializer.toJson<int?>(targetScoreTimeMs),
|
|
'restSecondsOverride': serializer.toJson<int?>(restSecondsOverride),
|
|
};
|
|
}
|
|
|
|
ProgramExercise copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? programId,
|
|
Value<String?> sourceExerciseId = const Value.absent(),
|
|
int? position,
|
|
String? exerciseNameSnapshot,
|
|
Value<String?> exerciseDescriptionSnapshot = const Value.absent(),
|
|
Value<String?> exerciseImageMediaIdSnapshot = const Value.absent(),
|
|
Value<String?> exerciseVideoMediaIdSnapshot = const Value.absent(),
|
|
bool? exerciseArchivedSnapshot,
|
|
bool? availableTimeSnapshot,
|
|
bool? availableRepsSnapshot,
|
|
bool? availableScoreSnapshot,
|
|
String? scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
int? setsCount,
|
|
bool? timeEnabled,
|
|
bool? repsEnabled,
|
|
bool? scoreEnabled,
|
|
Value<int?> targetTimeSeconds = const Value.absent(),
|
|
Value<int?> targetReps = const Value.absent(),
|
|
Value<double?> targetScore = const Value.absent(),
|
|
Value<int?> targetScoreTimeMs = const Value.absent(),
|
|
Value<int?> restSecondsOverride = const Value.absent(),
|
|
}) => ProgramExercise(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
programId: programId ?? this.programId,
|
|
sourceExerciseId: sourceExerciseId.present
|
|
? sourceExerciseId.value
|
|
: this.sourceExerciseId,
|
|
position: position ?? this.position,
|
|
exerciseNameSnapshot: exerciseNameSnapshot ?? this.exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot: exerciseDescriptionSnapshot.present
|
|
? exerciseDescriptionSnapshot.value
|
|
: this.exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot: exerciseImageMediaIdSnapshot.present
|
|
? exerciseImageMediaIdSnapshot.value
|
|
: this.exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot: exerciseVideoMediaIdSnapshot.present
|
|
? exerciseVideoMediaIdSnapshot.value
|
|
: this.exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot:
|
|
exerciseArchivedSnapshot ?? this.exerciseArchivedSnapshot,
|
|
availableTimeSnapshot: availableTimeSnapshot ?? this.availableTimeSnapshot,
|
|
availableRepsSnapshot: availableRepsSnapshot ?? this.availableRepsSnapshot,
|
|
availableScoreSnapshot:
|
|
availableScoreSnapshot ?? this.availableScoreSnapshot,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot.present
|
|
? scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot.present
|
|
? scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
setsCount: setsCount ?? this.setsCount,
|
|
timeEnabled: timeEnabled ?? this.timeEnabled,
|
|
repsEnabled: repsEnabled ?? this.repsEnabled,
|
|
scoreEnabled: scoreEnabled ?? this.scoreEnabled,
|
|
targetTimeSeconds: targetTimeSeconds.present
|
|
? targetTimeSeconds.value
|
|
: this.targetTimeSeconds,
|
|
targetReps: targetReps.present ? targetReps.value : this.targetReps,
|
|
targetScore: targetScore.present ? targetScore.value : this.targetScore,
|
|
targetScoreTimeMs: targetScoreTimeMs.present
|
|
? targetScoreTimeMs.value
|
|
: this.targetScoreTimeMs,
|
|
restSecondsOverride: restSecondsOverride.present
|
|
? restSecondsOverride.value
|
|
: this.restSecondsOverride,
|
|
);
|
|
ProgramExercise copyWithCompanion(ProgramExercisesCompanion data) {
|
|
return ProgramExercise(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
programId: data.programId.present ? data.programId.value : this.programId,
|
|
sourceExerciseId: data.sourceExerciseId.present
|
|
? data.sourceExerciseId.value
|
|
: this.sourceExerciseId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
exerciseNameSnapshot: data.exerciseNameSnapshot.present
|
|
? data.exerciseNameSnapshot.value
|
|
: this.exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot: data.exerciseDescriptionSnapshot.present
|
|
? data.exerciseDescriptionSnapshot.value
|
|
: this.exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot: data.exerciseImageMediaIdSnapshot.present
|
|
? data.exerciseImageMediaIdSnapshot.value
|
|
: this.exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot: data.exerciseVideoMediaIdSnapshot.present
|
|
? data.exerciseVideoMediaIdSnapshot.value
|
|
: this.exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot: data.exerciseArchivedSnapshot.present
|
|
? data.exerciseArchivedSnapshot.value
|
|
: this.exerciseArchivedSnapshot,
|
|
availableTimeSnapshot: data.availableTimeSnapshot.present
|
|
? data.availableTimeSnapshot.value
|
|
: this.availableTimeSnapshot,
|
|
availableRepsSnapshot: data.availableRepsSnapshot.present
|
|
? data.availableRepsSnapshot.value
|
|
: this.availableRepsSnapshot,
|
|
availableScoreSnapshot: data.availableScoreSnapshot.present
|
|
? data.availableScoreSnapshot.value
|
|
: this.availableScoreSnapshot,
|
|
scoreInputModeSnapshot: data.scoreInputModeSnapshot.present
|
|
? data.scoreInputModeSnapshot.value
|
|
: this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: data.scoreLabelSnapshot.present
|
|
? data.scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: data.scoreUnitSnapshot.present
|
|
? data.scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
setsCount: data.setsCount.present ? data.setsCount.value : this.setsCount,
|
|
timeEnabled: data.timeEnabled.present
|
|
? data.timeEnabled.value
|
|
: this.timeEnabled,
|
|
repsEnabled: data.repsEnabled.present
|
|
? data.repsEnabled.value
|
|
: this.repsEnabled,
|
|
scoreEnabled: data.scoreEnabled.present
|
|
? data.scoreEnabled.value
|
|
: this.scoreEnabled,
|
|
targetTimeSeconds: data.targetTimeSeconds.present
|
|
? data.targetTimeSeconds.value
|
|
: this.targetTimeSeconds,
|
|
targetReps: data.targetReps.present
|
|
? data.targetReps.value
|
|
: this.targetReps,
|
|
targetScore: data.targetScore.present
|
|
? data.targetScore.value
|
|
: this.targetScore,
|
|
targetScoreTimeMs: data.targetScoreTimeMs.present
|
|
? data.targetScoreTimeMs.value
|
|
: this.targetScoreTimeMs,
|
|
restSecondsOverride: data.restSecondsOverride.present
|
|
? data.restSecondsOverride.value
|
|
: this.restSecondsOverride,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramExercise(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('programId: $programId, ')
|
|
..write('sourceExerciseId: $sourceExerciseId, ')
|
|
..write('position: $position, ')
|
|
..write('exerciseNameSnapshot: $exerciseNameSnapshot, ')
|
|
..write('exerciseDescriptionSnapshot: $exerciseDescriptionSnapshot, ')
|
|
..write(
|
|
'exerciseImageMediaIdSnapshot: $exerciseImageMediaIdSnapshot, ',
|
|
)
|
|
..write(
|
|
'exerciseVideoMediaIdSnapshot: $exerciseVideoMediaIdSnapshot, ',
|
|
)
|
|
..write('exerciseArchivedSnapshot: $exerciseArchivedSnapshot, ')
|
|
..write('availableTimeSnapshot: $availableTimeSnapshot, ')
|
|
..write('availableRepsSnapshot: $availableRepsSnapshot, ')
|
|
..write('availableScoreSnapshot: $availableScoreSnapshot, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('setsCount: $setsCount, ')
|
|
..write('timeEnabled: $timeEnabled, ')
|
|
..write('repsEnabled: $repsEnabled, ')
|
|
..write('scoreEnabled: $scoreEnabled, ')
|
|
..write('targetTimeSeconds: $targetTimeSeconds, ')
|
|
..write('targetReps: $targetReps, ')
|
|
..write('targetScore: $targetScore, ')
|
|
..write('targetScoreTimeMs: $targetScoreTimeMs, ')
|
|
..write('restSecondsOverride: $restSecondsOverride')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
programId,
|
|
sourceExerciseId,
|
|
position,
|
|
exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot,
|
|
availableTimeSnapshot,
|
|
availableRepsSnapshot,
|
|
availableScoreSnapshot,
|
|
scoreInputModeSnapshot,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
setsCount,
|
|
timeEnabled,
|
|
repsEnabled,
|
|
scoreEnabled,
|
|
targetTimeSeconds,
|
|
targetReps,
|
|
targetScore,
|
|
targetScoreTimeMs,
|
|
restSecondsOverride,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ProgramExercise &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.programId == this.programId &&
|
|
other.sourceExerciseId == this.sourceExerciseId &&
|
|
other.position == this.position &&
|
|
other.exerciseNameSnapshot == this.exerciseNameSnapshot &&
|
|
other.exerciseDescriptionSnapshot ==
|
|
this.exerciseDescriptionSnapshot &&
|
|
other.exerciseImageMediaIdSnapshot ==
|
|
this.exerciseImageMediaIdSnapshot &&
|
|
other.exerciseVideoMediaIdSnapshot ==
|
|
this.exerciseVideoMediaIdSnapshot &&
|
|
other.exerciseArchivedSnapshot == this.exerciseArchivedSnapshot &&
|
|
other.availableTimeSnapshot == this.availableTimeSnapshot &&
|
|
other.availableRepsSnapshot == this.availableRepsSnapshot &&
|
|
other.availableScoreSnapshot == this.availableScoreSnapshot &&
|
|
other.scoreInputModeSnapshot == this.scoreInputModeSnapshot &&
|
|
other.scoreLabelSnapshot == this.scoreLabelSnapshot &&
|
|
other.scoreUnitSnapshot == this.scoreUnitSnapshot &&
|
|
other.setsCount == this.setsCount &&
|
|
other.timeEnabled == this.timeEnabled &&
|
|
other.repsEnabled == this.repsEnabled &&
|
|
other.scoreEnabled == this.scoreEnabled &&
|
|
other.targetTimeSeconds == this.targetTimeSeconds &&
|
|
other.targetReps == this.targetReps &&
|
|
other.targetScore == this.targetScore &&
|
|
other.targetScoreTimeMs == this.targetScoreTimeMs &&
|
|
other.restSecondsOverride == this.restSecondsOverride);
|
|
}
|
|
|
|
class ProgramExercisesCompanion extends UpdateCompanion<ProgramExercise> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> programId;
|
|
final Value<String?> sourceExerciseId;
|
|
final Value<int> position;
|
|
final Value<String> exerciseNameSnapshot;
|
|
final Value<String?> exerciseDescriptionSnapshot;
|
|
final Value<String?> exerciseImageMediaIdSnapshot;
|
|
final Value<String?> exerciseVideoMediaIdSnapshot;
|
|
final Value<bool> exerciseArchivedSnapshot;
|
|
final Value<bool> availableTimeSnapshot;
|
|
final Value<bool> availableRepsSnapshot;
|
|
final Value<bool> availableScoreSnapshot;
|
|
final Value<String> scoreInputModeSnapshot;
|
|
final Value<String?> scoreLabelSnapshot;
|
|
final Value<String?> scoreUnitSnapshot;
|
|
final Value<int> setsCount;
|
|
final Value<bool> timeEnabled;
|
|
final Value<bool> repsEnabled;
|
|
final Value<bool> scoreEnabled;
|
|
final Value<int?> targetTimeSeconds;
|
|
final Value<int?> targetReps;
|
|
final Value<double?> targetScore;
|
|
final Value<int?> targetScoreTimeMs;
|
|
final Value<int?> restSecondsOverride;
|
|
final Value<int> rowid;
|
|
const ProgramExercisesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.programId = const Value.absent(),
|
|
this.sourceExerciseId = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.exerciseNameSnapshot = const Value.absent(),
|
|
this.exerciseDescriptionSnapshot = const Value.absent(),
|
|
this.exerciseImageMediaIdSnapshot = const Value.absent(),
|
|
this.exerciseVideoMediaIdSnapshot = const Value.absent(),
|
|
this.exerciseArchivedSnapshot = const Value.absent(),
|
|
this.availableTimeSnapshot = const Value.absent(),
|
|
this.availableRepsSnapshot = const Value.absent(),
|
|
this.availableScoreSnapshot = const Value.absent(),
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
this.setsCount = const Value.absent(),
|
|
this.timeEnabled = const Value.absent(),
|
|
this.repsEnabled = const Value.absent(),
|
|
this.scoreEnabled = const Value.absent(),
|
|
this.targetTimeSeconds = const Value.absent(),
|
|
this.targetReps = const Value.absent(),
|
|
this.targetScore = const Value.absent(),
|
|
this.targetScoreTimeMs = const Value.absent(),
|
|
this.restSecondsOverride = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProgramExercisesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String programId,
|
|
this.sourceExerciseId = const Value.absent(),
|
|
required int position,
|
|
required String exerciseNameSnapshot,
|
|
this.exerciseDescriptionSnapshot = const Value.absent(),
|
|
this.exerciseImageMediaIdSnapshot = const Value.absent(),
|
|
this.exerciseVideoMediaIdSnapshot = const Value.absent(),
|
|
this.exerciseArchivedSnapshot = const Value.absent(),
|
|
required bool availableTimeSnapshot,
|
|
required bool availableRepsSnapshot,
|
|
required bool availableScoreSnapshot,
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
required int setsCount,
|
|
required bool timeEnabled,
|
|
required bool repsEnabled,
|
|
required bool scoreEnabled,
|
|
this.targetTimeSeconds = const Value.absent(),
|
|
this.targetReps = const Value.absent(),
|
|
this.targetScore = const Value.absent(),
|
|
this.targetScoreTimeMs = const Value.absent(),
|
|
this.restSecondsOverride = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
programId = Value(programId),
|
|
position = Value(position),
|
|
exerciseNameSnapshot = Value(exerciseNameSnapshot),
|
|
availableTimeSnapshot = Value(availableTimeSnapshot),
|
|
availableRepsSnapshot = Value(availableRepsSnapshot),
|
|
availableScoreSnapshot = Value(availableScoreSnapshot),
|
|
setsCount = Value(setsCount),
|
|
timeEnabled = Value(timeEnabled),
|
|
repsEnabled = Value(repsEnabled),
|
|
scoreEnabled = Value(scoreEnabled);
|
|
static Insertable<ProgramExercise> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? programId,
|
|
Expression<String>? sourceExerciseId,
|
|
Expression<int>? position,
|
|
Expression<String>? exerciseNameSnapshot,
|
|
Expression<String>? exerciseDescriptionSnapshot,
|
|
Expression<String>? exerciseImageMediaIdSnapshot,
|
|
Expression<String>? exerciseVideoMediaIdSnapshot,
|
|
Expression<bool>? exerciseArchivedSnapshot,
|
|
Expression<bool>? availableTimeSnapshot,
|
|
Expression<bool>? availableRepsSnapshot,
|
|
Expression<bool>? availableScoreSnapshot,
|
|
Expression<String>? scoreInputModeSnapshot,
|
|
Expression<String>? scoreLabelSnapshot,
|
|
Expression<String>? scoreUnitSnapshot,
|
|
Expression<int>? setsCount,
|
|
Expression<bool>? timeEnabled,
|
|
Expression<bool>? repsEnabled,
|
|
Expression<bool>? scoreEnabled,
|
|
Expression<int>? targetTimeSeconds,
|
|
Expression<int>? targetReps,
|
|
Expression<double>? targetScore,
|
|
Expression<int>? targetScoreTimeMs,
|
|
Expression<int>? restSecondsOverride,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (programId != null) 'program_id': programId,
|
|
if (sourceExerciseId != null) 'source_exercise_id': sourceExerciseId,
|
|
if (position != null) 'position': position,
|
|
if (exerciseNameSnapshot != null)
|
|
'exercise_name_snapshot': exerciseNameSnapshot,
|
|
if (exerciseDescriptionSnapshot != null)
|
|
'exercise_description_snapshot': exerciseDescriptionSnapshot,
|
|
if (exerciseImageMediaIdSnapshot != null)
|
|
'exercise_image_media_id_snapshot': exerciseImageMediaIdSnapshot,
|
|
if (exerciseVideoMediaIdSnapshot != null)
|
|
'exercise_video_media_id_snapshot': exerciseVideoMediaIdSnapshot,
|
|
if (exerciseArchivedSnapshot != null)
|
|
'exercise_archived_snapshot': exerciseArchivedSnapshot,
|
|
if (availableTimeSnapshot != null)
|
|
'available_time_snapshot': availableTimeSnapshot,
|
|
if (availableRepsSnapshot != null)
|
|
'available_reps_snapshot': availableRepsSnapshot,
|
|
if (availableScoreSnapshot != null)
|
|
'available_score_snapshot': availableScoreSnapshot,
|
|
if (scoreInputModeSnapshot != null)
|
|
'score_input_mode_snapshot': scoreInputModeSnapshot,
|
|
if (scoreLabelSnapshot != null)
|
|
'score_label_snapshot': scoreLabelSnapshot,
|
|
if (scoreUnitSnapshot != null) 'score_unit_snapshot': scoreUnitSnapshot,
|
|
if (setsCount != null) 'sets_count': setsCount,
|
|
if (timeEnabled != null) 'time_enabled': timeEnabled,
|
|
if (repsEnabled != null) 'reps_enabled': repsEnabled,
|
|
if (scoreEnabled != null) 'score_enabled': scoreEnabled,
|
|
if (targetTimeSeconds != null) 'target_time_seconds': targetTimeSeconds,
|
|
if (targetReps != null) 'target_reps': targetReps,
|
|
if (targetScore != null) 'target_score': targetScore,
|
|
if (targetScoreTimeMs != null) 'target_score_time_ms': targetScoreTimeMs,
|
|
if (restSecondsOverride != null)
|
|
'rest_seconds_override': restSecondsOverride,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProgramExercisesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? programId,
|
|
Value<String?>? sourceExerciseId,
|
|
Value<int>? position,
|
|
Value<String>? exerciseNameSnapshot,
|
|
Value<String?>? exerciseDescriptionSnapshot,
|
|
Value<String?>? exerciseImageMediaIdSnapshot,
|
|
Value<String?>? exerciseVideoMediaIdSnapshot,
|
|
Value<bool>? exerciseArchivedSnapshot,
|
|
Value<bool>? availableTimeSnapshot,
|
|
Value<bool>? availableRepsSnapshot,
|
|
Value<bool>? availableScoreSnapshot,
|
|
Value<String>? scoreInputModeSnapshot,
|
|
Value<String?>? scoreLabelSnapshot,
|
|
Value<String?>? scoreUnitSnapshot,
|
|
Value<int>? setsCount,
|
|
Value<bool>? timeEnabled,
|
|
Value<bool>? repsEnabled,
|
|
Value<bool>? scoreEnabled,
|
|
Value<int?>? targetTimeSeconds,
|
|
Value<int?>? targetReps,
|
|
Value<double?>? targetScore,
|
|
Value<int?>? targetScoreTimeMs,
|
|
Value<int?>? restSecondsOverride,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProgramExercisesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
programId: programId ?? this.programId,
|
|
sourceExerciseId: sourceExerciseId ?? this.sourceExerciseId,
|
|
position: position ?? this.position,
|
|
exerciseNameSnapshot: exerciseNameSnapshot ?? this.exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot:
|
|
exerciseDescriptionSnapshot ?? this.exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot:
|
|
exerciseImageMediaIdSnapshot ?? this.exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot:
|
|
exerciseVideoMediaIdSnapshot ?? this.exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot:
|
|
exerciseArchivedSnapshot ?? this.exerciseArchivedSnapshot,
|
|
availableTimeSnapshot:
|
|
availableTimeSnapshot ?? this.availableTimeSnapshot,
|
|
availableRepsSnapshot:
|
|
availableRepsSnapshot ?? this.availableRepsSnapshot,
|
|
availableScoreSnapshot:
|
|
availableScoreSnapshot ?? this.availableScoreSnapshot,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot ?? this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot ?? this.scoreUnitSnapshot,
|
|
setsCount: setsCount ?? this.setsCount,
|
|
timeEnabled: timeEnabled ?? this.timeEnabled,
|
|
repsEnabled: repsEnabled ?? this.repsEnabled,
|
|
scoreEnabled: scoreEnabled ?? this.scoreEnabled,
|
|
targetTimeSeconds: targetTimeSeconds ?? this.targetTimeSeconds,
|
|
targetReps: targetReps ?? this.targetReps,
|
|
targetScore: targetScore ?? this.targetScore,
|
|
targetScoreTimeMs: targetScoreTimeMs ?? this.targetScoreTimeMs,
|
|
restSecondsOverride: restSecondsOverride ?? this.restSecondsOverride,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (programId.present) {
|
|
map['program_id'] = Variable<String>(programId.value);
|
|
}
|
|
if (sourceExerciseId.present) {
|
|
map['source_exercise_id'] = Variable<String>(sourceExerciseId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (exerciseNameSnapshot.present) {
|
|
map['exercise_name_snapshot'] = Variable<String>(
|
|
exerciseNameSnapshot.value,
|
|
);
|
|
}
|
|
if (exerciseDescriptionSnapshot.present) {
|
|
map['exercise_description_snapshot'] = Variable<String>(
|
|
exerciseDescriptionSnapshot.value,
|
|
);
|
|
}
|
|
if (exerciseImageMediaIdSnapshot.present) {
|
|
map['exercise_image_media_id_snapshot'] = Variable<String>(
|
|
exerciseImageMediaIdSnapshot.value,
|
|
);
|
|
}
|
|
if (exerciseVideoMediaIdSnapshot.present) {
|
|
map['exercise_video_media_id_snapshot'] = Variable<String>(
|
|
exerciseVideoMediaIdSnapshot.value,
|
|
);
|
|
}
|
|
if (exerciseArchivedSnapshot.present) {
|
|
map['exercise_archived_snapshot'] = Variable<bool>(
|
|
exerciseArchivedSnapshot.value,
|
|
);
|
|
}
|
|
if (availableTimeSnapshot.present) {
|
|
map['available_time_snapshot'] = Variable<bool>(
|
|
availableTimeSnapshot.value,
|
|
);
|
|
}
|
|
if (availableRepsSnapshot.present) {
|
|
map['available_reps_snapshot'] = Variable<bool>(
|
|
availableRepsSnapshot.value,
|
|
);
|
|
}
|
|
if (availableScoreSnapshot.present) {
|
|
map['available_score_snapshot'] = Variable<bool>(
|
|
availableScoreSnapshot.value,
|
|
);
|
|
}
|
|
if (scoreInputModeSnapshot.present) {
|
|
map['score_input_mode_snapshot'] = Variable<String>(
|
|
scoreInputModeSnapshot.value,
|
|
);
|
|
}
|
|
if (scoreLabelSnapshot.present) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot.value);
|
|
}
|
|
if (scoreUnitSnapshot.present) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot.value);
|
|
}
|
|
if (setsCount.present) {
|
|
map['sets_count'] = Variable<int>(setsCount.value);
|
|
}
|
|
if (timeEnabled.present) {
|
|
map['time_enabled'] = Variable<bool>(timeEnabled.value);
|
|
}
|
|
if (repsEnabled.present) {
|
|
map['reps_enabled'] = Variable<bool>(repsEnabled.value);
|
|
}
|
|
if (scoreEnabled.present) {
|
|
map['score_enabled'] = Variable<bool>(scoreEnabled.value);
|
|
}
|
|
if (targetTimeSeconds.present) {
|
|
map['target_time_seconds'] = Variable<int>(targetTimeSeconds.value);
|
|
}
|
|
if (targetReps.present) {
|
|
map['target_reps'] = Variable<int>(targetReps.value);
|
|
}
|
|
if (targetScore.present) {
|
|
map['target_score'] = Variable<double>(targetScore.value);
|
|
}
|
|
if (targetScoreTimeMs.present) {
|
|
map['target_score_time_ms'] = Variable<int>(targetScoreTimeMs.value);
|
|
}
|
|
if (restSecondsOverride.present) {
|
|
map['rest_seconds_override'] = Variable<int>(restSecondsOverride.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramExercisesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('programId: $programId, ')
|
|
..write('sourceExerciseId: $sourceExerciseId, ')
|
|
..write('position: $position, ')
|
|
..write('exerciseNameSnapshot: $exerciseNameSnapshot, ')
|
|
..write('exerciseDescriptionSnapshot: $exerciseDescriptionSnapshot, ')
|
|
..write(
|
|
'exerciseImageMediaIdSnapshot: $exerciseImageMediaIdSnapshot, ',
|
|
)
|
|
..write(
|
|
'exerciseVideoMediaIdSnapshot: $exerciseVideoMediaIdSnapshot, ',
|
|
)
|
|
..write('exerciseArchivedSnapshot: $exerciseArchivedSnapshot, ')
|
|
..write('availableTimeSnapshot: $availableTimeSnapshot, ')
|
|
..write('availableRepsSnapshot: $availableRepsSnapshot, ')
|
|
..write('availableScoreSnapshot: $availableScoreSnapshot, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('setsCount: $setsCount, ')
|
|
..write('timeEnabled: $timeEnabled, ')
|
|
..write('repsEnabled: $repsEnabled, ')
|
|
..write('scoreEnabled: $scoreEnabled, ')
|
|
..write('targetTimeSeconds: $targetTimeSeconds, ')
|
|
..write('targetReps: $targetReps, ')
|
|
..write('targetScore: $targetScore, ')
|
|
..write('targetScoreTimeMs: $targetScoreTimeMs, ')
|
|
..write('restSecondsOverride: $restSecondsOverride, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $WorkoutHistoriesTable extends WorkoutHistories
|
|
with TableInfo<$WorkoutHistoriesTable, WorkoutHistory> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WorkoutHistoriesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sourceWorkoutTemplateIdMeta =
|
|
const VerificationMeta('sourceWorkoutTemplateId');
|
|
@override
|
|
late final GeneratedColumn<String> sourceWorkoutTemplateId =
|
|
GeneratedColumn<String>(
|
|
'source_workout_template_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES workout_templates (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _sourceActiveWorkoutSessionIdMeta =
|
|
const VerificationMeta('sourceActiveWorkoutSessionId');
|
|
@override
|
|
late final GeneratedColumn<String> sourceActiveWorkoutSessionId =
|
|
GeneratedColumn<String>(
|
|
'source_active_workout_session_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES active_workout_sessions (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _nameSnapshotMeta = const VerificationMeta(
|
|
'nameSnapshot',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> nameSnapshot = GeneratedColumn<String>(
|
|
'name_snapshot',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _endedAtMeta = const VerificationMeta(
|
|
'endedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> endedAt = GeneratedColumn<DateTime>(
|
|
'ended_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _totalActiveMsMeta = const VerificationMeta(
|
|
'totalActiveMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> totalActiveMs = GeneratedColumn<int>(
|
|
'total_active_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _completedMeta = const VerificationMeta(
|
|
'completed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> completed = GeneratedColumn<bool>(
|
|
'completed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("completed" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _historySnapshotJsonMeta =
|
|
const VerificationMeta('historySnapshotJson');
|
|
@override
|
|
late final GeneratedColumn<String> historySnapshotJson =
|
|
GeneratedColumn<String>(
|
|
'history_snapshot_json',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId,
|
|
nameSnapshot,
|
|
startedAt,
|
|
endedAt,
|
|
totalActiveMs,
|
|
completed,
|
|
historySnapshotJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'workout_history';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<WorkoutHistory> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('source_workout_template_id')) {
|
|
context.handle(
|
|
_sourceWorkoutTemplateIdMeta,
|
|
sourceWorkoutTemplateId.isAcceptableOrUnknown(
|
|
data['source_workout_template_id']!,
|
|
_sourceWorkoutTemplateIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('source_active_workout_session_id')) {
|
|
context.handle(
|
|
_sourceActiveWorkoutSessionIdMeta,
|
|
sourceActiveWorkoutSessionId.isAcceptableOrUnknown(
|
|
data['source_active_workout_session_id']!,
|
|
_sourceActiveWorkoutSessionIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('name_snapshot')) {
|
|
context.handle(
|
|
_nameSnapshotMeta,
|
|
nameSnapshot.isAcceptableOrUnknown(
|
|
data['name_snapshot']!,
|
|
_nameSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameSnapshotMeta);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('ended_at')) {
|
|
context.handle(
|
|
_endedAtMeta,
|
|
endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_endedAtMeta);
|
|
}
|
|
if (data.containsKey('total_active_ms')) {
|
|
context.handle(
|
|
_totalActiveMsMeta,
|
|
totalActiveMs.isAcceptableOrUnknown(
|
|
data['total_active_ms']!,
|
|
_totalActiveMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_totalActiveMsMeta);
|
|
}
|
|
if (data.containsKey('completed')) {
|
|
context.handle(
|
|
_completedMeta,
|
|
completed.isAcceptableOrUnknown(data['completed']!, _completedMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_completedMeta);
|
|
}
|
|
if (data.containsKey('history_snapshot_json')) {
|
|
context.handle(
|
|
_historySnapshotJsonMeta,
|
|
historySnapshotJson.isAcceptableOrUnknown(
|
|
data['history_snapshot_json']!,
|
|
_historySnapshotJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_historySnapshotJsonMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WorkoutHistory map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WorkoutHistory(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
sourceWorkoutTemplateId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_workout_template_id'],
|
|
),
|
|
sourceActiveWorkoutSessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_active_workout_session_id'],
|
|
),
|
|
nameSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name_snapshot'],
|
|
)!,
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
endedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}ended_at'],
|
|
)!,
|
|
totalActiveMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}total_active_ms'],
|
|
)!,
|
|
completed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}completed'],
|
|
)!,
|
|
historySnapshotJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}history_snapshot_json'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WorkoutHistoriesTable createAlias(String alias) {
|
|
return $WorkoutHistoriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WorkoutHistory extends DataClass implements Insertable<WorkoutHistory> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String? sourceWorkoutTemplateId;
|
|
final String? sourceActiveWorkoutSessionId;
|
|
final String nameSnapshot;
|
|
final DateTime startedAt;
|
|
final DateTime endedAt;
|
|
final int totalActiveMs;
|
|
final bool completed;
|
|
final String historySnapshotJson;
|
|
const WorkoutHistory({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
this.sourceWorkoutTemplateId,
|
|
this.sourceActiveWorkoutSessionId,
|
|
required this.nameSnapshot,
|
|
required this.startedAt,
|
|
required this.endedAt,
|
|
required this.totalActiveMs,
|
|
required this.completed,
|
|
required this.historySnapshotJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
if (!nullToAbsent || sourceWorkoutTemplateId != null) {
|
|
map['source_workout_template_id'] = Variable<String>(
|
|
sourceWorkoutTemplateId,
|
|
);
|
|
}
|
|
if (!nullToAbsent || sourceActiveWorkoutSessionId != null) {
|
|
map['source_active_workout_session_id'] = Variable<String>(
|
|
sourceActiveWorkoutSessionId,
|
|
);
|
|
}
|
|
map['name_snapshot'] = Variable<String>(nameSnapshot);
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
map['ended_at'] = Variable<DateTime>(endedAt);
|
|
map['total_active_ms'] = Variable<int>(totalActiveMs);
|
|
map['completed'] = Variable<bool>(completed);
|
|
map['history_snapshot_json'] = Variable<String>(historySnapshotJson);
|
|
return map;
|
|
}
|
|
|
|
WorkoutHistoriesCompanion toCompanion(bool nullToAbsent) {
|
|
return WorkoutHistoriesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceWorkoutTemplateId),
|
|
sourceActiveWorkoutSessionId:
|
|
sourceActiveWorkoutSessionId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceActiveWorkoutSessionId),
|
|
nameSnapshot: Value(nameSnapshot),
|
|
startedAt: Value(startedAt),
|
|
endedAt: Value(endedAt),
|
|
totalActiveMs: Value(totalActiveMs),
|
|
completed: Value(completed),
|
|
historySnapshotJson: Value(historySnapshotJson),
|
|
);
|
|
}
|
|
|
|
factory WorkoutHistory.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WorkoutHistory(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
sourceWorkoutTemplateId: serializer.fromJson<String?>(
|
|
json['sourceWorkoutTemplateId'],
|
|
),
|
|
sourceActiveWorkoutSessionId: serializer.fromJson<String?>(
|
|
json['sourceActiveWorkoutSessionId'],
|
|
),
|
|
nameSnapshot: serializer.fromJson<String>(json['nameSnapshot']),
|
|
startedAt: serializer.fromJson<DateTime>(json['startedAt']),
|
|
endedAt: serializer.fromJson<DateTime>(json['endedAt']),
|
|
totalActiveMs: serializer.fromJson<int>(json['totalActiveMs']),
|
|
completed: serializer.fromJson<bool>(json['completed']),
|
|
historySnapshotJson: serializer.fromJson<String>(
|
|
json['historySnapshotJson'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'sourceWorkoutTemplateId': serializer.toJson<String?>(
|
|
sourceWorkoutTemplateId,
|
|
),
|
|
'sourceActiveWorkoutSessionId': serializer.toJson<String?>(
|
|
sourceActiveWorkoutSessionId,
|
|
),
|
|
'nameSnapshot': serializer.toJson<String>(nameSnapshot),
|
|
'startedAt': serializer.toJson<DateTime>(startedAt),
|
|
'endedAt': serializer.toJson<DateTime>(endedAt),
|
|
'totalActiveMs': serializer.toJson<int>(totalActiveMs),
|
|
'completed': serializer.toJson<bool>(completed),
|
|
'historySnapshotJson': serializer.toJson<String>(historySnapshotJson),
|
|
};
|
|
}
|
|
|
|
WorkoutHistory copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
Value<String?> sourceActiveWorkoutSessionId = const Value.absent(),
|
|
String? nameSnapshot,
|
|
DateTime? startedAt,
|
|
DateTime? endedAt,
|
|
int? totalActiveMs,
|
|
bool? completed,
|
|
String? historySnapshotJson,
|
|
}) => WorkoutHistory(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId.present
|
|
? sourceWorkoutTemplateId.value
|
|
: this.sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId: sourceActiveWorkoutSessionId.present
|
|
? sourceActiveWorkoutSessionId.value
|
|
: this.sourceActiveWorkoutSessionId,
|
|
nameSnapshot: nameSnapshot ?? this.nameSnapshot,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
totalActiveMs: totalActiveMs ?? this.totalActiveMs,
|
|
completed: completed ?? this.completed,
|
|
historySnapshotJson: historySnapshotJson ?? this.historySnapshotJson,
|
|
);
|
|
WorkoutHistory copyWithCompanion(WorkoutHistoriesCompanion data) {
|
|
return WorkoutHistory(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
sourceWorkoutTemplateId: data.sourceWorkoutTemplateId.present
|
|
? data.sourceWorkoutTemplateId.value
|
|
: this.sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId: data.sourceActiveWorkoutSessionId.present
|
|
? data.sourceActiveWorkoutSessionId.value
|
|
: this.sourceActiveWorkoutSessionId,
|
|
nameSnapshot: data.nameSnapshot.present
|
|
? data.nameSnapshot.value
|
|
: this.nameSnapshot,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt,
|
|
totalActiveMs: data.totalActiveMs.present
|
|
? data.totalActiveMs.value
|
|
: this.totalActiveMs,
|
|
completed: data.completed.present ? data.completed.value : this.completed,
|
|
historySnapshotJson: data.historySnapshotJson.present
|
|
? data.historySnapshotJson.value
|
|
: this.historySnapshotJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutHistory(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('sourceWorkoutTemplateId: $sourceWorkoutTemplateId, ')
|
|
..write(
|
|
'sourceActiveWorkoutSessionId: $sourceActiveWorkoutSessionId, ',
|
|
)
|
|
..write('nameSnapshot: $nameSnapshot, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('totalActiveMs: $totalActiveMs, ')
|
|
..write('completed: $completed, ')
|
|
..write('historySnapshotJson: $historySnapshotJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId,
|
|
nameSnapshot,
|
|
startedAt,
|
|
endedAt,
|
|
totalActiveMs,
|
|
completed,
|
|
historySnapshotJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WorkoutHistory &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.sourceWorkoutTemplateId == this.sourceWorkoutTemplateId &&
|
|
other.sourceActiveWorkoutSessionId ==
|
|
this.sourceActiveWorkoutSessionId &&
|
|
other.nameSnapshot == this.nameSnapshot &&
|
|
other.startedAt == this.startedAt &&
|
|
other.endedAt == this.endedAt &&
|
|
other.totalActiveMs == this.totalActiveMs &&
|
|
other.completed == this.completed &&
|
|
other.historySnapshotJson == this.historySnapshotJson);
|
|
}
|
|
|
|
class WorkoutHistoriesCompanion extends UpdateCompanion<WorkoutHistory> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String?> sourceWorkoutTemplateId;
|
|
final Value<String?> sourceActiveWorkoutSessionId;
|
|
final Value<String> nameSnapshot;
|
|
final Value<DateTime> startedAt;
|
|
final Value<DateTime> endedAt;
|
|
final Value<int> totalActiveMs;
|
|
final Value<bool> completed;
|
|
final Value<String> historySnapshotJson;
|
|
final Value<int> rowid;
|
|
const WorkoutHistoriesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.sourceWorkoutTemplateId = const Value.absent(),
|
|
this.sourceActiveWorkoutSessionId = const Value.absent(),
|
|
this.nameSnapshot = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
this.totalActiveMs = const Value.absent(),
|
|
this.completed = const Value.absent(),
|
|
this.historySnapshotJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
WorkoutHistoriesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.sourceWorkoutTemplateId = const Value.absent(),
|
|
this.sourceActiveWorkoutSessionId = const Value.absent(),
|
|
required String nameSnapshot,
|
|
required DateTime startedAt,
|
|
required DateTime endedAt,
|
|
required int totalActiveMs,
|
|
required bool completed,
|
|
required String historySnapshotJson,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
nameSnapshot = Value(nameSnapshot),
|
|
startedAt = Value(startedAt),
|
|
endedAt = Value(endedAt),
|
|
totalActiveMs = Value(totalActiveMs),
|
|
completed = Value(completed),
|
|
historySnapshotJson = Value(historySnapshotJson);
|
|
static Insertable<WorkoutHistory> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? sourceWorkoutTemplateId,
|
|
Expression<String>? sourceActiveWorkoutSessionId,
|
|
Expression<String>? nameSnapshot,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<DateTime>? endedAt,
|
|
Expression<int>? totalActiveMs,
|
|
Expression<bool>? completed,
|
|
Expression<String>? historySnapshotJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (sourceWorkoutTemplateId != null)
|
|
'source_workout_template_id': sourceWorkoutTemplateId,
|
|
if (sourceActiveWorkoutSessionId != null)
|
|
'source_active_workout_session_id': sourceActiveWorkoutSessionId,
|
|
if (nameSnapshot != null) 'name_snapshot': nameSnapshot,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (endedAt != null) 'ended_at': endedAt,
|
|
if (totalActiveMs != null) 'total_active_ms': totalActiveMs,
|
|
if (completed != null) 'completed': completed,
|
|
if (historySnapshotJson != null)
|
|
'history_snapshot_json': historySnapshotJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
WorkoutHistoriesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String?>? sourceWorkoutTemplateId,
|
|
Value<String?>? sourceActiveWorkoutSessionId,
|
|
Value<String>? nameSnapshot,
|
|
Value<DateTime>? startedAt,
|
|
Value<DateTime>? endedAt,
|
|
Value<int>? totalActiveMs,
|
|
Value<bool>? completed,
|
|
Value<String>? historySnapshotJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return WorkoutHistoriesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
sourceWorkoutTemplateId:
|
|
sourceWorkoutTemplateId ?? this.sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId:
|
|
sourceActiveWorkoutSessionId ?? this.sourceActiveWorkoutSessionId,
|
|
nameSnapshot: nameSnapshot ?? this.nameSnapshot,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
totalActiveMs: totalActiveMs ?? this.totalActiveMs,
|
|
completed: completed ?? this.completed,
|
|
historySnapshotJson: historySnapshotJson ?? this.historySnapshotJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (sourceWorkoutTemplateId.present) {
|
|
map['source_workout_template_id'] = Variable<String>(
|
|
sourceWorkoutTemplateId.value,
|
|
);
|
|
}
|
|
if (sourceActiveWorkoutSessionId.present) {
|
|
map['source_active_workout_session_id'] = Variable<String>(
|
|
sourceActiveWorkoutSessionId.value,
|
|
);
|
|
}
|
|
if (nameSnapshot.present) {
|
|
map['name_snapshot'] = Variable<String>(nameSnapshot.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (endedAt.present) {
|
|
map['ended_at'] = Variable<DateTime>(endedAt.value);
|
|
}
|
|
if (totalActiveMs.present) {
|
|
map['total_active_ms'] = Variable<int>(totalActiveMs.value);
|
|
}
|
|
if (completed.present) {
|
|
map['completed'] = Variable<bool>(completed.value);
|
|
}
|
|
if (historySnapshotJson.present) {
|
|
map['history_snapshot_json'] = Variable<String>(
|
|
historySnapshotJson.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutHistoriesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('sourceWorkoutTemplateId: $sourceWorkoutTemplateId, ')
|
|
..write(
|
|
'sourceActiveWorkoutSessionId: $sourceActiveWorkoutSessionId, ',
|
|
)
|
|
..write('nameSnapshot: $nameSnapshot, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('totalActiveMs: $totalActiveMs, ')
|
|
..write('completed: $completed, ')
|
|
..write('historySnapshotJson: $historySnapshotJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $WorkoutHistorySetResultsTable extends WorkoutHistorySetResults
|
|
with TableInfo<$WorkoutHistorySetResultsTable, WorkoutHistorySetResult> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WorkoutHistorySetResultsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _workoutHistoryIdMeta = const VerificationMeta(
|
|
'workoutHistoryId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> workoutHistoryId = GeneratedColumn<String>(
|
|
'workout_history_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES workout_history (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _programSnapshotIdMeta = const VerificationMeta(
|
|
'programSnapshotId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> programSnapshotId =
|
|
GeneratedColumn<String>(
|
|
'program_snapshot_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseSnapshotIdMeta =
|
|
const VerificationMeta('exerciseSnapshotId');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseSnapshotId =
|
|
GeneratedColumn<String>(
|
|
'exercise_snapshot_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _programIndexMeta = const VerificationMeta(
|
|
'programIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> programIndex = GeneratedColumn<int>(
|
|
'program_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseIndexMeta = const VerificationMeta(
|
|
'exerciseIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> exerciseIndex = GeneratedColumn<int>(
|
|
'exercise_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _setIndexMeta = const VerificationMeta(
|
|
'setIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> setIndex = GeneratedColumn<int>(
|
|
'set_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _programNameSnapshotMeta =
|
|
const VerificationMeta('programNameSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> programNameSnapshot =
|
|
GeneratedColumn<String>(
|
|
'program_name_snapshot',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _exerciseNameSnapshotMeta =
|
|
const VerificationMeta('exerciseNameSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> exerciseNameSnapshot =
|
|
GeneratedColumn<String>(
|
|
'exercise_name_snapshot',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _timeEnabledSnapshotMeta =
|
|
const VerificationMeta('timeEnabledSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> timeEnabledSnapshot = GeneratedColumn<bool>(
|
|
'time_enabled_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("time_enabled_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _repsEnabledSnapshotMeta =
|
|
const VerificationMeta('repsEnabledSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> repsEnabledSnapshot = GeneratedColumn<bool>(
|
|
'reps_enabled_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("reps_enabled_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _scoreEnabledSnapshotMeta =
|
|
const VerificationMeta('scoreEnabledSnapshot');
|
|
@override
|
|
late final GeneratedColumn<bool> scoreEnabledSnapshot = GeneratedColumn<bool>(
|
|
'score_enabled_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("score_enabled_snapshot" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _scoreInputModeSnapshotMeta =
|
|
const VerificationMeta('scoreInputModeSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreInputModeSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_input_mode_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('manual'),
|
|
);
|
|
static const VerificationMeta _targetTimeSecondsSnapshotMeta =
|
|
const VerificationMeta('targetTimeSecondsSnapshot');
|
|
@override
|
|
late final GeneratedColumn<int> targetTimeSecondsSnapshot =
|
|
GeneratedColumn<int>(
|
|
'target_time_seconds_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetRepsSnapshotMeta =
|
|
const VerificationMeta('targetRepsSnapshot');
|
|
@override
|
|
late final GeneratedColumn<int> targetRepsSnapshot = GeneratedColumn<int>(
|
|
'target_reps_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreSnapshotMeta =
|
|
const VerificationMeta('targetScoreSnapshot');
|
|
@override
|
|
late final GeneratedColumn<double> targetScoreSnapshot =
|
|
GeneratedColumn<double>(
|
|
'target_score_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreTimeMsSnapshotMeta =
|
|
const VerificationMeta('targetScoreTimeMsSnapshot');
|
|
@override
|
|
late final GeneratedColumn<int> targetScoreTimeMsSnapshot =
|
|
GeneratedColumn<int>(
|
|
'target_score_time_ms_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualTimeMsMeta = const VerificationMeta(
|
|
'actualTimeMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualTimeMs = GeneratedColumn<int>(
|
|
'actual_time_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualRepsMeta = const VerificationMeta(
|
|
'actualReps',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualReps = GeneratedColumn<int>(
|
|
'actual_reps',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualScoreMeta = const VerificationMeta(
|
|
'actualScore',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> actualScore = GeneratedColumn<double>(
|
|
'actual_score',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _actualScoreTimeMsMeta = const VerificationMeta(
|
|
'actualScoreTimeMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> actualScoreTimeMs = GeneratedColumn<int>(
|
|
'actual_score_time_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreLabelSnapshotMeta =
|
|
const VerificationMeta('scoreLabelSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> scoreLabelSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_label_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _scoreUnitSnapshotMeta = const VerificationMeta(
|
|
'scoreUnitSnapshot',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scoreUnitSnapshot =
|
|
GeneratedColumn<String>(
|
|
'score_unit_snapshot',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> startedAt = GeneratedColumn<DateTime>(
|
|
'started_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _completedAtMeta = const VerificationMeta(
|
|
'completedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> completedAt = GeneratedColumn<DateTime>(
|
|
'completed_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('completed'),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutHistoryId,
|
|
programSnapshotId,
|
|
exerciseSnapshotId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
programNameSnapshot,
|
|
exerciseNameSnapshot,
|
|
timeEnabledSnapshot,
|
|
repsEnabledSnapshot,
|
|
scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot,
|
|
targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot,
|
|
actualTimeMs,
|
|
actualReps,
|
|
actualScore,
|
|
actualScoreTimeMs,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
startedAt,
|
|
completedAt,
|
|
status,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'workout_history_set_results';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<WorkoutHistorySetResult> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('workout_history_id')) {
|
|
context.handle(
|
|
_workoutHistoryIdMeta,
|
|
workoutHistoryId.isAcceptableOrUnknown(
|
|
data['workout_history_id']!,
|
|
_workoutHistoryIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_workoutHistoryIdMeta);
|
|
}
|
|
if (data.containsKey('program_snapshot_id')) {
|
|
context.handle(
|
|
_programSnapshotIdMeta,
|
|
programSnapshotId.isAcceptableOrUnknown(
|
|
data['program_snapshot_id']!,
|
|
_programSnapshotIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programSnapshotIdMeta);
|
|
}
|
|
if (data.containsKey('exercise_snapshot_id')) {
|
|
context.handle(
|
|
_exerciseSnapshotIdMeta,
|
|
exerciseSnapshotId.isAcceptableOrUnknown(
|
|
data['exercise_snapshot_id']!,
|
|
_exerciseSnapshotIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseSnapshotIdMeta);
|
|
}
|
|
if (data.containsKey('program_index')) {
|
|
context.handle(
|
|
_programIndexMeta,
|
|
programIndex.isAcceptableOrUnknown(
|
|
data['program_index']!,
|
|
_programIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIndexMeta);
|
|
}
|
|
if (data.containsKey('exercise_index')) {
|
|
context.handle(
|
|
_exerciseIndexMeta,
|
|
exerciseIndex.isAcceptableOrUnknown(
|
|
data['exercise_index']!,
|
|
_exerciseIndexMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseIndexMeta);
|
|
}
|
|
if (data.containsKey('set_index')) {
|
|
context.handle(
|
|
_setIndexMeta,
|
|
setIndex.isAcceptableOrUnknown(data['set_index']!, _setIndexMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_setIndexMeta);
|
|
}
|
|
if (data.containsKey('program_name_snapshot')) {
|
|
context.handle(
|
|
_programNameSnapshotMeta,
|
|
programNameSnapshot.isAcceptableOrUnknown(
|
|
data['program_name_snapshot']!,
|
|
_programNameSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programNameSnapshotMeta);
|
|
}
|
|
if (data.containsKey('exercise_name_snapshot')) {
|
|
context.handle(
|
|
_exerciseNameSnapshotMeta,
|
|
exerciseNameSnapshot.isAcceptableOrUnknown(
|
|
data['exercise_name_snapshot']!,
|
|
_exerciseNameSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_exerciseNameSnapshotMeta);
|
|
}
|
|
if (data.containsKey('time_enabled_snapshot')) {
|
|
context.handle(
|
|
_timeEnabledSnapshotMeta,
|
|
timeEnabledSnapshot.isAcceptableOrUnknown(
|
|
data['time_enabled_snapshot']!,
|
|
_timeEnabledSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_timeEnabledSnapshotMeta);
|
|
}
|
|
if (data.containsKey('reps_enabled_snapshot')) {
|
|
context.handle(
|
|
_repsEnabledSnapshotMeta,
|
|
repsEnabledSnapshot.isAcceptableOrUnknown(
|
|
data['reps_enabled_snapshot']!,
|
|
_repsEnabledSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_repsEnabledSnapshotMeta);
|
|
}
|
|
if (data.containsKey('score_enabled_snapshot')) {
|
|
context.handle(
|
|
_scoreEnabledSnapshotMeta,
|
|
scoreEnabledSnapshot.isAcceptableOrUnknown(
|
|
data['score_enabled_snapshot']!,
|
|
_scoreEnabledSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_scoreEnabledSnapshotMeta);
|
|
}
|
|
if (data.containsKey('score_input_mode_snapshot')) {
|
|
context.handle(
|
|
_scoreInputModeSnapshotMeta,
|
|
scoreInputModeSnapshot.isAcceptableOrUnknown(
|
|
data['score_input_mode_snapshot']!,
|
|
_scoreInputModeSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_time_seconds_snapshot')) {
|
|
context.handle(
|
|
_targetTimeSecondsSnapshotMeta,
|
|
targetTimeSecondsSnapshot.isAcceptableOrUnknown(
|
|
data['target_time_seconds_snapshot']!,
|
|
_targetTimeSecondsSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_reps_snapshot')) {
|
|
context.handle(
|
|
_targetRepsSnapshotMeta,
|
|
targetRepsSnapshot.isAcceptableOrUnknown(
|
|
data['target_reps_snapshot']!,
|
|
_targetRepsSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score_snapshot')) {
|
|
context.handle(
|
|
_targetScoreSnapshotMeta,
|
|
targetScoreSnapshot.isAcceptableOrUnknown(
|
|
data['target_score_snapshot']!,
|
|
_targetScoreSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score_time_ms_snapshot')) {
|
|
context.handle(
|
|
_targetScoreTimeMsSnapshotMeta,
|
|
targetScoreTimeMsSnapshot.isAcceptableOrUnknown(
|
|
data['target_score_time_ms_snapshot']!,
|
|
_targetScoreTimeMsSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_time_ms')) {
|
|
context.handle(
|
|
_actualTimeMsMeta,
|
|
actualTimeMs.isAcceptableOrUnknown(
|
|
data['actual_time_ms']!,
|
|
_actualTimeMsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_reps')) {
|
|
context.handle(
|
|
_actualRepsMeta,
|
|
actualReps.isAcceptableOrUnknown(data['actual_reps']!, _actualRepsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_score')) {
|
|
context.handle(
|
|
_actualScoreMeta,
|
|
actualScore.isAcceptableOrUnknown(
|
|
data['actual_score']!,
|
|
_actualScoreMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('actual_score_time_ms')) {
|
|
context.handle(
|
|
_actualScoreTimeMsMeta,
|
|
actualScoreTimeMs.isAcceptableOrUnknown(
|
|
data['actual_score_time_ms']!,
|
|
_actualScoreTimeMsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_label_snapshot')) {
|
|
context.handle(
|
|
_scoreLabelSnapshotMeta,
|
|
scoreLabelSnapshot.isAcceptableOrUnknown(
|
|
data['score_label_snapshot']!,
|
|
_scoreLabelSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('score_unit_snapshot')) {
|
|
context.handle(
|
|
_scoreUnitSnapshotMeta,
|
|
scoreUnitSnapshot.isAcceptableOrUnknown(
|
|
data['score_unit_snapshot']!,
|
|
_scoreUnitSnapshotMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('completed_at')) {
|
|
context.handle(
|
|
_completedAtMeta,
|
|
completedAt.isAcceptableOrUnknown(
|
|
data['completed_at']!,
|
|
_completedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WorkoutHistorySetResult map(
|
|
Map<String, dynamic> data, {
|
|
String? tablePrefix,
|
|
}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WorkoutHistorySetResult(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
workoutHistoryId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}workout_history_id'],
|
|
)!,
|
|
programSnapshotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_snapshot_id'],
|
|
)!,
|
|
exerciseSnapshotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_snapshot_id'],
|
|
)!,
|
|
programIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}program_index'],
|
|
)!,
|
|
exerciseIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}exercise_index'],
|
|
)!,
|
|
setIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}set_index'],
|
|
)!,
|
|
programNameSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_name_snapshot'],
|
|
)!,
|
|
exerciseNameSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}exercise_name_snapshot'],
|
|
)!,
|
|
timeEnabledSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}time_enabled_snapshot'],
|
|
)!,
|
|
repsEnabledSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}reps_enabled_snapshot'],
|
|
)!,
|
|
scoreEnabledSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}score_enabled_snapshot'],
|
|
)!,
|
|
scoreInputModeSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_input_mode_snapshot'],
|
|
)!,
|
|
targetTimeSecondsSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_time_seconds_snapshot'],
|
|
),
|
|
targetRepsSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_reps_snapshot'],
|
|
),
|
|
targetScoreSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}target_score_snapshot'],
|
|
),
|
|
targetScoreTimeMsSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_score_time_ms_snapshot'],
|
|
),
|
|
actualTimeMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_time_ms'],
|
|
),
|
|
actualReps: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_reps'],
|
|
),
|
|
actualScore: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}actual_score'],
|
|
),
|
|
actualScoreTimeMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}actual_score_time_ms'],
|
|
),
|
|
scoreLabelSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_label_snapshot'],
|
|
),
|
|
scoreUnitSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}score_unit_snapshot'],
|
|
),
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}started_at'],
|
|
),
|
|
completedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}completed_at'],
|
|
),
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WorkoutHistorySetResultsTable createAlias(String alias) {
|
|
return $WorkoutHistorySetResultsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WorkoutHistorySetResult extends DataClass
|
|
implements Insertable<WorkoutHistorySetResult> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String workoutHistoryId;
|
|
final String programSnapshotId;
|
|
final String exerciseSnapshotId;
|
|
final int programIndex;
|
|
final int exerciseIndex;
|
|
final int setIndex;
|
|
final String programNameSnapshot;
|
|
final String exerciseNameSnapshot;
|
|
final bool timeEnabledSnapshot;
|
|
final bool repsEnabledSnapshot;
|
|
final bool scoreEnabledSnapshot;
|
|
final String scoreInputModeSnapshot;
|
|
final int? targetTimeSecondsSnapshot;
|
|
final int? targetRepsSnapshot;
|
|
final double? targetScoreSnapshot;
|
|
final int? targetScoreTimeMsSnapshot;
|
|
final int? actualTimeMs;
|
|
final int? actualReps;
|
|
final double? actualScore;
|
|
final int? actualScoreTimeMs;
|
|
final String? scoreLabelSnapshot;
|
|
final String? scoreUnitSnapshot;
|
|
final DateTime? startedAt;
|
|
final DateTime? completedAt;
|
|
final String status;
|
|
const WorkoutHistorySetResult({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.workoutHistoryId,
|
|
required this.programSnapshotId,
|
|
required this.exerciseSnapshotId,
|
|
required this.programIndex,
|
|
required this.exerciseIndex,
|
|
required this.setIndex,
|
|
required this.programNameSnapshot,
|
|
required this.exerciseNameSnapshot,
|
|
required this.timeEnabledSnapshot,
|
|
required this.repsEnabledSnapshot,
|
|
required this.scoreEnabledSnapshot,
|
|
required this.scoreInputModeSnapshot,
|
|
this.targetTimeSecondsSnapshot,
|
|
this.targetRepsSnapshot,
|
|
this.targetScoreSnapshot,
|
|
this.targetScoreTimeMsSnapshot,
|
|
this.actualTimeMs,
|
|
this.actualReps,
|
|
this.actualScore,
|
|
this.actualScoreTimeMs,
|
|
this.scoreLabelSnapshot,
|
|
this.scoreUnitSnapshot,
|
|
this.startedAt,
|
|
this.completedAt,
|
|
required this.status,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['workout_history_id'] = Variable<String>(workoutHistoryId);
|
|
map['program_snapshot_id'] = Variable<String>(programSnapshotId);
|
|
map['exercise_snapshot_id'] = Variable<String>(exerciseSnapshotId);
|
|
map['program_index'] = Variable<int>(programIndex);
|
|
map['exercise_index'] = Variable<int>(exerciseIndex);
|
|
map['set_index'] = Variable<int>(setIndex);
|
|
map['program_name_snapshot'] = Variable<String>(programNameSnapshot);
|
|
map['exercise_name_snapshot'] = Variable<String>(exerciseNameSnapshot);
|
|
map['time_enabled_snapshot'] = Variable<bool>(timeEnabledSnapshot);
|
|
map['reps_enabled_snapshot'] = Variable<bool>(repsEnabledSnapshot);
|
|
map['score_enabled_snapshot'] = Variable<bool>(scoreEnabledSnapshot);
|
|
map['score_input_mode_snapshot'] = Variable<String>(scoreInputModeSnapshot);
|
|
if (!nullToAbsent || targetTimeSecondsSnapshot != null) {
|
|
map['target_time_seconds_snapshot'] = Variable<int>(
|
|
targetTimeSecondsSnapshot,
|
|
);
|
|
}
|
|
if (!nullToAbsent || targetRepsSnapshot != null) {
|
|
map['target_reps_snapshot'] = Variable<int>(targetRepsSnapshot);
|
|
}
|
|
if (!nullToAbsent || targetScoreSnapshot != null) {
|
|
map['target_score_snapshot'] = Variable<double>(targetScoreSnapshot);
|
|
}
|
|
if (!nullToAbsent || targetScoreTimeMsSnapshot != null) {
|
|
map['target_score_time_ms_snapshot'] = Variable<int>(
|
|
targetScoreTimeMsSnapshot,
|
|
);
|
|
}
|
|
if (!nullToAbsent || actualTimeMs != null) {
|
|
map['actual_time_ms'] = Variable<int>(actualTimeMs);
|
|
}
|
|
if (!nullToAbsent || actualReps != null) {
|
|
map['actual_reps'] = Variable<int>(actualReps);
|
|
}
|
|
if (!nullToAbsent || actualScore != null) {
|
|
map['actual_score'] = Variable<double>(actualScore);
|
|
}
|
|
if (!nullToAbsent || actualScoreTimeMs != null) {
|
|
map['actual_score_time_ms'] = Variable<int>(actualScoreTimeMs);
|
|
}
|
|
if (!nullToAbsent || scoreLabelSnapshot != null) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot);
|
|
}
|
|
if (!nullToAbsent || scoreUnitSnapshot != null) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot);
|
|
}
|
|
if (!nullToAbsent || startedAt != null) {
|
|
map['started_at'] = Variable<DateTime>(startedAt);
|
|
}
|
|
if (!nullToAbsent || completedAt != null) {
|
|
map['completed_at'] = Variable<DateTime>(completedAt);
|
|
}
|
|
map['status'] = Variable<String>(status);
|
|
return map;
|
|
}
|
|
|
|
WorkoutHistorySetResultsCompanion toCompanion(bool nullToAbsent) {
|
|
return WorkoutHistorySetResultsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
workoutHistoryId: Value(workoutHistoryId),
|
|
programSnapshotId: Value(programSnapshotId),
|
|
exerciseSnapshotId: Value(exerciseSnapshotId),
|
|
programIndex: Value(programIndex),
|
|
exerciseIndex: Value(exerciseIndex),
|
|
setIndex: Value(setIndex),
|
|
programNameSnapshot: Value(programNameSnapshot),
|
|
exerciseNameSnapshot: Value(exerciseNameSnapshot),
|
|
timeEnabledSnapshot: Value(timeEnabledSnapshot),
|
|
repsEnabledSnapshot: Value(repsEnabledSnapshot),
|
|
scoreEnabledSnapshot: Value(scoreEnabledSnapshot),
|
|
scoreInputModeSnapshot: Value(scoreInputModeSnapshot),
|
|
targetTimeSecondsSnapshot:
|
|
targetTimeSecondsSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetTimeSecondsSnapshot),
|
|
targetRepsSnapshot: targetRepsSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetRepsSnapshot),
|
|
targetScoreSnapshot: targetScoreSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScoreSnapshot),
|
|
targetScoreTimeMsSnapshot:
|
|
targetScoreTimeMsSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScoreTimeMsSnapshot),
|
|
actualTimeMs: actualTimeMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualTimeMs),
|
|
actualReps: actualReps == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualReps),
|
|
actualScore: actualScore == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualScore),
|
|
actualScoreTimeMs: actualScoreTimeMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(actualScoreTimeMs),
|
|
scoreLabelSnapshot: scoreLabelSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreLabelSnapshot),
|
|
scoreUnitSnapshot: scoreUnitSnapshot == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(scoreUnitSnapshot),
|
|
startedAt: startedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(startedAt),
|
|
completedAt: completedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(completedAt),
|
|
status: Value(status),
|
|
);
|
|
}
|
|
|
|
factory WorkoutHistorySetResult.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WorkoutHistorySetResult(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
workoutHistoryId: serializer.fromJson<String>(json['workoutHistoryId']),
|
|
programSnapshotId: serializer.fromJson<String>(json['programSnapshotId']),
|
|
exerciseSnapshotId: serializer.fromJson<String>(
|
|
json['exerciseSnapshotId'],
|
|
),
|
|
programIndex: serializer.fromJson<int>(json['programIndex']),
|
|
exerciseIndex: serializer.fromJson<int>(json['exerciseIndex']),
|
|
setIndex: serializer.fromJson<int>(json['setIndex']),
|
|
programNameSnapshot: serializer.fromJson<String>(
|
|
json['programNameSnapshot'],
|
|
),
|
|
exerciseNameSnapshot: serializer.fromJson<String>(
|
|
json['exerciseNameSnapshot'],
|
|
),
|
|
timeEnabledSnapshot: serializer.fromJson<bool>(
|
|
json['timeEnabledSnapshot'],
|
|
),
|
|
repsEnabledSnapshot: serializer.fromJson<bool>(
|
|
json['repsEnabledSnapshot'],
|
|
),
|
|
scoreEnabledSnapshot: serializer.fromJson<bool>(
|
|
json['scoreEnabledSnapshot'],
|
|
),
|
|
scoreInputModeSnapshot: serializer.fromJson<String>(
|
|
json['scoreInputModeSnapshot'],
|
|
),
|
|
targetTimeSecondsSnapshot: serializer.fromJson<int?>(
|
|
json['targetTimeSecondsSnapshot'],
|
|
),
|
|
targetRepsSnapshot: serializer.fromJson<int?>(json['targetRepsSnapshot']),
|
|
targetScoreSnapshot: serializer.fromJson<double?>(
|
|
json['targetScoreSnapshot'],
|
|
),
|
|
targetScoreTimeMsSnapshot: serializer.fromJson<int?>(
|
|
json['targetScoreTimeMsSnapshot'],
|
|
),
|
|
actualTimeMs: serializer.fromJson<int?>(json['actualTimeMs']),
|
|
actualReps: serializer.fromJson<int?>(json['actualReps']),
|
|
actualScore: serializer.fromJson<double?>(json['actualScore']),
|
|
actualScoreTimeMs: serializer.fromJson<int?>(json['actualScoreTimeMs']),
|
|
scoreLabelSnapshot: serializer.fromJson<String?>(
|
|
json['scoreLabelSnapshot'],
|
|
),
|
|
scoreUnitSnapshot: serializer.fromJson<String?>(
|
|
json['scoreUnitSnapshot'],
|
|
),
|
|
startedAt: serializer.fromJson<DateTime?>(json['startedAt']),
|
|
completedAt: serializer.fromJson<DateTime?>(json['completedAt']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'workoutHistoryId': serializer.toJson<String>(workoutHistoryId),
|
|
'programSnapshotId': serializer.toJson<String>(programSnapshotId),
|
|
'exerciseSnapshotId': serializer.toJson<String>(exerciseSnapshotId),
|
|
'programIndex': serializer.toJson<int>(programIndex),
|
|
'exerciseIndex': serializer.toJson<int>(exerciseIndex),
|
|
'setIndex': serializer.toJson<int>(setIndex),
|
|
'programNameSnapshot': serializer.toJson<String>(programNameSnapshot),
|
|
'exerciseNameSnapshot': serializer.toJson<String>(exerciseNameSnapshot),
|
|
'timeEnabledSnapshot': serializer.toJson<bool>(timeEnabledSnapshot),
|
|
'repsEnabledSnapshot': serializer.toJson<bool>(repsEnabledSnapshot),
|
|
'scoreEnabledSnapshot': serializer.toJson<bool>(scoreEnabledSnapshot),
|
|
'scoreInputModeSnapshot': serializer.toJson<String>(
|
|
scoreInputModeSnapshot,
|
|
),
|
|
'targetTimeSecondsSnapshot': serializer.toJson<int?>(
|
|
targetTimeSecondsSnapshot,
|
|
),
|
|
'targetRepsSnapshot': serializer.toJson<int?>(targetRepsSnapshot),
|
|
'targetScoreSnapshot': serializer.toJson<double?>(targetScoreSnapshot),
|
|
'targetScoreTimeMsSnapshot': serializer.toJson<int?>(
|
|
targetScoreTimeMsSnapshot,
|
|
),
|
|
'actualTimeMs': serializer.toJson<int?>(actualTimeMs),
|
|
'actualReps': serializer.toJson<int?>(actualReps),
|
|
'actualScore': serializer.toJson<double?>(actualScore),
|
|
'actualScoreTimeMs': serializer.toJson<int?>(actualScoreTimeMs),
|
|
'scoreLabelSnapshot': serializer.toJson<String?>(scoreLabelSnapshot),
|
|
'scoreUnitSnapshot': serializer.toJson<String?>(scoreUnitSnapshot),
|
|
'startedAt': serializer.toJson<DateTime?>(startedAt),
|
|
'completedAt': serializer.toJson<DateTime?>(completedAt),
|
|
'status': serializer.toJson<String>(status),
|
|
};
|
|
}
|
|
|
|
WorkoutHistorySetResult copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? workoutHistoryId,
|
|
String? programSnapshotId,
|
|
String? exerciseSnapshotId,
|
|
int? programIndex,
|
|
int? exerciseIndex,
|
|
int? setIndex,
|
|
String? programNameSnapshot,
|
|
String? exerciseNameSnapshot,
|
|
bool? timeEnabledSnapshot,
|
|
bool? repsEnabledSnapshot,
|
|
bool? scoreEnabledSnapshot,
|
|
String? scoreInputModeSnapshot,
|
|
Value<int?> targetTimeSecondsSnapshot = const Value.absent(),
|
|
Value<int?> targetRepsSnapshot = const Value.absent(),
|
|
Value<double?> targetScoreSnapshot = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsSnapshot = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
String? status,
|
|
}) => WorkoutHistorySetResult(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutHistoryId: workoutHistoryId ?? this.workoutHistoryId,
|
|
programSnapshotId: programSnapshotId ?? this.programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId ?? this.exerciseSnapshotId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
programNameSnapshot: programNameSnapshot ?? this.programNameSnapshot,
|
|
exerciseNameSnapshot: exerciseNameSnapshot ?? this.exerciseNameSnapshot,
|
|
timeEnabledSnapshot: timeEnabledSnapshot ?? this.timeEnabledSnapshot,
|
|
repsEnabledSnapshot: repsEnabledSnapshot ?? this.repsEnabledSnapshot,
|
|
scoreEnabledSnapshot: scoreEnabledSnapshot ?? this.scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot: targetTimeSecondsSnapshot.present
|
|
? targetTimeSecondsSnapshot.value
|
|
: this.targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot: targetRepsSnapshot.present
|
|
? targetRepsSnapshot.value
|
|
: this.targetRepsSnapshot,
|
|
targetScoreSnapshot: targetScoreSnapshot.present
|
|
? targetScoreSnapshot.value
|
|
: this.targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot: targetScoreTimeMsSnapshot.present
|
|
? targetScoreTimeMsSnapshot.value
|
|
: this.targetScoreTimeMsSnapshot,
|
|
actualTimeMs: actualTimeMs.present ? actualTimeMs.value : this.actualTimeMs,
|
|
actualReps: actualReps.present ? actualReps.value : this.actualReps,
|
|
actualScore: actualScore.present ? actualScore.value : this.actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs.present
|
|
? actualScoreTimeMs.value
|
|
: this.actualScoreTimeMs,
|
|
scoreLabelSnapshot: scoreLabelSnapshot.present
|
|
? scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot.present
|
|
? scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
startedAt: startedAt.present ? startedAt.value : this.startedAt,
|
|
completedAt: completedAt.present ? completedAt.value : this.completedAt,
|
|
status: status ?? this.status,
|
|
);
|
|
WorkoutHistorySetResult copyWithCompanion(
|
|
WorkoutHistorySetResultsCompanion data,
|
|
) {
|
|
return WorkoutHistorySetResult(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutHistoryId: data.workoutHistoryId.present
|
|
? data.workoutHistoryId.value
|
|
: this.workoutHistoryId,
|
|
programSnapshotId: data.programSnapshotId.present
|
|
? data.programSnapshotId.value
|
|
: this.programSnapshotId,
|
|
exerciseSnapshotId: data.exerciseSnapshotId.present
|
|
? data.exerciseSnapshotId.value
|
|
: this.exerciseSnapshotId,
|
|
programIndex: data.programIndex.present
|
|
? data.programIndex.value
|
|
: this.programIndex,
|
|
exerciseIndex: data.exerciseIndex.present
|
|
? data.exerciseIndex.value
|
|
: this.exerciseIndex,
|
|
setIndex: data.setIndex.present ? data.setIndex.value : this.setIndex,
|
|
programNameSnapshot: data.programNameSnapshot.present
|
|
? data.programNameSnapshot.value
|
|
: this.programNameSnapshot,
|
|
exerciseNameSnapshot: data.exerciseNameSnapshot.present
|
|
? data.exerciseNameSnapshot.value
|
|
: this.exerciseNameSnapshot,
|
|
timeEnabledSnapshot: data.timeEnabledSnapshot.present
|
|
? data.timeEnabledSnapshot.value
|
|
: this.timeEnabledSnapshot,
|
|
repsEnabledSnapshot: data.repsEnabledSnapshot.present
|
|
? data.repsEnabledSnapshot.value
|
|
: this.repsEnabledSnapshot,
|
|
scoreEnabledSnapshot: data.scoreEnabledSnapshot.present
|
|
? data.scoreEnabledSnapshot.value
|
|
: this.scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot: data.scoreInputModeSnapshot.present
|
|
? data.scoreInputModeSnapshot.value
|
|
: this.scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot: data.targetTimeSecondsSnapshot.present
|
|
? data.targetTimeSecondsSnapshot.value
|
|
: this.targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot: data.targetRepsSnapshot.present
|
|
? data.targetRepsSnapshot.value
|
|
: this.targetRepsSnapshot,
|
|
targetScoreSnapshot: data.targetScoreSnapshot.present
|
|
? data.targetScoreSnapshot.value
|
|
: this.targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot: data.targetScoreTimeMsSnapshot.present
|
|
? data.targetScoreTimeMsSnapshot.value
|
|
: this.targetScoreTimeMsSnapshot,
|
|
actualTimeMs: data.actualTimeMs.present
|
|
? data.actualTimeMs.value
|
|
: this.actualTimeMs,
|
|
actualReps: data.actualReps.present
|
|
? data.actualReps.value
|
|
: this.actualReps,
|
|
actualScore: data.actualScore.present
|
|
? data.actualScore.value
|
|
: this.actualScore,
|
|
actualScoreTimeMs: data.actualScoreTimeMs.present
|
|
? data.actualScoreTimeMs.value
|
|
: this.actualScoreTimeMs,
|
|
scoreLabelSnapshot: data.scoreLabelSnapshot.present
|
|
? data.scoreLabelSnapshot.value
|
|
: this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: data.scoreUnitSnapshot.present
|
|
? data.scoreUnitSnapshot.value
|
|
: this.scoreUnitSnapshot,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
completedAt: data.completedAt.present
|
|
? data.completedAt.value
|
|
: this.completedAt,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutHistorySetResult(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutHistoryId: $workoutHistoryId, ')
|
|
..write('programSnapshotId: $programSnapshotId, ')
|
|
..write('exerciseSnapshotId: $exerciseSnapshotId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('programNameSnapshot: $programNameSnapshot, ')
|
|
..write('exerciseNameSnapshot: $exerciseNameSnapshot, ')
|
|
..write('timeEnabledSnapshot: $timeEnabledSnapshot, ')
|
|
..write('repsEnabledSnapshot: $repsEnabledSnapshot, ')
|
|
..write('scoreEnabledSnapshot: $scoreEnabledSnapshot, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('targetTimeSecondsSnapshot: $targetTimeSecondsSnapshot, ')
|
|
..write('targetRepsSnapshot: $targetRepsSnapshot, ')
|
|
..write('targetScoreSnapshot: $targetScoreSnapshot, ')
|
|
..write('targetScoreTimeMsSnapshot: $targetScoreTimeMsSnapshot, ')
|
|
..write('actualTimeMs: $actualTimeMs, ')
|
|
..write('actualReps: $actualReps, ')
|
|
..write('actualScore: $actualScore, ')
|
|
..write('actualScoreTimeMs: $actualScoreTimeMs, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('completedAt: $completedAt, ')
|
|
..write('status: $status')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutHistoryId,
|
|
programSnapshotId,
|
|
exerciseSnapshotId,
|
|
programIndex,
|
|
exerciseIndex,
|
|
setIndex,
|
|
programNameSnapshot,
|
|
exerciseNameSnapshot,
|
|
timeEnabledSnapshot,
|
|
repsEnabledSnapshot,
|
|
scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot,
|
|
targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot,
|
|
actualTimeMs,
|
|
actualReps,
|
|
actualScore,
|
|
actualScoreTimeMs,
|
|
scoreLabelSnapshot,
|
|
scoreUnitSnapshot,
|
|
startedAt,
|
|
completedAt,
|
|
status,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WorkoutHistorySetResult &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.workoutHistoryId == this.workoutHistoryId &&
|
|
other.programSnapshotId == this.programSnapshotId &&
|
|
other.exerciseSnapshotId == this.exerciseSnapshotId &&
|
|
other.programIndex == this.programIndex &&
|
|
other.exerciseIndex == this.exerciseIndex &&
|
|
other.setIndex == this.setIndex &&
|
|
other.programNameSnapshot == this.programNameSnapshot &&
|
|
other.exerciseNameSnapshot == this.exerciseNameSnapshot &&
|
|
other.timeEnabledSnapshot == this.timeEnabledSnapshot &&
|
|
other.repsEnabledSnapshot == this.repsEnabledSnapshot &&
|
|
other.scoreEnabledSnapshot == this.scoreEnabledSnapshot &&
|
|
other.scoreInputModeSnapshot == this.scoreInputModeSnapshot &&
|
|
other.targetTimeSecondsSnapshot == this.targetTimeSecondsSnapshot &&
|
|
other.targetRepsSnapshot == this.targetRepsSnapshot &&
|
|
other.targetScoreSnapshot == this.targetScoreSnapshot &&
|
|
other.targetScoreTimeMsSnapshot == this.targetScoreTimeMsSnapshot &&
|
|
other.actualTimeMs == this.actualTimeMs &&
|
|
other.actualReps == this.actualReps &&
|
|
other.actualScore == this.actualScore &&
|
|
other.actualScoreTimeMs == this.actualScoreTimeMs &&
|
|
other.scoreLabelSnapshot == this.scoreLabelSnapshot &&
|
|
other.scoreUnitSnapshot == this.scoreUnitSnapshot &&
|
|
other.startedAt == this.startedAt &&
|
|
other.completedAt == this.completedAt &&
|
|
other.status == this.status);
|
|
}
|
|
|
|
class WorkoutHistorySetResultsCompanion
|
|
extends UpdateCompanion<WorkoutHistorySetResult> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> workoutHistoryId;
|
|
final Value<String> programSnapshotId;
|
|
final Value<String> exerciseSnapshotId;
|
|
final Value<int> programIndex;
|
|
final Value<int> exerciseIndex;
|
|
final Value<int> setIndex;
|
|
final Value<String> programNameSnapshot;
|
|
final Value<String> exerciseNameSnapshot;
|
|
final Value<bool> timeEnabledSnapshot;
|
|
final Value<bool> repsEnabledSnapshot;
|
|
final Value<bool> scoreEnabledSnapshot;
|
|
final Value<String> scoreInputModeSnapshot;
|
|
final Value<int?> targetTimeSecondsSnapshot;
|
|
final Value<int?> targetRepsSnapshot;
|
|
final Value<double?> targetScoreSnapshot;
|
|
final Value<int?> targetScoreTimeMsSnapshot;
|
|
final Value<int?> actualTimeMs;
|
|
final Value<int?> actualReps;
|
|
final Value<double?> actualScore;
|
|
final Value<int?> actualScoreTimeMs;
|
|
final Value<String?> scoreLabelSnapshot;
|
|
final Value<String?> scoreUnitSnapshot;
|
|
final Value<DateTime?> startedAt;
|
|
final Value<DateTime?> completedAt;
|
|
final Value<String> status;
|
|
final Value<int> rowid;
|
|
const WorkoutHistorySetResultsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.workoutHistoryId = const Value.absent(),
|
|
this.programSnapshotId = const Value.absent(),
|
|
this.exerciseSnapshotId = const Value.absent(),
|
|
this.programIndex = const Value.absent(),
|
|
this.exerciseIndex = const Value.absent(),
|
|
this.setIndex = const Value.absent(),
|
|
this.programNameSnapshot = const Value.absent(),
|
|
this.exerciseNameSnapshot = const Value.absent(),
|
|
this.timeEnabledSnapshot = const Value.absent(),
|
|
this.repsEnabledSnapshot = const Value.absent(),
|
|
this.scoreEnabledSnapshot = const Value.absent(),
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.targetTimeSecondsSnapshot = const Value.absent(),
|
|
this.targetRepsSnapshot = const Value.absent(),
|
|
this.targetScoreSnapshot = const Value.absent(),
|
|
this.targetScoreTimeMsSnapshot = const Value.absent(),
|
|
this.actualTimeMs = const Value.absent(),
|
|
this.actualReps = const Value.absent(),
|
|
this.actualScore = const Value.absent(),
|
|
this.actualScoreTimeMs = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.completedAt = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
WorkoutHistorySetResultsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String workoutHistoryId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String programNameSnapshot,
|
|
required String exerciseNameSnapshot,
|
|
required bool timeEnabledSnapshot,
|
|
required bool repsEnabledSnapshot,
|
|
required bool scoreEnabledSnapshot,
|
|
this.scoreInputModeSnapshot = const Value.absent(),
|
|
this.targetTimeSecondsSnapshot = const Value.absent(),
|
|
this.targetRepsSnapshot = const Value.absent(),
|
|
this.targetScoreSnapshot = const Value.absent(),
|
|
this.targetScoreTimeMsSnapshot = const Value.absent(),
|
|
this.actualTimeMs = const Value.absent(),
|
|
this.actualReps = const Value.absent(),
|
|
this.actualScore = const Value.absent(),
|
|
this.actualScoreTimeMs = const Value.absent(),
|
|
this.scoreLabelSnapshot = const Value.absent(),
|
|
this.scoreUnitSnapshot = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.completedAt = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
workoutHistoryId = Value(workoutHistoryId),
|
|
programSnapshotId = Value(programSnapshotId),
|
|
exerciseSnapshotId = Value(exerciseSnapshotId),
|
|
programIndex = Value(programIndex),
|
|
exerciseIndex = Value(exerciseIndex),
|
|
setIndex = Value(setIndex),
|
|
programNameSnapshot = Value(programNameSnapshot),
|
|
exerciseNameSnapshot = Value(exerciseNameSnapshot),
|
|
timeEnabledSnapshot = Value(timeEnabledSnapshot),
|
|
repsEnabledSnapshot = Value(repsEnabledSnapshot),
|
|
scoreEnabledSnapshot = Value(scoreEnabledSnapshot);
|
|
static Insertable<WorkoutHistorySetResult> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? workoutHistoryId,
|
|
Expression<String>? programSnapshotId,
|
|
Expression<String>? exerciseSnapshotId,
|
|
Expression<int>? programIndex,
|
|
Expression<int>? exerciseIndex,
|
|
Expression<int>? setIndex,
|
|
Expression<String>? programNameSnapshot,
|
|
Expression<String>? exerciseNameSnapshot,
|
|
Expression<bool>? timeEnabledSnapshot,
|
|
Expression<bool>? repsEnabledSnapshot,
|
|
Expression<bool>? scoreEnabledSnapshot,
|
|
Expression<String>? scoreInputModeSnapshot,
|
|
Expression<int>? targetTimeSecondsSnapshot,
|
|
Expression<int>? targetRepsSnapshot,
|
|
Expression<double>? targetScoreSnapshot,
|
|
Expression<int>? targetScoreTimeMsSnapshot,
|
|
Expression<int>? actualTimeMs,
|
|
Expression<int>? actualReps,
|
|
Expression<double>? actualScore,
|
|
Expression<int>? actualScoreTimeMs,
|
|
Expression<String>? scoreLabelSnapshot,
|
|
Expression<String>? scoreUnitSnapshot,
|
|
Expression<DateTime>? startedAt,
|
|
Expression<DateTime>? completedAt,
|
|
Expression<String>? status,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (workoutHistoryId != null) 'workout_history_id': workoutHistoryId,
|
|
if (programSnapshotId != null) 'program_snapshot_id': programSnapshotId,
|
|
if (exerciseSnapshotId != null)
|
|
'exercise_snapshot_id': exerciseSnapshotId,
|
|
if (programIndex != null) 'program_index': programIndex,
|
|
if (exerciseIndex != null) 'exercise_index': exerciseIndex,
|
|
if (setIndex != null) 'set_index': setIndex,
|
|
if (programNameSnapshot != null)
|
|
'program_name_snapshot': programNameSnapshot,
|
|
if (exerciseNameSnapshot != null)
|
|
'exercise_name_snapshot': exerciseNameSnapshot,
|
|
if (timeEnabledSnapshot != null)
|
|
'time_enabled_snapshot': timeEnabledSnapshot,
|
|
if (repsEnabledSnapshot != null)
|
|
'reps_enabled_snapshot': repsEnabledSnapshot,
|
|
if (scoreEnabledSnapshot != null)
|
|
'score_enabled_snapshot': scoreEnabledSnapshot,
|
|
if (scoreInputModeSnapshot != null)
|
|
'score_input_mode_snapshot': scoreInputModeSnapshot,
|
|
if (targetTimeSecondsSnapshot != null)
|
|
'target_time_seconds_snapshot': targetTimeSecondsSnapshot,
|
|
if (targetRepsSnapshot != null)
|
|
'target_reps_snapshot': targetRepsSnapshot,
|
|
if (targetScoreSnapshot != null)
|
|
'target_score_snapshot': targetScoreSnapshot,
|
|
if (targetScoreTimeMsSnapshot != null)
|
|
'target_score_time_ms_snapshot': targetScoreTimeMsSnapshot,
|
|
if (actualTimeMs != null) 'actual_time_ms': actualTimeMs,
|
|
if (actualReps != null) 'actual_reps': actualReps,
|
|
if (actualScore != null) 'actual_score': actualScore,
|
|
if (actualScoreTimeMs != null) 'actual_score_time_ms': actualScoreTimeMs,
|
|
if (scoreLabelSnapshot != null)
|
|
'score_label_snapshot': scoreLabelSnapshot,
|
|
if (scoreUnitSnapshot != null) 'score_unit_snapshot': scoreUnitSnapshot,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (completedAt != null) 'completed_at': completedAt,
|
|
if (status != null) 'status': status,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
WorkoutHistorySetResultsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? workoutHistoryId,
|
|
Value<String>? programSnapshotId,
|
|
Value<String>? exerciseSnapshotId,
|
|
Value<int>? programIndex,
|
|
Value<int>? exerciseIndex,
|
|
Value<int>? setIndex,
|
|
Value<String>? programNameSnapshot,
|
|
Value<String>? exerciseNameSnapshot,
|
|
Value<bool>? timeEnabledSnapshot,
|
|
Value<bool>? repsEnabledSnapshot,
|
|
Value<bool>? scoreEnabledSnapshot,
|
|
Value<String>? scoreInputModeSnapshot,
|
|
Value<int?>? targetTimeSecondsSnapshot,
|
|
Value<int?>? targetRepsSnapshot,
|
|
Value<double?>? targetScoreSnapshot,
|
|
Value<int?>? targetScoreTimeMsSnapshot,
|
|
Value<int?>? actualTimeMs,
|
|
Value<int?>? actualReps,
|
|
Value<double?>? actualScore,
|
|
Value<int?>? actualScoreTimeMs,
|
|
Value<String?>? scoreLabelSnapshot,
|
|
Value<String?>? scoreUnitSnapshot,
|
|
Value<DateTime?>? startedAt,
|
|
Value<DateTime?>? completedAt,
|
|
Value<String>? status,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return WorkoutHistorySetResultsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
workoutHistoryId: workoutHistoryId ?? this.workoutHistoryId,
|
|
programSnapshotId: programSnapshotId ?? this.programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId ?? this.exerciseSnapshotId,
|
|
programIndex: programIndex ?? this.programIndex,
|
|
exerciseIndex: exerciseIndex ?? this.exerciseIndex,
|
|
setIndex: setIndex ?? this.setIndex,
|
|
programNameSnapshot: programNameSnapshot ?? this.programNameSnapshot,
|
|
exerciseNameSnapshot: exerciseNameSnapshot ?? this.exerciseNameSnapshot,
|
|
timeEnabledSnapshot: timeEnabledSnapshot ?? this.timeEnabledSnapshot,
|
|
repsEnabledSnapshot: repsEnabledSnapshot ?? this.repsEnabledSnapshot,
|
|
scoreEnabledSnapshot: scoreEnabledSnapshot ?? this.scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot:
|
|
scoreInputModeSnapshot ?? this.scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot:
|
|
targetTimeSecondsSnapshot ?? this.targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot: targetRepsSnapshot ?? this.targetRepsSnapshot,
|
|
targetScoreSnapshot: targetScoreSnapshot ?? this.targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot:
|
|
targetScoreTimeMsSnapshot ?? this.targetScoreTimeMsSnapshot,
|
|
actualTimeMs: actualTimeMs ?? this.actualTimeMs,
|
|
actualReps: actualReps ?? this.actualReps,
|
|
actualScore: actualScore ?? this.actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs ?? this.actualScoreTimeMs,
|
|
scoreLabelSnapshot: scoreLabelSnapshot ?? this.scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot ?? this.scoreUnitSnapshot,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
completedAt: completedAt ?? this.completedAt,
|
|
status: status ?? this.status,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (workoutHistoryId.present) {
|
|
map['workout_history_id'] = Variable<String>(workoutHistoryId.value);
|
|
}
|
|
if (programSnapshotId.present) {
|
|
map['program_snapshot_id'] = Variable<String>(programSnapshotId.value);
|
|
}
|
|
if (exerciseSnapshotId.present) {
|
|
map['exercise_snapshot_id'] = Variable<String>(exerciseSnapshotId.value);
|
|
}
|
|
if (programIndex.present) {
|
|
map['program_index'] = Variable<int>(programIndex.value);
|
|
}
|
|
if (exerciseIndex.present) {
|
|
map['exercise_index'] = Variable<int>(exerciseIndex.value);
|
|
}
|
|
if (setIndex.present) {
|
|
map['set_index'] = Variable<int>(setIndex.value);
|
|
}
|
|
if (programNameSnapshot.present) {
|
|
map['program_name_snapshot'] = Variable<String>(
|
|
programNameSnapshot.value,
|
|
);
|
|
}
|
|
if (exerciseNameSnapshot.present) {
|
|
map['exercise_name_snapshot'] = Variable<String>(
|
|
exerciseNameSnapshot.value,
|
|
);
|
|
}
|
|
if (timeEnabledSnapshot.present) {
|
|
map['time_enabled_snapshot'] = Variable<bool>(timeEnabledSnapshot.value);
|
|
}
|
|
if (repsEnabledSnapshot.present) {
|
|
map['reps_enabled_snapshot'] = Variable<bool>(repsEnabledSnapshot.value);
|
|
}
|
|
if (scoreEnabledSnapshot.present) {
|
|
map['score_enabled_snapshot'] = Variable<bool>(
|
|
scoreEnabledSnapshot.value,
|
|
);
|
|
}
|
|
if (scoreInputModeSnapshot.present) {
|
|
map['score_input_mode_snapshot'] = Variable<String>(
|
|
scoreInputModeSnapshot.value,
|
|
);
|
|
}
|
|
if (targetTimeSecondsSnapshot.present) {
|
|
map['target_time_seconds_snapshot'] = Variable<int>(
|
|
targetTimeSecondsSnapshot.value,
|
|
);
|
|
}
|
|
if (targetRepsSnapshot.present) {
|
|
map['target_reps_snapshot'] = Variable<int>(targetRepsSnapshot.value);
|
|
}
|
|
if (targetScoreSnapshot.present) {
|
|
map['target_score_snapshot'] = Variable<double>(
|
|
targetScoreSnapshot.value,
|
|
);
|
|
}
|
|
if (targetScoreTimeMsSnapshot.present) {
|
|
map['target_score_time_ms_snapshot'] = Variable<int>(
|
|
targetScoreTimeMsSnapshot.value,
|
|
);
|
|
}
|
|
if (actualTimeMs.present) {
|
|
map['actual_time_ms'] = Variable<int>(actualTimeMs.value);
|
|
}
|
|
if (actualReps.present) {
|
|
map['actual_reps'] = Variable<int>(actualReps.value);
|
|
}
|
|
if (actualScore.present) {
|
|
map['actual_score'] = Variable<double>(actualScore.value);
|
|
}
|
|
if (actualScoreTimeMs.present) {
|
|
map['actual_score_time_ms'] = Variable<int>(actualScoreTimeMs.value);
|
|
}
|
|
if (scoreLabelSnapshot.present) {
|
|
map['score_label_snapshot'] = Variable<String>(scoreLabelSnapshot.value);
|
|
}
|
|
if (scoreUnitSnapshot.present) {
|
|
map['score_unit_snapshot'] = Variable<String>(scoreUnitSnapshot.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<DateTime>(startedAt.value);
|
|
}
|
|
if (completedAt.present) {
|
|
map['completed_at'] = Variable<DateTime>(completedAt.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutHistorySetResultsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutHistoryId: $workoutHistoryId, ')
|
|
..write('programSnapshotId: $programSnapshotId, ')
|
|
..write('exerciseSnapshotId: $exerciseSnapshotId, ')
|
|
..write('programIndex: $programIndex, ')
|
|
..write('exerciseIndex: $exerciseIndex, ')
|
|
..write('setIndex: $setIndex, ')
|
|
..write('programNameSnapshot: $programNameSnapshot, ')
|
|
..write('exerciseNameSnapshot: $exerciseNameSnapshot, ')
|
|
..write('timeEnabledSnapshot: $timeEnabledSnapshot, ')
|
|
..write('repsEnabledSnapshot: $repsEnabledSnapshot, ')
|
|
..write('scoreEnabledSnapshot: $scoreEnabledSnapshot, ')
|
|
..write('scoreInputModeSnapshot: $scoreInputModeSnapshot, ')
|
|
..write('targetTimeSecondsSnapshot: $targetTimeSecondsSnapshot, ')
|
|
..write('targetRepsSnapshot: $targetRepsSnapshot, ')
|
|
..write('targetScoreSnapshot: $targetScoreSnapshot, ')
|
|
..write('targetScoreTimeMsSnapshot: $targetScoreTimeMsSnapshot, ')
|
|
..write('actualTimeMs: $actualTimeMs, ')
|
|
..write('actualReps: $actualReps, ')
|
|
..write('actualScore: $actualScore, ')
|
|
..write('actualScoreTimeMs: $actualScoreTimeMs, ')
|
|
..write('scoreLabelSnapshot: $scoreLabelSnapshot, ')
|
|
..write('scoreUnitSnapshot: $scoreUnitSnapshot, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('completedAt: $completedAt, ')
|
|
..write('status: $status, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $WorkoutTemplateProgramsTable extends WorkoutTemplatePrograms
|
|
with TableInfo<$WorkoutTemplateProgramsTable, WorkoutTemplateProgram> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WorkoutTemplateProgramsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _workoutTemplateIdMeta = const VerificationMeta(
|
|
'workoutTemplateId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> workoutTemplateId =
|
|
GeneratedColumn<String>(
|
|
'workout_template_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES workout_templates (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _sourceProgramIdMeta = const VerificationMeta(
|
|
'sourceProgramId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sourceProgramId = GeneratedColumn<String>(
|
|
'source_program_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES programs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _positionMeta = const VerificationMeta(
|
|
'position',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _programNameSnapshotMeta =
|
|
const VerificationMeta('programNameSnapshot');
|
|
@override
|
|
late final GeneratedColumn<String> programNameSnapshot =
|
|
GeneratedColumn<String>(
|
|
'program_name_snapshot',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _defaultRestSecondsSnapshotMeta =
|
|
const VerificationMeta('defaultRestSecondsSnapshot');
|
|
@override
|
|
late final GeneratedColumn<int> defaultRestSecondsSnapshot =
|
|
GeneratedColumn<int>(
|
|
'default_rest_seconds_snapshot',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _programSnapshotJsonMeta =
|
|
const VerificationMeta('programSnapshotJson');
|
|
@override
|
|
late final GeneratedColumn<String> programSnapshotJson =
|
|
GeneratedColumn<String>(
|
|
'program_snapshot_json',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutTemplateId,
|
|
sourceProgramId,
|
|
position,
|
|
programNameSnapshot,
|
|
defaultRestSecondsSnapshot,
|
|
programSnapshotJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'workout_template_programs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<WorkoutTemplateProgram> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('workout_template_id')) {
|
|
context.handle(
|
|
_workoutTemplateIdMeta,
|
|
workoutTemplateId.isAcceptableOrUnknown(
|
|
data['workout_template_id']!,
|
|
_workoutTemplateIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_workoutTemplateIdMeta);
|
|
}
|
|
if (data.containsKey('source_program_id')) {
|
|
context.handle(
|
|
_sourceProgramIdMeta,
|
|
sourceProgramId.isAcceptableOrUnknown(
|
|
data['source_program_id']!,
|
|
_sourceProgramIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('position')) {
|
|
context.handle(
|
|
_positionMeta,
|
|
position.isAcceptableOrUnknown(data['position']!, _positionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMeta);
|
|
}
|
|
if (data.containsKey('program_name_snapshot')) {
|
|
context.handle(
|
|
_programNameSnapshotMeta,
|
|
programNameSnapshot.isAcceptableOrUnknown(
|
|
data['program_name_snapshot']!,
|
|
_programNameSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programNameSnapshotMeta);
|
|
}
|
|
if (data.containsKey('default_rest_seconds_snapshot')) {
|
|
context.handle(
|
|
_defaultRestSecondsSnapshotMeta,
|
|
defaultRestSecondsSnapshot.isAcceptableOrUnknown(
|
|
data['default_rest_seconds_snapshot']!,
|
|
_defaultRestSecondsSnapshotMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_defaultRestSecondsSnapshotMeta);
|
|
}
|
|
if (data.containsKey('program_snapshot_json')) {
|
|
context.handle(
|
|
_programSnapshotJsonMeta,
|
|
programSnapshotJson.isAcceptableOrUnknown(
|
|
data['program_snapshot_json']!,
|
|
_programSnapshotJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programSnapshotJsonMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WorkoutTemplateProgram map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WorkoutTemplateProgram(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
workoutTemplateId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}workout_template_id'],
|
|
)!,
|
|
sourceProgramId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_program_id'],
|
|
),
|
|
position: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position'],
|
|
)!,
|
|
programNameSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_name_snapshot'],
|
|
)!,
|
|
defaultRestSecondsSnapshot: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}default_rest_seconds_snapshot'],
|
|
)!,
|
|
programSnapshotJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_snapshot_json'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WorkoutTemplateProgramsTable createAlias(String alias) {
|
|
return $WorkoutTemplateProgramsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WorkoutTemplateProgram extends DataClass
|
|
implements Insertable<WorkoutTemplateProgram> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String workoutTemplateId;
|
|
final String? sourceProgramId;
|
|
final int position;
|
|
final String programNameSnapshot;
|
|
final int defaultRestSecondsSnapshot;
|
|
final String programSnapshotJson;
|
|
const WorkoutTemplateProgram({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.workoutTemplateId,
|
|
this.sourceProgramId,
|
|
required this.position,
|
|
required this.programNameSnapshot,
|
|
required this.defaultRestSecondsSnapshot,
|
|
required this.programSnapshotJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['workout_template_id'] = Variable<String>(workoutTemplateId);
|
|
if (!nullToAbsent || sourceProgramId != null) {
|
|
map['source_program_id'] = Variable<String>(sourceProgramId);
|
|
}
|
|
map['position'] = Variable<int>(position);
|
|
map['program_name_snapshot'] = Variable<String>(programNameSnapshot);
|
|
map['default_rest_seconds_snapshot'] = Variable<int>(
|
|
defaultRestSecondsSnapshot,
|
|
);
|
|
map['program_snapshot_json'] = Variable<String>(programSnapshotJson);
|
|
return map;
|
|
}
|
|
|
|
WorkoutTemplateProgramsCompanion toCompanion(bool nullToAbsent) {
|
|
return WorkoutTemplateProgramsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
workoutTemplateId: Value(workoutTemplateId),
|
|
sourceProgramId: sourceProgramId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceProgramId),
|
|
position: Value(position),
|
|
programNameSnapshot: Value(programNameSnapshot),
|
|
defaultRestSecondsSnapshot: Value(defaultRestSecondsSnapshot),
|
|
programSnapshotJson: Value(programSnapshotJson),
|
|
);
|
|
}
|
|
|
|
factory WorkoutTemplateProgram.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WorkoutTemplateProgram(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
workoutTemplateId: serializer.fromJson<String>(json['workoutTemplateId']),
|
|
sourceProgramId: serializer.fromJson<String?>(json['sourceProgramId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
programNameSnapshot: serializer.fromJson<String>(
|
|
json['programNameSnapshot'],
|
|
),
|
|
defaultRestSecondsSnapshot: serializer.fromJson<int>(
|
|
json['defaultRestSecondsSnapshot'],
|
|
),
|
|
programSnapshotJson: serializer.fromJson<String>(
|
|
json['programSnapshotJson'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'workoutTemplateId': serializer.toJson<String>(workoutTemplateId),
|
|
'sourceProgramId': serializer.toJson<String?>(sourceProgramId),
|
|
'position': serializer.toJson<int>(position),
|
|
'programNameSnapshot': serializer.toJson<String>(programNameSnapshot),
|
|
'defaultRestSecondsSnapshot': serializer.toJson<int>(
|
|
defaultRestSecondsSnapshot,
|
|
),
|
|
'programSnapshotJson': serializer.toJson<String>(programSnapshotJson),
|
|
};
|
|
}
|
|
|
|
WorkoutTemplateProgram copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? workoutTemplateId,
|
|
Value<String?> sourceProgramId = const Value.absent(),
|
|
int? position,
|
|
String? programNameSnapshot,
|
|
int? defaultRestSecondsSnapshot,
|
|
String? programSnapshotJson,
|
|
}) => WorkoutTemplateProgram(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutTemplateId: workoutTemplateId ?? this.workoutTemplateId,
|
|
sourceProgramId: sourceProgramId.present
|
|
? sourceProgramId.value
|
|
: this.sourceProgramId,
|
|
position: position ?? this.position,
|
|
programNameSnapshot: programNameSnapshot ?? this.programNameSnapshot,
|
|
defaultRestSecondsSnapshot:
|
|
defaultRestSecondsSnapshot ?? this.defaultRestSecondsSnapshot,
|
|
programSnapshotJson: programSnapshotJson ?? this.programSnapshotJson,
|
|
);
|
|
WorkoutTemplateProgram copyWithCompanion(
|
|
WorkoutTemplateProgramsCompanion data,
|
|
) {
|
|
return WorkoutTemplateProgram(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutTemplateId: data.workoutTemplateId.present
|
|
? data.workoutTemplateId.value
|
|
: this.workoutTemplateId,
|
|
sourceProgramId: data.sourceProgramId.present
|
|
? data.sourceProgramId.value
|
|
: this.sourceProgramId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
programNameSnapshot: data.programNameSnapshot.present
|
|
? data.programNameSnapshot.value
|
|
: this.programNameSnapshot,
|
|
defaultRestSecondsSnapshot: data.defaultRestSecondsSnapshot.present
|
|
? data.defaultRestSecondsSnapshot.value
|
|
: this.defaultRestSecondsSnapshot,
|
|
programSnapshotJson: data.programSnapshotJson.present
|
|
? data.programSnapshotJson.value
|
|
: this.programSnapshotJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplateProgram(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutTemplateId: $workoutTemplateId, ')
|
|
..write('sourceProgramId: $sourceProgramId, ')
|
|
..write('position: $position, ')
|
|
..write('programNameSnapshot: $programNameSnapshot, ')
|
|
..write('defaultRestSecondsSnapshot: $defaultRestSecondsSnapshot, ')
|
|
..write('programSnapshotJson: $programSnapshotJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutTemplateId,
|
|
sourceProgramId,
|
|
position,
|
|
programNameSnapshot,
|
|
defaultRestSecondsSnapshot,
|
|
programSnapshotJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WorkoutTemplateProgram &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.workoutTemplateId == this.workoutTemplateId &&
|
|
other.sourceProgramId == this.sourceProgramId &&
|
|
other.position == this.position &&
|
|
other.programNameSnapshot == this.programNameSnapshot &&
|
|
other.defaultRestSecondsSnapshot == this.defaultRestSecondsSnapshot &&
|
|
other.programSnapshotJson == this.programSnapshotJson);
|
|
}
|
|
|
|
class WorkoutTemplateProgramsCompanion
|
|
extends UpdateCompanion<WorkoutTemplateProgram> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> workoutTemplateId;
|
|
final Value<String?> sourceProgramId;
|
|
final Value<int> position;
|
|
final Value<String> programNameSnapshot;
|
|
final Value<int> defaultRestSecondsSnapshot;
|
|
final Value<String> programSnapshotJson;
|
|
final Value<int> rowid;
|
|
const WorkoutTemplateProgramsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.workoutTemplateId = const Value.absent(),
|
|
this.sourceProgramId = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.programNameSnapshot = const Value.absent(),
|
|
this.defaultRestSecondsSnapshot = const Value.absent(),
|
|
this.programSnapshotJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
WorkoutTemplateProgramsCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String workoutTemplateId,
|
|
this.sourceProgramId = const Value.absent(),
|
|
required int position,
|
|
required String programNameSnapshot,
|
|
required int defaultRestSecondsSnapshot,
|
|
required String programSnapshotJson,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
workoutTemplateId = Value(workoutTemplateId),
|
|
position = Value(position),
|
|
programNameSnapshot = Value(programNameSnapshot),
|
|
defaultRestSecondsSnapshot = Value(defaultRestSecondsSnapshot),
|
|
programSnapshotJson = Value(programSnapshotJson);
|
|
static Insertable<WorkoutTemplateProgram> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? workoutTemplateId,
|
|
Expression<String>? sourceProgramId,
|
|
Expression<int>? position,
|
|
Expression<String>? programNameSnapshot,
|
|
Expression<int>? defaultRestSecondsSnapshot,
|
|
Expression<String>? programSnapshotJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (workoutTemplateId != null) 'workout_template_id': workoutTemplateId,
|
|
if (sourceProgramId != null) 'source_program_id': sourceProgramId,
|
|
if (position != null) 'position': position,
|
|
if (programNameSnapshot != null)
|
|
'program_name_snapshot': programNameSnapshot,
|
|
if (defaultRestSecondsSnapshot != null)
|
|
'default_rest_seconds_snapshot': defaultRestSecondsSnapshot,
|
|
if (programSnapshotJson != null)
|
|
'program_snapshot_json': programSnapshotJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
WorkoutTemplateProgramsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? workoutTemplateId,
|
|
Value<String?>? sourceProgramId,
|
|
Value<int>? position,
|
|
Value<String>? programNameSnapshot,
|
|
Value<int>? defaultRestSecondsSnapshot,
|
|
Value<String>? programSnapshotJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return WorkoutTemplateProgramsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
workoutTemplateId: workoutTemplateId ?? this.workoutTemplateId,
|
|
sourceProgramId: sourceProgramId ?? this.sourceProgramId,
|
|
position: position ?? this.position,
|
|
programNameSnapshot: programNameSnapshot ?? this.programNameSnapshot,
|
|
defaultRestSecondsSnapshot:
|
|
defaultRestSecondsSnapshot ?? this.defaultRestSecondsSnapshot,
|
|
programSnapshotJson: programSnapshotJson ?? this.programSnapshotJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (workoutTemplateId.present) {
|
|
map['workout_template_id'] = Variable<String>(workoutTemplateId.value);
|
|
}
|
|
if (sourceProgramId.present) {
|
|
map['source_program_id'] = Variable<String>(sourceProgramId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (programNameSnapshot.present) {
|
|
map['program_name_snapshot'] = Variable<String>(
|
|
programNameSnapshot.value,
|
|
);
|
|
}
|
|
if (defaultRestSecondsSnapshot.present) {
|
|
map['default_rest_seconds_snapshot'] = Variable<int>(
|
|
defaultRestSecondsSnapshot.value,
|
|
);
|
|
}
|
|
if (programSnapshotJson.present) {
|
|
map['program_snapshot_json'] = Variable<String>(
|
|
programSnapshotJson.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplateProgramsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutTemplateId: $workoutTemplateId, ')
|
|
..write('sourceProgramId: $sourceProgramId, ')
|
|
..write('position: $position, ')
|
|
..write('programNameSnapshot: $programNameSnapshot, ')
|
|
..write('defaultRestSecondsSnapshot: $defaultRestSecondsSnapshot, ')
|
|
..write('programSnapshotJson: $programSnapshotJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $WorkoutTemplateExerciseOverridesTable
|
|
extends WorkoutTemplateExerciseOverrides
|
|
with
|
|
TableInfo<
|
|
$WorkoutTemplateExerciseOverridesTable,
|
|
WorkoutTemplateExerciseOverride
|
|
> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WorkoutTemplateExerciseOverridesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedAtMeta = const VerificationMeta(
|
|
'deletedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
|
|
'deleted_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _schemaVersionMeta = const VerificationMeta(
|
|
'schemaVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaVersion = GeneratedColumn<int>(
|
|
'schema_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _syncStateMeta = const VerificationMeta(
|
|
'syncState',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> syncState = GeneratedColumn<String>(
|
|
'sync_state',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints:
|
|
'NOT NULL CHECK (sync_state IN (\'localOnly\', \'dirty\', \'synced\', \'deleted\'))',
|
|
);
|
|
static const VerificationMeta _localRevisionMeta = const VerificationMeta(
|
|
'localRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> localRevision = GeneratedColumn<int>(
|
|
'local_revision',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'NOT NULL CHECK (local_revision >= 0)',
|
|
);
|
|
static const VerificationMeta _originDeviceIdMeta = const VerificationMeta(
|
|
'originDeviceId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originDeviceId = GeneratedColumn<String>(
|
|
'origin_device_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _futureOwnerProfileIdMeta =
|
|
const VerificationMeta('futureOwnerProfileId');
|
|
@override
|
|
late final GeneratedColumn<String> futureOwnerProfileId =
|
|
GeneratedColumn<String>(
|
|
'future_owner_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _lastSyncedAtMeta = const VerificationMeta(
|
|
'lastSyncedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastSyncedAt = GeneratedColumn<DateTime>(
|
|
'last_synced_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _remoteRevisionMeta = const VerificationMeta(
|
|
'remoteRevision',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> remoteRevision = GeneratedColumn<String>(
|
|
'remote_revision',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _workoutTemplateProgramIdMeta =
|
|
const VerificationMeta('workoutTemplateProgramId');
|
|
@override
|
|
late final GeneratedColumn<String> workoutTemplateProgramId =
|
|
GeneratedColumn<String>(
|
|
'workout_template_program_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES workout_template_programs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _snapshotProgramExerciseIdMeta =
|
|
const VerificationMeta('snapshotProgramExerciseId');
|
|
@override
|
|
late final GeneratedColumn<String> snapshotProgramExerciseId =
|
|
GeneratedColumn<String>(
|
|
'snapshot_program_exercise_id',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _setsCountOverrideMeta = const VerificationMeta(
|
|
'setsCountOverride',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> setsCountOverride = GeneratedColumn<int>(
|
|
'sets_count_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetTimeSecondsOverrideMeta =
|
|
const VerificationMeta('targetTimeSecondsOverride');
|
|
@override
|
|
late final GeneratedColumn<int> targetTimeSecondsOverride =
|
|
GeneratedColumn<int>(
|
|
'target_time_seconds_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetRepsOverrideMeta =
|
|
const VerificationMeta('targetRepsOverride');
|
|
@override
|
|
late final GeneratedColumn<int> targetRepsOverride = GeneratedColumn<int>(
|
|
'target_reps_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreOverrideMeta =
|
|
const VerificationMeta('targetScoreOverride');
|
|
@override
|
|
late final GeneratedColumn<double> targetScoreOverride =
|
|
GeneratedColumn<double>(
|
|
'target_score_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetScoreTimeMsOverrideMeta =
|
|
const VerificationMeta('targetScoreTimeMsOverride');
|
|
@override
|
|
late final GeneratedColumn<int> targetScoreTimeMsOverride =
|
|
GeneratedColumn<int>(
|
|
'target_score_time_ms_override',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutTemplateProgramId,
|
|
snapshotProgramExerciseId,
|
|
setsCountOverride,
|
|
targetTimeSecondsOverride,
|
|
targetRepsOverride,
|
|
targetScoreOverride,
|
|
targetScoreTimeMsOverride,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'workout_template_exercise_overrides';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<WorkoutTemplateExerciseOverride> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('deleted_at')) {
|
|
context.handle(
|
|
_deletedAtMeta,
|
|
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_version')) {
|
|
context.handle(
|
|
_schemaVersionMeta,
|
|
schemaVersion.isAcceptableOrUnknown(
|
|
data['schema_version']!,
|
|
_schemaVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sync_state')) {
|
|
context.handle(
|
|
_syncStateMeta,
|
|
syncState.isAcceptableOrUnknown(data['sync_state']!, _syncStateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_syncStateMeta);
|
|
}
|
|
if (data.containsKey('local_revision')) {
|
|
context.handle(
|
|
_localRevisionMeta,
|
|
localRevision.isAcceptableOrUnknown(
|
|
data['local_revision']!,
|
|
_localRevisionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_localRevisionMeta);
|
|
}
|
|
if (data.containsKey('origin_device_id')) {
|
|
context.handle(
|
|
_originDeviceIdMeta,
|
|
originDeviceId.isAcceptableOrUnknown(
|
|
data['origin_device_id']!,
|
|
_originDeviceIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originDeviceIdMeta);
|
|
}
|
|
if (data.containsKey('future_owner_profile_id')) {
|
|
context.handle(
|
|
_futureOwnerProfileIdMeta,
|
|
futureOwnerProfileId.isAcceptableOrUnknown(
|
|
data['future_owner_profile_id']!,
|
|
_futureOwnerProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('last_synced_at')) {
|
|
context.handle(
|
|
_lastSyncedAtMeta,
|
|
lastSyncedAt.isAcceptableOrUnknown(
|
|
data['last_synced_at']!,
|
|
_lastSyncedAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('remote_revision')) {
|
|
context.handle(
|
|
_remoteRevisionMeta,
|
|
remoteRevision.isAcceptableOrUnknown(
|
|
data['remote_revision']!,
|
|
_remoteRevisionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('workout_template_program_id')) {
|
|
context.handle(
|
|
_workoutTemplateProgramIdMeta,
|
|
workoutTemplateProgramId.isAcceptableOrUnknown(
|
|
data['workout_template_program_id']!,
|
|
_workoutTemplateProgramIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_workoutTemplateProgramIdMeta);
|
|
}
|
|
if (data.containsKey('snapshot_program_exercise_id')) {
|
|
context.handle(
|
|
_snapshotProgramExerciseIdMeta,
|
|
snapshotProgramExerciseId.isAcceptableOrUnknown(
|
|
data['snapshot_program_exercise_id']!,
|
|
_snapshotProgramExerciseIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_snapshotProgramExerciseIdMeta);
|
|
}
|
|
if (data.containsKey('sets_count_override')) {
|
|
context.handle(
|
|
_setsCountOverrideMeta,
|
|
setsCountOverride.isAcceptableOrUnknown(
|
|
data['sets_count_override']!,
|
|
_setsCountOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_time_seconds_override')) {
|
|
context.handle(
|
|
_targetTimeSecondsOverrideMeta,
|
|
targetTimeSecondsOverride.isAcceptableOrUnknown(
|
|
data['target_time_seconds_override']!,
|
|
_targetTimeSecondsOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_reps_override')) {
|
|
context.handle(
|
|
_targetRepsOverrideMeta,
|
|
targetRepsOverride.isAcceptableOrUnknown(
|
|
data['target_reps_override']!,
|
|
_targetRepsOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score_override')) {
|
|
context.handle(
|
|
_targetScoreOverrideMeta,
|
|
targetScoreOverride.isAcceptableOrUnknown(
|
|
data['target_score_override']!,
|
|
_targetScoreOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('target_score_time_ms_override')) {
|
|
context.handle(
|
|
_targetScoreTimeMsOverrideMeta,
|
|
targetScoreTimeMsOverride.isAcceptableOrUnknown(
|
|
data['target_score_time_ms_override']!,
|
|
_targetScoreTimeMsOverrideMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WorkoutTemplateExerciseOverride map(
|
|
Map<String, dynamic> data, {
|
|
String? tablePrefix,
|
|
}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WorkoutTemplateExerciseOverride(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
deletedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}deleted_at'],
|
|
),
|
|
schemaVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_version'],
|
|
)!,
|
|
syncState: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sync_state'],
|
|
)!,
|
|
localRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}local_revision'],
|
|
)!,
|
|
originDeviceId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_device_id'],
|
|
)!,
|
|
futureOwnerProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}future_owner_profile_id'],
|
|
),
|
|
lastSyncedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}last_synced_at'],
|
|
),
|
|
remoteRevision: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_revision'],
|
|
),
|
|
workoutTemplateProgramId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}workout_template_program_id'],
|
|
)!,
|
|
snapshotProgramExerciseId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}snapshot_program_exercise_id'],
|
|
)!,
|
|
setsCountOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sets_count_override'],
|
|
),
|
|
targetTimeSecondsOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_time_seconds_override'],
|
|
),
|
|
targetRepsOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_reps_override'],
|
|
),
|
|
targetScoreOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}target_score_override'],
|
|
),
|
|
targetScoreTimeMsOverride: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}target_score_time_ms_override'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WorkoutTemplateExerciseOverridesTable createAlias(String alias) {
|
|
return $WorkoutTemplateExerciseOverridesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WorkoutTemplateExerciseOverride extends DataClass
|
|
implements Insertable<WorkoutTemplateExerciseOverride> {
|
|
final String id;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final DateTime? deletedAt;
|
|
final int schemaVersion;
|
|
final String syncState;
|
|
final int localRevision;
|
|
final String originDeviceId;
|
|
final String? futureOwnerProfileId;
|
|
final DateTime? lastSyncedAt;
|
|
final String? remoteRevision;
|
|
final String workoutTemplateProgramId;
|
|
final String snapshotProgramExerciseId;
|
|
final int? setsCountOverride;
|
|
final int? targetTimeSecondsOverride;
|
|
final int? targetRepsOverride;
|
|
final double? targetScoreOverride;
|
|
final int? targetScoreTimeMsOverride;
|
|
const WorkoutTemplateExerciseOverride({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.deletedAt,
|
|
required this.schemaVersion,
|
|
required this.syncState,
|
|
required this.localRevision,
|
|
required this.originDeviceId,
|
|
this.futureOwnerProfileId,
|
|
this.lastSyncedAt,
|
|
this.remoteRevision,
|
|
required this.workoutTemplateProgramId,
|
|
required this.snapshotProgramExerciseId,
|
|
this.setsCountOverride,
|
|
this.targetTimeSecondsOverride,
|
|
this.targetRepsOverride,
|
|
this.targetScoreOverride,
|
|
this.targetScoreTimeMsOverride,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
if (!nullToAbsent || deletedAt != null) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt);
|
|
}
|
|
map['schema_version'] = Variable<int>(schemaVersion);
|
|
map['sync_state'] = Variable<String>(syncState);
|
|
map['local_revision'] = Variable<int>(localRevision);
|
|
map['origin_device_id'] = Variable<String>(originDeviceId);
|
|
if (!nullToAbsent || futureOwnerProfileId != null) {
|
|
map['future_owner_profile_id'] = Variable<String>(futureOwnerProfileId);
|
|
}
|
|
if (!nullToAbsent || lastSyncedAt != null) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt);
|
|
}
|
|
if (!nullToAbsent || remoteRevision != null) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision);
|
|
}
|
|
map['workout_template_program_id'] = Variable<String>(
|
|
workoutTemplateProgramId,
|
|
);
|
|
map['snapshot_program_exercise_id'] = Variable<String>(
|
|
snapshotProgramExerciseId,
|
|
);
|
|
if (!nullToAbsent || setsCountOverride != null) {
|
|
map['sets_count_override'] = Variable<int>(setsCountOverride);
|
|
}
|
|
if (!nullToAbsent || targetTimeSecondsOverride != null) {
|
|
map['target_time_seconds_override'] = Variable<int>(
|
|
targetTimeSecondsOverride,
|
|
);
|
|
}
|
|
if (!nullToAbsent || targetRepsOverride != null) {
|
|
map['target_reps_override'] = Variable<int>(targetRepsOverride);
|
|
}
|
|
if (!nullToAbsent || targetScoreOverride != null) {
|
|
map['target_score_override'] = Variable<double>(targetScoreOverride);
|
|
}
|
|
if (!nullToAbsent || targetScoreTimeMsOverride != null) {
|
|
map['target_score_time_ms_override'] = Variable<int>(
|
|
targetScoreTimeMsOverride,
|
|
);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
WorkoutTemplateExerciseOverridesCompanion toCompanion(bool nullToAbsent) {
|
|
return WorkoutTemplateExerciseOverridesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
deletedAt: deletedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(deletedAt),
|
|
schemaVersion: Value(schemaVersion),
|
|
syncState: Value(syncState),
|
|
localRevision: Value(localRevision),
|
|
originDeviceId: Value(originDeviceId),
|
|
futureOwnerProfileId: futureOwnerProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(futureOwnerProfileId),
|
|
lastSyncedAt: lastSyncedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lastSyncedAt),
|
|
remoteRevision: remoteRevision == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteRevision),
|
|
workoutTemplateProgramId: Value(workoutTemplateProgramId),
|
|
snapshotProgramExerciseId: Value(snapshotProgramExerciseId),
|
|
setsCountOverride: setsCountOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(setsCountOverride),
|
|
targetTimeSecondsOverride:
|
|
targetTimeSecondsOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetTimeSecondsOverride),
|
|
targetRepsOverride: targetRepsOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetRepsOverride),
|
|
targetScoreOverride: targetScoreOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScoreOverride),
|
|
targetScoreTimeMsOverride:
|
|
targetScoreTimeMsOverride == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetScoreTimeMsOverride),
|
|
);
|
|
}
|
|
|
|
factory WorkoutTemplateExerciseOverride.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WorkoutTemplateExerciseOverride(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
|
schemaVersion: serializer.fromJson<int>(json['schemaVersion']),
|
|
syncState: serializer.fromJson<String>(json['syncState']),
|
|
localRevision: serializer.fromJson<int>(json['localRevision']),
|
|
originDeviceId: serializer.fromJson<String>(json['originDeviceId']),
|
|
futureOwnerProfileId: serializer.fromJson<String?>(
|
|
json['futureOwnerProfileId'],
|
|
),
|
|
lastSyncedAt: serializer.fromJson<DateTime?>(json['lastSyncedAt']),
|
|
remoteRevision: serializer.fromJson<String?>(json['remoteRevision']),
|
|
workoutTemplateProgramId: serializer.fromJson<String>(
|
|
json['workoutTemplateProgramId'],
|
|
),
|
|
snapshotProgramExerciseId: serializer.fromJson<String>(
|
|
json['snapshotProgramExerciseId'],
|
|
),
|
|
setsCountOverride: serializer.fromJson<int?>(json['setsCountOverride']),
|
|
targetTimeSecondsOverride: serializer.fromJson<int?>(
|
|
json['targetTimeSecondsOverride'],
|
|
),
|
|
targetRepsOverride: serializer.fromJson<int?>(json['targetRepsOverride']),
|
|
targetScoreOverride: serializer.fromJson<double?>(
|
|
json['targetScoreOverride'],
|
|
),
|
|
targetScoreTimeMsOverride: serializer.fromJson<int?>(
|
|
json['targetScoreTimeMsOverride'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
|
'schemaVersion': serializer.toJson<int>(schemaVersion),
|
|
'syncState': serializer.toJson<String>(syncState),
|
|
'localRevision': serializer.toJson<int>(localRevision),
|
|
'originDeviceId': serializer.toJson<String>(originDeviceId),
|
|
'futureOwnerProfileId': serializer.toJson<String?>(futureOwnerProfileId),
|
|
'lastSyncedAt': serializer.toJson<DateTime?>(lastSyncedAt),
|
|
'remoteRevision': serializer.toJson<String?>(remoteRevision),
|
|
'workoutTemplateProgramId': serializer.toJson<String>(
|
|
workoutTemplateProgramId,
|
|
),
|
|
'snapshotProgramExerciseId': serializer.toJson<String>(
|
|
snapshotProgramExerciseId,
|
|
),
|
|
'setsCountOverride': serializer.toJson<int?>(setsCountOverride),
|
|
'targetTimeSecondsOverride': serializer.toJson<int?>(
|
|
targetTimeSecondsOverride,
|
|
),
|
|
'targetRepsOverride': serializer.toJson<int?>(targetRepsOverride),
|
|
'targetScoreOverride': serializer.toJson<double?>(targetScoreOverride),
|
|
'targetScoreTimeMsOverride': serializer.toJson<int?>(
|
|
targetScoreTimeMsOverride,
|
|
),
|
|
};
|
|
}
|
|
|
|
WorkoutTemplateExerciseOverride copyWith({
|
|
String? id,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
int? schemaVersion,
|
|
String? syncState,
|
|
int? localRevision,
|
|
String? originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
String? workoutTemplateProgramId,
|
|
String? snapshotProgramExerciseId,
|
|
Value<int?> setsCountOverride = const Value.absent(),
|
|
Value<int?> targetTimeSecondsOverride = const Value.absent(),
|
|
Value<int?> targetRepsOverride = const Value.absent(),
|
|
Value<double?> targetScoreOverride = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsOverride = const Value.absent(),
|
|
}) => WorkoutTemplateExerciseOverride(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId.present
|
|
? futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt.present ? lastSyncedAt.value : this.lastSyncedAt,
|
|
remoteRevision: remoteRevision.present
|
|
? remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutTemplateProgramId:
|
|
workoutTemplateProgramId ?? this.workoutTemplateProgramId,
|
|
snapshotProgramExerciseId:
|
|
snapshotProgramExerciseId ?? this.snapshotProgramExerciseId,
|
|
setsCountOverride: setsCountOverride.present
|
|
? setsCountOverride.value
|
|
: this.setsCountOverride,
|
|
targetTimeSecondsOverride: targetTimeSecondsOverride.present
|
|
? targetTimeSecondsOverride.value
|
|
: this.targetTimeSecondsOverride,
|
|
targetRepsOverride: targetRepsOverride.present
|
|
? targetRepsOverride.value
|
|
: this.targetRepsOverride,
|
|
targetScoreOverride: targetScoreOverride.present
|
|
? targetScoreOverride.value
|
|
: this.targetScoreOverride,
|
|
targetScoreTimeMsOverride: targetScoreTimeMsOverride.present
|
|
? targetScoreTimeMsOverride.value
|
|
: this.targetScoreTimeMsOverride,
|
|
);
|
|
WorkoutTemplateExerciseOverride copyWithCompanion(
|
|
WorkoutTemplateExerciseOverridesCompanion data,
|
|
) {
|
|
return WorkoutTemplateExerciseOverride(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
|
schemaVersion: data.schemaVersion.present
|
|
? data.schemaVersion.value
|
|
: this.schemaVersion,
|
|
syncState: data.syncState.present ? data.syncState.value : this.syncState,
|
|
localRevision: data.localRevision.present
|
|
? data.localRevision.value
|
|
: this.localRevision,
|
|
originDeviceId: data.originDeviceId.present
|
|
? data.originDeviceId.value
|
|
: this.originDeviceId,
|
|
futureOwnerProfileId: data.futureOwnerProfileId.present
|
|
? data.futureOwnerProfileId.value
|
|
: this.futureOwnerProfileId,
|
|
lastSyncedAt: data.lastSyncedAt.present
|
|
? data.lastSyncedAt.value
|
|
: this.lastSyncedAt,
|
|
remoteRevision: data.remoteRevision.present
|
|
? data.remoteRevision.value
|
|
: this.remoteRevision,
|
|
workoutTemplateProgramId: data.workoutTemplateProgramId.present
|
|
? data.workoutTemplateProgramId.value
|
|
: this.workoutTemplateProgramId,
|
|
snapshotProgramExerciseId: data.snapshotProgramExerciseId.present
|
|
? data.snapshotProgramExerciseId.value
|
|
: this.snapshotProgramExerciseId,
|
|
setsCountOverride: data.setsCountOverride.present
|
|
? data.setsCountOverride.value
|
|
: this.setsCountOverride,
|
|
targetTimeSecondsOverride: data.targetTimeSecondsOverride.present
|
|
? data.targetTimeSecondsOverride.value
|
|
: this.targetTimeSecondsOverride,
|
|
targetRepsOverride: data.targetRepsOverride.present
|
|
? data.targetRepsOverride.value
|
|
: this.targetRepsOverride,
|
|
targetScoreOverride: data.targetScoreOverride.present
|
|
? data.targetScoreOverride.value
|
|
: this.targetScoreOverride,
|
|
targetScoreTimeMsOverride: data.targetScoreTimeMsOverride.present
|
|
? data.targetScoreTimeMsOverride.value
|
|
: this.targetScoreTimeMsOverride,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplateExerciseOverride(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutTemplateProgramId: $workoutTemplateProgramId, ')
|
|
..write('snapshotProgramExerciseId: $snapshotProgramExerciseId, ')
|
|
..write('setsCountOverride: $setsCountOverride, ')
|
|
..write('targetTimeSecondsOverride: $targetTimeSecondsOverride, ')
|
|
..write('targetRepsOverride: $targetRepsOverride, ')
|
|
..write('targetScoreOverride: $targetScoreOverride, ')
|
|
..write('targetScoreTimeMsOverride: $targetScoreTimeMsOverride')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
deletedAt,
|
|
schemaVersion,
|
|
syncState,
|
|
localRevision,
|
|
originDeviceId,
|
|
futureOwnerProfileId,
|
|
lastSyncedAt,
|
|
remoteRevision,
|
|
workoutTemplateProgramId,
|
|
snapshotProgramExerciseId,
|
|
setsCountOverride,
|
|
targetTimeSecondsOverride,
|
|
targetRepsOverride,
|
|
targetScoreOverride,
|
|
targetScoreTimeMsOverride,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WorkoutTemplateExerciseOverride &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.deletedAt == this.deletedAt &&
|
|
other.schemaVersion == this.schemaVersion &&
|
|
other.syncState == this.syncState &&
|
|
other.localRevision == this.localRevision &&
|
|
other.originDeviceId == this.originDeviceId &&
|
|
other.futureOwnerProfileId == this.futureOwnerProfileId &&
|
|
other.lastSyncedAt == this.lastSyncedAt &&
|
|
other.remoteRevision == this.remoteRevision &&
|
|
other.workoutTemplateProgramId == this.workoutTemplateProgramId &&
|
|
other.snapshotProgramExerciseId == this.snapshotProgramExerciseId &&
|
|
other.setsCountOverride == this.setsCountOverride &&
|
|
other.targetTimeSecondsOverride == this.targetTimeSecondsOverride &&
|
|
other.targetRepsOverride == this.targetRepsOverride &&
|
|
other.targetScoreOverride == this.targetScoreOverride &&
|
|
other.targetScoreTimeMsOverride == this.targetScoreTimeMsOverride);
|
|
}
|
|
|
|
class WorkoutTemplateExerciseOverridesCompanion
|
|
extends UpdateCompanion<WorkoutTemplateExerciseOverride> {
|
|
final Value<String> id;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<DateTime?> deletedAt;
|
|
final Value<int> schemaVersion;
|
|
final Value<String> syncState;
|
|
final Value<int> localRevision;
|
|
final Value<String> originDeviceId;
|
|
final Value<String?> futureOwnerProfileId;
|
|
final Value<DateTime?> lastSyncedAt;
|
|
final Value<String?> remoteRevision;
|
|
final Value<String> workoutTemplateProgramId;
|
|
final Value<String> snapshotProgramExerciseId;
|
|
final Value<int?> setsCountOverride;
|
|
final Value<int?> targetTimeSecondsOverride;
|
|
final Value<int?> targetRepsOverride;
|
|
final Value<double?> targetScoreOverride;
|
|
final Value<int?> targetScoreTimeMsOverride;
|
|
final Value<int> rowid;
|
|
const WorkoutTemplateExerciseOverridesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
this.syncState = const Value.absent(),
|
|
this.localRevision = const Value.absent(),
|
|
this.originDeviceId = const Value.absent(),
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
this.workoutTemplateProgramId = const Value.absent(),
|
|
this.snapshotProgramExerciseId = const Value.absent(),
|
|
this.setsCountOverride = const Value.absent(),
|
|
this.targetTimeSecondsOverride = const Value.absent(),
|
|
this.targetRepsOverride = const Value.absent(),
|
|
this.targetScoreOverride = const Value.absent(),
|
|
this.targetScoreTimeMsOverride = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
WorkoutTemplateExerciseOverridesCompanion.insert({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
this.deletedAt = const Value.absent(),
|
|
this.schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
this.futureOwnerProfileId = const Value.absent(),
|
|
this.lastSyncedAt = const Value.absent(),
|
|
this.remoteRevision = const Value.absent(),
|
|
required String workoutTemplateProgramId,
|
|
required String snapshotProgramExerciseId,
|
|
this.setsCountOverride = const Value.absent(),
|
|
this.targetTimeSecondsOverride = const Value.absent(),
|
|
this.targetRepsOverride = const Value.absent(),
|
|
this.targetScoreOverride = const Value.absent(),
|
|
this.targetScoreTimeMsOverride = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
syncState = Value(syncState),
|
|
localRevision = Value(localRevision),
|
|
originDeviceId = Value(originDeviceId),
|
|
workoutTemplateProgramId = Value(workoutTemplateProgramId),
|
|
snapshotProgramExerciseId = Value(snapshotProgramExerciseId);
|
|
static Insertable<WorkoutTemplateExerciseOverride> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<DateTime>? deletedAt,
|
|
Expression<int>? schemaVersion,
|
|
Expression<String>? syncState,
|
|
Expression<int>? localRevision,
|
|
Expression<String>? originDeviceId,
|
|
Expression<String>? futureOwnerProfileId,
|
|
Expression<DateTime>? lastSyncedAt,
|
|
Expression<String>? remoteRevision,
|
|
Expression<String>? workoutTemplateProgramId,
|
|
Expression<String>? snapshotProgramExerciseId,
|
|
Expression<int>? setsCountOverride,
|
|
Expression<int>? targetTimeSecondsOverride,
|
|
Expression<int>? targetRepsOverride,
|
|
Expression<double>? targetScoreOverride,
|
|
Expression<int>? targetScoreTimeMsOverride,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
|
if (schemaVersion != null) 'schema_version': schemaVersion,
|
|
if (syncState != null) 'sync_state': syncState,
|
|
if (localRevision != null) 'local_revision': localRevision,
|
|
if (originDeviceId != null) 'origin_device_id': originDeviceId,
|
|
if (futureOwnerProfileId != null)
|
|
'future_owner_profile_id': futureOwnerProfileId,
|
|
if (lastSyncedAt != null) 'last_synced_at': lastSyncedAt,
|
|
if (remoteRevision != null) 'remote_revision': remoteRevision,
|
|
if (workoutTemplateProgramId != null)
|
|
'workout_template_program_id': workoutTemplateProgramId,
|
|
if (snapshotProgramExerciseId != null)
|
|
'snapshot_program_exercise_id': snapshotProgramExerciseId,
|
|
if (setsCountOverride != null) 'sets_count_override': setsCountOverride,
|
|
if (targetTimeSecondsOverride != null)
|
|
'target_time_seconds_override': targetTimeSecondsOverride,
|
|
if (targetRepsOverride != null)
|
|
'target_reps_override': targetRepsOverride,
|
|
if (targetScoreOverride != null)
|
|
'target_score_override': targetScoreOverride,
|
|
if (targetScoreTimeMsOverride != null)
|
|
'target_score_time_ms_override': targetScoreTimeMsOverride,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
WorkoutTemplateExerciseOverridesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<DateTime?>? deletedAt,
|
|
Value<int>? schemaVersion,
|
|
Value<String>? syncState,
|
|
Value<int>? localRevision,
|
|
Value<String>? originDeviceId,
|
|
Value<String?>? futureOwnerProfileId,
|
|
Value<DateTime?>? lastSyncedAt,
|
|
Value<String?>? remoteRevision,
|
|
Value<String>? workoutTemplateProgramId,
|
|
Value<String>? snapshotProgramExerciseId,
|
|
Value<int?>? setsCountOverride,
|
|
Value<int?>? targetTimeSecondsOverride,
|
|
Value<int?>? targetRepsOverride,
|
|
Value<double?>? targetScoreOverride,
|
|
Value<int?>? targetScoreTimeMsOverride,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return WorkoutTemplateExerciseOverridesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
deletedAt: deletedAt ?? this.deletedAt,
|
|
schemaVersion: schemaVersion ?? this.schemaVersion,
|
|
syncState: syncState ?? this.syncState,
|
|
localRevision: localRevision ?? this.localRevision,
|
|
originDeviceId: originDeviceId ?? this.originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId ?? this.futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt ?? this.lastSyncedAt,
|
|
remoteRevision: remoteRevision ?? this.remoteRevision,
|
|
workoutTemplateProgramId:
|
|
workoutTemplateProgramId ?? this.workoutTemplateProgramId,
|
|
snapshotProgramExerciseId:
|
|
snapshotProgramExerciseId ?? this.snapshotProgramExerciseId,
|
|
setsCountOverride: setsCountOverride ?? this.setsCountOverride,
|
|
targetTimeSecondsOverride:
|
|
targetTimeSecondsOverride ?? this.targetTimeSecondsOverride,
|
|
targetRepsOverride: targetRepsOverride ?? this.targetRepsOverride,
|
|
targetScoreOverride: targetScoreOverride ?? this.targetScoreOverride,
|
|
targetScoreTimeMsOverride:
|
|
targetScoreTimeMsOverride ?? this.targetScoreTimeMsOverride,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (deletedAt.present) {
|
|
map['deleted_at'] = Variable<DateTime>(deletedAt.value);
|
|
}
|
|
if (schemaVersion.present) {
|
|
map['schema_version'] = Variable<int>(schemaVersion.value);
|
|
}
|
|
if (syncState.present) {
|
|
map['sync_state'] = Variable<String>(syncState.value);
|
|
}
|
|
if (localRevision.present) {
|
|
map['local_revision'] = Variable<int>(localRevision.value);
|
|
}
|
|
if (originDeviceId.present) {
|
|
map['origin_device_id'] = Variable<String>(originDeviceId.value);
|
|
}
|
|
if (futureOwnerProfileId.present) {
|
|
map['future_owner_profile_id'] = Variable<String>(
|
|
futureOwnerProfileId.value,
|
|
);
|
|
}
|
|
if (lastSyncedAt.present) {
|
|
map['last_synced_at'] = Variable<DateTime>(lastSyncedAt.value);
|
|
}
|
|
if (remoteRevision.present) {
|
|
map['remote_revision'] = Variable<String>(remoteRevision.value);
|
|
}
|
|
if (workoutTemplateProgramId.present) {
|
|
map['workout_template_program_id'] = Variable<String>(
|
|
workoutTemplateProgramId.value,
|
|
);
|
|
}
|
|
if (snapshotProgramExerciseId.present) {
|
|
map['snapshot_program_exercise_id'] = Variable<String>(
|
|
snapshotProgramExerciseId.value,
|
|
);
|
|
}
|
|
if (setsCountOverride.present) {
|
|
map['sets_count_override'] = Variable<int>(setsCountOverride.value);
|
|
}
|
|
if (targetTimeSecondsOverride.present) {
|
|
map['target_time_seconds_override'] = Variable<int>(
|
|
targetTimeSecondsOverride.value,
|
|
);
|
|
}
|
|
if (targetRepsOverride.present) {
|
|
map['target_reps_override'] = Variable<int>(targetRepsOverride.value);
|
|
}
|
|
if (targetScoreOverride.present) {
|
|
map['target_score_override'] = Variable<double>(
|
|
targetScoreOverride.value,
|
|
);
|
|
}
|
|
if (targetScoreTimeMsOverride.present) {
|
|
map['target_score_time_ms_override'] = Variable<int>(
|
|
targetScoreTimeMsOverride.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WorkoutTemplateExerciseOverridesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('deletedAt: $deletedAt, ')
|
|
..write('schemaVersion: $schemaVersion, ')
|
|
..write('syncState: $syncState, ')
|
|
..write('localRevision: $localRevision, ')
|
|
..write('originDeviceId: $originDeviceId, ')
|
|
..write('futureOwnerProfileId: $futureOwnerProfileId, ')
|
|
..write('lastSyncedAt: $lastSyncedAt, ')
|
|
..write('remoteRevision: $remoteRevision, ')
|
|
..write('workoutTemplateProgramId: $workoutTemplateProgramId, ')
|
|
..write('snapshotProgramExerciseId: $snapshotProgramExerciseId, ')
|
|
..write('setsCountOverride: $setsCountOverride, ')
|
|
..write('targetTimeSecondsOverride: $targetTimeSecondsOverride, ')
|
|
..write('targetRepsOverride: $targetRepsOverride, ')
|
|
..write('targetScoreOverride: $targetScoreOverride, ')
|
|
..write('targetScoreTimeMsOverride: $targetScoreTimeMsOverride, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $WorkoutTemplatesTable workoutTemplates = $WorkoutTemplatesTable(
|
|
this,
|
|
);
|
|
late final $ActiveWorkoutSessionsTable activeWorkoutSessions =
|
|
$ActiveWorkoutSessionsTable(this);
|
|
late final $ActiveRestStatesTable activeRestStates = $ActiveRestStatesTable(
|
|
this,
|
|
);
|
|
late final $ActiveScoreStopwatchStatesTable activeScoreStopwatchStates =
|
|
$ActiveScoreStopwatchStatesTable(this);
|
|
late final $ActiveSetResultsTable activeSetResults = $ActiveSetResultsTable(
|
|
this,
|
|
);
|
|
late final $ChangeLogEntriesTable changeLogEntries = $ChangeLogEntriesTable(
|
|
this,
|
|
);
|
|
late final $MediaAssetsTable mediaAssets = $MediaAssetsTable(this);
|
|
late final $ExercisesTable exercises = $ExercisesTable(this);
|
|
late final $ProgramsTable programs = $ProgramsTable(this);
|
|
late final $ProgramExercisesTable programExercises = $ProgramExercisesTable(
|
|
this,
|
|
);
|
|
late final $WorkoutHistoriesTable workoutHistories = $WorkoutHistoriesTable(
|
|
this,
|
|
);
|
|
late final $WorkoutHistorySetResultsTable workoutHistorySetResults =
|
|
$WorkoutHistorySetResultsTable(this);
|
|
late final $WorkoutTemplateProgramsTable workoutTemplatePrograms =
|
|
$WorkoutTemplateProgramsTable(this);
|
|
late final $WorkoutTemplateExerciseOverridesTable
|
|
workoutTemplateExerciseOverrides = $WorkoutTemplateExerciseOverridesTable(
|
|
this,
|
|
);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
workoutTemplates,
|
|
activeWorkoutSessions,
|
|
activeRestStates,
|
|
activeScoreStopwatchStates,
|
|
activeSetResults,
|
|
changeLogEntries,
|
|
mediaAssets,
|
|
exercises,
|
|
programs,
|
|
programExercises,
|
|
workoutHistories,
|
|
workoutHistorySetResults,
|
|
workoutTemplatePrograms,
|
|
workoutTemplateExerciseOverrides,
|
|
];
|
|
}
|
|
|
|
typedef $$WorkoutTemplatesTableCreateCompanionBuilder =
|
|
WorkoutTemplatesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String name,
|
|
Value<DateTime?> lastStartedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$WorkoutTemplatesTableUpdateCompanionBuilder =
|
|
WorkoutTemplatesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> name,
|
|
Value<DateTime?> lastStartedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$WorkoutTemplatesTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $WorkoutTemplatesTable, WorkoutTemplate> {
|
|
$$WorkoutTemplatesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static MultiTypedResultKey<
|
|
$ActiveWorkoutSessionsTable,
|
|
List<ActiveWorkoutSession>
|
|
>
|
|
_activeWorkoutSessionsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.activeWorkoutSessions,
|
|
aliasName:
|
|
'workout_templates__id__active_workout_sessions__source_workout_template_id',
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableProcessedTableManager
|
|
get activeWorkoutSessionsRefs {
|
|
final manager =
|
|
$$ActiveWorkoutSessionsTableTableManager(
|
|
$_db,
|
|
$_db.activeWorkoutSessions,
|
|
).filter(
|
|
(f) => f.sourceWorkoutTemplateId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_activeWorkoutSessionsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$WorkoutHistoriesTable, List<WorkoutHistory>>
|
|
_workoutHistoriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.workoutHistories,
|
|
aliasName:
|
|
'workout_templates__id__workout_history__source_workout_template_id',
|
|
);
|
|
|
|
$$WorkoutHistoriesTableProcessedTableManager get workoutHistoriesRefs {
|
|
final manager =
|
|
$$WorkoutHistoriesTableTableManager($_db, $_db.workoutHistories).filter(
|
|
(f) => f.sourceWorkoutTemplateId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutHistoriesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<
|
|
$WorkoutTemplateProgramsTable,
|
|
List<WorkoutTemplateProgram>
|
|
>
|
|
_workoutTemplateProgramsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.workoutTemplatePrograms,
|
|
aliasName:
|
|
'workout_templates__id__workout_template_programs__workout_template_id',
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableProcessedTableManager
|
|
get workoutTemplateProgramsRefs {
|
|
final manager =
|
|
$$WorkoutTemplateProgramsTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplatePrograms,
|
|
).filter(
|
|
(f) => f.workoutTemplateId.id.sqlEquals($_itemColumn<String>('id')!),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutTemplateProgramsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplatesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplatesTable> {
|
|
$$WorkoutTemplatesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastStartedAt => $composableBuilder(
|
|
column: $table.lastStartedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> activeWorkoutSessionsRefs(
|
|
Expression<bool> Function($$ActiveWorkoutSessionsTableFilterComposer f) f,
|
|
) {
|
|
final $$ActiveWorkoutSessionsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.sourceWorkoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> workoutHistoriesRefs(
|
|
Expression<bool> Function($$WorkoutHistoriesTableFilterComposer f) f,
|
|
) {
|
|
final $$WorkoutHistoriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.sourceWorkoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> workoutTemplateProgramsRefs(
|
|
Expression<bool> Function($$WorkoutTemplateProgramsTableFilterComposer f) f,
|
|
) {
|
|
final $$WorkoutTemplateProgramsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.workoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplatesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplatesTable> {
|
|
$$WorkoutTemplatesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastStartedAt => $composableBuilder(
|
|
column: $table.lastStartedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$WorkoutTemplatesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplatesTable> {
|
|
$$WorkoutTemplatesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get lastStartedAt => $composableBuilder(
|
|
column: $table.lastStartedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
Expression<T> activeWorkoutSessionsRefs<T extends Object>(
|
|
Expression<T> Function($$ActiveWorkoutSessionsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ActiveWorkoutSessionsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.sourceWorkoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> workoutHistoriesRefs<T extends Object>(
|
|
Expression<T> Function($$WorkoutHistoriesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$WorkoutHistoriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.sourceWorkoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> workoutTemplateProgramsRefs<T extends Object>(
|
|
Expression<T> Function($$WorkoutTemplateProgramsTableAnnotationComposer a)
|
|
f,
|
|
) {
|
|
final $$WorkoutTemplateProgramsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.workoutTemplateId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplatesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplatesTable,
|
|
WorkoutTemplate,
|
|
$$WorkoutTemplatesTableFilterComposer,
|
|
$$WorkoutTemplatesTableOrderingComposer,
|
|
$$WorkoutTemplatesTableAnnotationComposer,
|
|
$$WorkoutTemplatesTableCreateCompanionBuilder,
|
|
$$WorkoutTemplatesTableUpdateCompanionBuilder,
|
|
(WorkoutTemplate, $$WorkoutTemplatesTableReferences),
|
|
WorkoutTemplate,
|
|
PrefetchHooks Function({
|
|
bool activeWorkoutSessionsRefs,
|
|
bool workoutHistoriesRefs,
|
|
bool workoutTemplateProgramsRefs,
|
|
})
|
|
> {
|
|
$$WorkoutTemplatesTableTableManager(
|
|
_$AppDatabase db,
|
|
$WorkoutTemplatesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$WorkoutTemplatesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$WorkoutTemplatesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$WorkoutTemplatesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<DateTime?> lastStartedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplatesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
lastStartedAt: lastStartedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String name,
|
|
Value<DateTime?> lastStartedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplatesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
lastStartedAt: lastStartedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$WorkoutTemplatesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
activeWorkoutSessionsRefs = false,
|
|
workoutHistoriesRefs = false,
|
|
workoutTemplateProgramsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (activeWorkoutSessionsRefs) db.activeWorkoutSessions,
|
|
if (workoutHistoriesRefs) db.workoutHistories,
|
|
if (workoutTemplateProgramsRefs) db.workoutTemplatePrograms,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (activeWorkoutSessionsRefs)
|
|
await $_getPrefetchedData<
|
|
WorkoutTemplate,
|
|
$WorkoutTemplatesTable,
|
|
ActiveWorkoutSession
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$WorkoutTemplatesTableReferences
|
|
._activeWorkoutSessionsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$WorkoutTemplatesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).activeWorkoutSessionsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.sourceWorkoutTemplateId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (workoutHistoriesRefs)
|
|
await $_getPrefetchedData<
|
|
WorkoutTemplate,
|
|
$WorkoutTemplatesTable,
|
|
WorkoutHistory
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$WorkoutTemplatesTableReferences
|
|
._workoutHistoriesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$WorkoutTemplatesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutHistoriesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.sourceWorkoutTemplateId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (workoutTemplateProgramsRefs)
|
|
await $_getPrefetchedData<
|
|
WorkoutTemplate,
|
|
$WorkoutTemplatesTable,
|
|
WorkoutTemplateProgram
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$WorkoutTemplatesTableReferences
|
|
._workoutTemplateProgramsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$WorkoutTemplatesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutTemplateProgramsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.workoutTemplateId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$WorkoutTemplatesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplatesTable,
|
|
WorkoutTemplate,
|
|
$$WorkoutTemplatesTableFilterComposer,
|
|
$$WorkoutTemplatesTableOrderingComposer,
|
|
$$WorkoutTemplatesTableAnnotationComposer,
|
|
$$WorkoutTemplatesTableCreateCompanionBuilder,
|
|
$$WorkoutTemplatesTableUpdateCompanionBuilder,
|
|
(WorkoutTemplate, $$WorkoutTemplatesTableReferences),
|
|
WorkoutTemplate,
|
|
PrefetchHooks Function({
|
|
bool activeWorkoutSessionsRefs,
|
|
bool workoutHistoriesRefs,
|
|
bool workoutTemplateProgramsRefs,
|
|
})
|
|
>;
|
|
typedef $$ActiveWorkoutSessionsTableCreateCompanionBuilder =
|
|
ActiveWorkoutSessionsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String?> sourceWorkoutTemplateId,
|
|
required String status,
|
|
required DateTime startedAt,
|
|
Value<DateTime?> pausedAt,
|
|
Value<DateTime?> endedAt,
|
|
required DateTime lastPersistedAt,
|
|
required int elapsedActiveMs,
|
|
required int currentProgramIndex,
|
|
required int currentExerciseIndex,
|
|
required int currentSetIndex,
|
|
required String resolvedTemplateSnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ActiveWorkoutSessionsTableUpdateCompanionBuilder =
|
|
ActiveWorkoutSessionsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String?> sourceWorkoutTemplateId,
|
|
Value<String> status,
|
|
Value<DateTime> startedAt,
|
|
Value<DateTime?> pausedAt,
|
|
Value<DateTime?> endedAt,
|
|
Value<DateTime> lastPersistedAt,
|
|
Value<int> elapsedActiveMs,
|
|
Value<int> currentProgramIndex,
|
|
Value<int> currentExerciseIndex,
|
|
Value<int> currentSetIndex,
|
|
Value<String> resolvedTemplateSnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ActiveWorkoutSessionsTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveWorkoutSession
|
|
> {
|
|
$$ActiveWorkoutSessionsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $WorkoutTemplatesTable _sourceWorkoutTemplateIdTable(
|
|
_$AppDatabase db,
|
|
) => db.workoutTemplates.createAlias(
|
|
'active_workout_sessions__source_workout_template_id__workout_templates__id',
|
|
);
|
|
|
|
$$WorkoutTemplatesTableProcessedTableManager? get sourceWorkoutTemplateId {
|
|
final $_column = $_itemColumn<String>('source_workout_template_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$WorkoutTemplatesTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplates,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_sourceWorkoutTemplateIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ActiveRestStatesTable, List<ActiveRestState>>
|
|
_activeRestStatesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.activeRestStates,
|
|
aliasName:
|
|
'active_workout_sessions__id__active_rest_states__active_workout_session_id',
|
|
);
|
|
|
|
$$ActiveRestStatesTableProcessedTableManager get activeRestStatesRefs {
|
|
final manager =
|
|
$$ActiveRestStatesTableTableManager($_db, $_db.activeRestStates).filter(
|
|
(f) => f.activeWorkoutSessionId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_activeRestStatesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<
|
|
$ActiveScoreStopwatchStatesTable,
|
|
List<ActiveScoreStopwatchState>
|
|
>
|
|
_activeScoreStopwatchStatesRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.activeScoreStopwatchStates,
|
|
aliasName:
|
|
'active_workout_sessions__id__active_score_stopwatch_states__active_workout_session_id',
|
|
);
|
|
|
|
$$ActiveScoreStopwatchStatesTableProcessedTableManager
|
|
get activeScoreStopwatchStatesRefs {
|
|
final manager =
|
|
$$ActiveScoreStopwatchStatesTableTableManager(
|
|
$_db,
|
|
$_db.activeScoreStopwatchStates,
|
|
).filter(
|
|
(f) => f.activeWorkoutSessionId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_activeScoreStopwatchStatesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ActiveSetResultsTable, List<ActiveSetResult>>
|
|
_activeSetResultsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.activeSetResults,
|
|
aliasName:
|
|
'active_workout_sessions__id__active_set_results__active_workout_session_id',
|
|
);
|
|
|
|
$$ActiveSetResultsTableProcessedTableManager get activeSetResultsRefs {
|
|
final manager =
|
|
$$ActiveSetResultsTableTableManager($_db, $_db.activeSetResults).filter(
|
|
(f) => f.activeWorkoutSessionId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_activeSetResultsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$WorkoutHistoriesTable, List<WorkoutHistory>>
|
|
_workoutHistoriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.workoutHistories,
|
|
aliasName:
|
|
'active_workout_sessions__id__workout_history__source_active_workout_session_id',
|
|
);
|
|
|
|
$$WorkoutHistoriesTableProcessedTableManager get workoutHistoriesRefs {
|
|
final manager =
|
|
$$WorkoutHistoriesTableTableManager($_db, $_db.workoutHistories).filter(
|
|
(f) => f.sourceActiveWorkoutSessionId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutHistoriesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ActiveWorkoutSessionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ActiveWorkoutSessionsTable> {
|
|
$$ActiveWorkoutSessionsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get pausedAt => $composableBuilder(
|
|
column: $table.pausedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastPersistedAt => $composableBuilder(
|
|
column: $table.lastPersistedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get elapsedActiveMs => $composableBuilder(
|
|
column: $table.elapsedActiveMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get currentProgramIndex => $composableBuilder(
|
|
column: $table.currentProgramIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get currentExerciseIndex => $composableBuilder(
|
|
column: $table.currentExerciseIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get currentSetIndex => $composableBuilder(
|
|
column: $table.currentSetIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get resolvedTemplateSnapshotJson => $composableBuilder(
|
|
column: $table.resolvedTemplateSnapshotJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableFilterComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> activeRestStatesRefs(
|
|
Expression<bool> Function($$ActiveRestStatesTableFilterComposer f) f,
|
|
) {
|
|
final $$ActiveRestStatesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeRestStates,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveRestStatesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeRestStates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> activeScoreStopwatchStatesRefs(
|
|
Expression<bool> Function($$ActiveScoreStopwatchStatesTableFilterComposer f)
|
|
f,
|
|
) {
|
|
final $$ActiveScoreStopwatchStatesTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeScoreStopwatchStates,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveScoreStopwatchStatesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeScoreStopwatchStates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> activeSetResultsRefs(
|
|
Expression<bool> Function($$ActiveSetResultsTableFilterComposer f) f,
|
|
) {
|
|
final $$ActiveSetResultsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeSetResults,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveSetResultsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeSetResults,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> workoutHistoriesRefs(
|
|
Expression<bool> Function($$WorkoutHistoriesTableFilterComposer f) f,
|
|
) {
|
|
final $$WorkoutHistoriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.sourceActiveWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ActiveWorkoutSessionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ActiveWorkoutSessionsTable> {
|
|
$$ActiveWorkoutSessionsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get pausedAt => $composableBuilder(
|
|
column: $table.pausedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastPersistedAt => $composableBuilder(
|
|
column: $table.lastPersistedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get elapsedActiveMs => $composableBuilder(
|
|
column: $table.elapsedActiveMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get currentProgramIndex => $composableBuilder(
|
|
column: $table.currentProgramIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get currentExerciseIndex => $composableBuilder(
|
|
column: $table.currentExerciseIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get currentSetIndex => $composableBuilder(
|
|
column: $table.currentSetIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get resolvedTemplateSnapshotJson =>
|
|
$composableBuilder(
|
|
column: $table.resolvedTemplateSnapshotJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableOrderingComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveWorkoutSessionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ActiveWorkoutSessionsTable> {
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get pausedAt =>
|
|
$composableBuilder(column: $table.pausedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get endedAt =>
|
|
$composableBuilder(column: $table.endedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get lastPersistedAt => $composableBuilder(
|
|
column: $table.lastPersistedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get elapsedActiveMs => $composableBuilder(
|
|
column: $table.elapsedActiveMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get currentProgramIndex => $composableBuilder(
|
|
column: $table.currentProgramIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get currentExerciseIndex => $composableBuilder(
|
|
column: $table.currentExerciseIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get currentSetIndex => $composableBuilder(
|
|
column: $table.currentSetIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get resolvedTemplateSnapshotJson =>
|
|
$composableBuilder(
|
|
column: $table.resolvedTemplateSnapshotJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$WorkoutTemplatesTableAnnotationComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> activeRestStatesRefs<T extends Object>(
|
|
Expression<T> Function($$ActiveRestStatesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ActiveRestStatesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeRestStates,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveRestStatesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeRestStates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> activeScoreStopwatchStatesRefs<T extends Object>(
|
|
Expression<T> Function(
|
|
$$ActiveScoreStopwatchStatesTableAnnotationComposer a,
|
|
)
|
|
f,
|
|
) {
|
|
final $$ActiveScoreStopwatchStatesTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeScoreStopwatchStates,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveScoreStopwatchStatesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeScoreStopwatchStates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> activeSetResultsRefs<T extends Object>(
|
|
Expression<T> Function($$ActiveSetResultsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ActiveSetResultsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.activeSetResults,
|
|
getReferencedColumn: (t) => t.activeWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveSetResultsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeSetResults,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> workoutHistoriesRefs<T extends Object>(
|
|
Expression<T> Function($$WorkoutHistoriesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$WorkoutHistoriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.sourceActiveWorkoutSessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ActiveWorkoutSessionsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveWorkoutSession,
|
|
$$ActiveWorkoutSessionsTableFilterComposer,
|
|
$$ActiveWorkoutSessionsTableOrderingComposer,
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer,
|
|
$$ActiveWorkoutSessionsTableCreateCompanionBuilder,
|
|
$$ActiveWorkoutSessionsTableUpdateCompanionBuilder,
|
|
(ActiveWorkoutSession, $$ActiveWorkoutSessionsTableReferences),
|
|
ActiveWorkoutSession,
|
|
PrefetchHooks Function({
|
|
bool sourceWorkoutTemplateId,
|
|
bool activeRestStatesRefs,
|
|
bool activeScoreStopwatchStatesRefs,
|
|
bool activeSetResultsRefs,
|
|
bool workoutHistoriesRefs,
|
|
})
|
|
> {
|
|
$$ActiveWorkoutSessionsTableTableManager(
|
|
_$AppDatabase db,
|
|
$ActiveWorkoutSessionsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$ActiveWorkoutSessionsTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<DateTime> startedAt = const Value.absent(),
|
|
Value<DateTime?> pausedAt = const Value.absent(),
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
Value<DateTime> lastPersistedAt = const Value.absent(),
|
|
Value<int> elapsedActiveMs = const Value.absent(),
|
|
Value<int> currentProgramIndex = const Value.absent(),
|
|
Value<int> currentExerciseIndex = const Value.absent(),
|
|
Value<int> currentSetIndex = const Value.absent(),
|
|
Value<String> resolvedTemplateSnapshotJson =
|
|
const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveWorkoutSessionsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId,
|
|
status: status,
|
|
startedAt: startedAt,
|
|
pausedAt: pausedAt,
|
|
endedAt: endedAt,
|
|
lastPersistedAt: lastPersistedAt,
|
|
elapsedActiveMs: elapsedActiveMs,
|
|
currentProgramIndex: currentProgramIndex,
|
|
currentExerciseIndex: currentExerciseIndex,
|
|
currentSetIndex: currentSetIndex,
|
|
resolvedTemplateSnapshotJson: resolvedTemplateSnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
required String status,
|
|
required DateTime startedAt,
|
|
Value<DateTime?> pausedAt = const Value.absent(),
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
required DateTime lastPersistedAt,
|
|
required int elapsedActiveMs,
|
|
required int currentProgramIndex,
|
|
required int currentExerciseIndex,
|
|
required int currentSetIndex,
|
|
required String resolvedTemplateSnapshotJson,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveWorkoutSessionsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId,
|
|
status: status,
|
|
startedAt: startedAt,
|
|
pausedAt: pausedAt,
|
|
endedAt: endedAt,
|
|
lastPersistedAt: lastPersistedAt,
|
|
elapsedActiveMs: elapsedActiveMs,
|
|
currentProgramIndex: currentProgramIndex,
|
|
currentExerciseIndex: currentExerciseIndex,
|
|
currentSetIndex: currentSetIndex,
|
|
resolvedTemplateSnapshotJson: resolvedTemplateSnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ActiveWorkoutSessionsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
sourceWorkoutTemplateId = false,
|
|
activeRestStatesRefs = false,
|
|
activeScoreStopwatchStatesRefs = false,
|
|
activeSetResultsRefs = false,
|
|
workoutHistoriesRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (activeRestStatesRefs) db.activeRestStates,
|
|
if (activeScoreStopwatchStatesRefs)
|
|
db.activeScoreStopwatchStates,
|
|
if (activeSetResultsRefs) db.activeSetResults,
|
|
if (workoutHistoriesRefs) db.workoutHistories,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (sourceWorkoutTemplateId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn:
|
|
table.sourceWorkoutTemplateId,
|
|
referencedTable:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._sourceWorkoutTemplateIdTable(db),
|
|
referencedColumn:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._sourceWorkoutTemplateIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (activeRestStatesRefs)
|
|
await $_getPrefetchedData<
|
|
ActiveWorkoutSession,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveRestState
|
|
>(
|
|
currentTable: table,
|
|
referencedTable:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._activeRestStatesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ActiveWorkoutSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).activeRestStatesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.activeWorkoutSessionId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (activeScoreStopwatchStatesRefs)
|
|
await $_getPrefetchedData<
|
|
ActiveWorkoutSession,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveScoreStopwatchState
|
|
>(
|
|
currentTable: table,
|
|
referencedTable:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._activeScoreStopwatchStatesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ActiveWorkoutSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).activeScoreStopwatchStatesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.activeWorkoutSessionId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (activeSetResultsRefs)
|
|
await $_getPrefetchedData<
|
|
ActiveWorkoutSession,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveSetResult
|
|
>(
|
|
currentTable: table,
|
|
referencedTable:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._activeSetResultsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ActiveWorkoutSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).activeSetResultsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.activeWorkoutSessionId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (workoutHistoriesRefs)
|
|
await $_getPrefetchedData<
|
|
ActiveWorkoutSession,
|
|
$ActiveWorkoutSessionsTable,
|
|
WorkoutHistory
|
|
>(
|
|
currentTable: table,
|
|
referencedTable:
|
|
$$ActiveWorkoutSessionsTableReferences
|
|
._workoutHistoriesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ActiveWorkoutSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutHistoriesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) =>
|
|
e.sourceActiveWorkoutSessionId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ActiveWorkoutSessionsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ActiveWorkoutSessionsTable,
|
|
ActiveWorkoutSession,
|
|
$$ActiveWorkoutSessionsTableFilterComposer,
|
|
$$ActiveWorkoutSessionsTableOrderingComposer,
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer,
|
|
$$ActiveWorkoutSessionsTableCreateCompanionBuilder,
|
|
$$ActiveWorkoutSessionsTableUpdateCompanionBuilder,
|
|
(ActiveWorkoutSession, $$ActiveWorkoutSessionsTableReferences),
|
|
ActiveWorkoutSession,
|
|
PrefetchHooks Function({
|
|
bool sourceWorkoutTemplateId,
|
|
bool activeRestStatesRefs,
|
|
bool activeScoreStopwatchStatesRefs,
|
|
bool activeSetResultsRefs,
|
|
bool workoutHistoriesRefs,
|
|
})
|
|
>;
|
|
typedef $$ActiveRestStatesTableCreateCompanionBuilder =
|
|
ActiveRestStatesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String activeWorkoutSessionId,
|
|
required int afterProgramIndex,
|
|
required int afterExerciseIndex,
|
|
required int afterSetIndex,
|
|
required int plannedRestSeconds,
|
|
required int adjustedRestSeconds,
|
|
required DateTime startedAt,
|
|
Value<DateTime?> endedAt,
|
|
Value<DateTime?> skippedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ActiveRestStatesTableUpdateCompanionBuilder =
|
|
ActiveRestStatesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> activeWorkoutSessionId,
|
|
Value<int> afterProgramIndex,
|
|
Value<int> afterExerciseIndex,
|
|
Value<int> afterSetIndex,
|
|
Value<int> plannedRestSeconds,
|
|
Value<int> adjustedRestSeconds,
|
|
Value<DateTime> startedAt,
|
|
Value<DateTime?> endedAt,
|
|
Value<DateTime?> skippedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ActiveRestStatesTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $ActiveRestStatesTable, ActiveRestState> {
|
|
$$ActiveRestStatesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $ActiveWorkoutSessionsTable _activeWorkoutSessionIdTable(
|
|
_$AppDatabase db,
|
|
) => db.activeWorkoutSessions.createAlias(
|
|
'active_rest_states__active_workout_session_id__active_workout_sessions__id',
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableProcessedTableManager get activeWorkoutSessionId {
|
|
final $_column = $_itemColumn<String>('active_workout_session_id')!;
|
|
|
|
final manager = $$ActiveWorkoutSessionsTableTableManager(
|
|
$_db,
|
|
$_db.activeWorkoutSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_activeWorkoutSessionIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ActiveRestStatesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ActiveRestStatesTable> {
|
|
$$ActiveRestStatesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get afterProgramIndex => $composableBuilder(
|
|
column: $table.afterProgramIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get afterExerciseIndex => $composableBuilder(
|
|
column: $table.afterExerciseIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get afterSetIndex => $composableBuilder(
|
|
column: $table.afterSetIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get plannedRestSeconds => $composableBuilder(
|
|
column: $table.plannedRestSeconds,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get adjustedRestSeconds => $composableBuilder(
|
|
column: $table.adjustedRestSeconds,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get skippedAt => $composableBuilder(
|
|
column: $table.skippedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableFilterComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveRestStatesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ActiveRestStatesTable> {
|
|
$$ActiveRestStatesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get afterProgramIndex => $composableBuilder(
|
|
column: $table.afterProgramIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get afterExerciseIndex => $composableBuilder(
|
|
column: $table.afterExerciseIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get afterSetIndex => $composableBuilder(
|
|
column: $table.afterSetIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get plannedRestSeconds => $composableBuilder(
|
|
column: $table.plannedRestSeconds,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get adjustedRestSeconds => $composableBuilder(
|
|
column: $table.adjustedRestSeconds,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get skippedAt => $composableBuilder(
|
|
column: $table.skippedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableOrderingComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableOrderingComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveRestStatesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ActiveRestStatesTable> {
|
|
$$ActiveRestStatesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get afterProgramIndex => $composableBuilder(
|
|
column: $table.afterProgramIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get afterExerciseIndex => $composableBuilder(
|
|
column: $table.afterExerciseIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get afterSetIndex => $composableBuilder(
|
|
column: $table.afterSetIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get plannedRestSeconds => $composableBuilder(
|
|
column: $table.plannedRestSeconds,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get adjustedRestSeconds => $composableBuilder(
|
|
column: $table.adjustedRestSeconds,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get endedAt =>
|
|
$composableBuilder(column: $table.endedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get skippedAt =>
|
|
$composableBuilder(column: $table.skippedAt, builder: (column) => column);
|
|
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveRestStatesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ActiveRestStatesTable,
|
|
ActiveRestState,
|
|
$$ActiveRestStatesTableFilterComposer,
|
|
$$ActiveRestStatesTableOrderingComposer,
|
|
$$ActiveRestStatesTableAnnotationComposer,
|
|
$$ActiveRestStatesTableCreateCompanionBuilder,
|
|
$$ActiveRestStatesTableUpdateCompanionBuilder,
|
|
(ActiveRestState, $$ActiveRestStatesTableReferences),
|
|
ActiveRestState,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
> {
|
|
$$ActiveRestStatesTableTableManager(
|
|
_$AppDatabase db,
|
|
$ActiveRestStatesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ActiveRestStatesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ActiveRestStatesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ActiveRestStatesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> activeWorkoutSessionId = const Value.absent(),
|
|
Value<int> afterProgramIndex = const Value.absent(),
|
|
Value<int> afterExerciseIndex = const Value.absent(),
|
|
Value<int> afterSetIndex = const Value.absent(),
|
|
Value<int> plannedRestSeconds = const Value.absent(),
|
|
Value<int> adjustedRestSeconds = const Value.absent(),
|
|
Value<DateTime> startedAt = const Value.absent(),
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
Value<DateTime?> skippedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveRestStatesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
afterProgramIndex: afterProgramIndex,
|
|
afterExerciseIndex: afterExerciseIndex,
|
|
afterSetIndex: afterSetIndex,
|
|
plannedRestSeconds: plannedRestSeconds,
|
|
adjustedRestSeconds: adjustedRestSeconds,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
skippedAt: skippedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required int afterProgramIndex,
|
|
required int afterExerciseIndex,
|
|
required int afterSetIndex,
|
|
required int plannedRestSeconds,
|
|
required int adjustedRestSeconds,
|
|
required DateTime startedAt,
|
|
Value<DateTime?> endedAt = const Value.absent(),
|
|
Value<DateTime?> skippedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveRestStatesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
afterProgramIndex: afterProgramIndex,
|
|
afterExerciseIndex: afterExerciseIndex,
|
|
afterSetIndex: afterSetIndex,
|
|
plannedRestSeconds: plannedRestSeconds,
|
|
adjustedRestSeconds: adjustedRestSeconds,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
skippedAt: skippedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ActiveRestStatesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({activeWorkoutSessionId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (activeWorkoutSessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.activeWorkoutSessionId,
|
|
referencedTable:
|
|
$$ActiveRestStatesTableReferences
|
|
._activeWorkoutSessionIdTable(db),
|
|
referencedColumn:
|
|
$$ActiveRestStatesTableReferences
|
|
._activeWorkoutSessionIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ActiveRestStatesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ActiveRestStatesTable,
|
|
ActiveRestState,
|
|
$$ActiveRestStatesTableFilterComposer,
|
|
$$ActiveRestStatesTableOrderingComposer,
|
|
$$ActiveRestStatesTableAnnotationComposer,
|
|
$$ActiveRestStatesTableCreateCompanionBuilder,
|
|
$$ActiveRestStatesTableUpdateCompanionBuilder,
|
|
(ActiveRestState, $$ActiveRestStatesTableReferences),
|
|
ActiveRestState,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
>;
|
|
typedef $$ActiveScoreStopwatchStatesTableCreateCompanionBuilder =
|
|
ActiveScoreStopwatchStatesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String activeWorkoutSessionId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String status,
|
|
required DateTime startedAt,
|
|
required int accumulatedMs,
|
|
Value<DateTime?> stoppedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ActiveScoreStopwatchStatesTableUpdateCompanionBuilder =
|
|
ActiveScoreStopwatchStatesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> activeWorkoutSessionId,
|
|
Value<int> programIndex,
|
|
Value<int> exerciseIndex,
|
|
Value<int> setIndex,
|
|
Value<String> status,
|
|
Value<DateTime> startedAt,
|
|
Value<int> accumulatedMs,
|
|
Value<DateTime?> stoppedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ActiveScoreStopwatchStatesTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$ActiveScoreStopwatchStatesTable,
|
|
ActiveScoreStopwatchState
|
|
> {
|
|
$$ActiveScoreStopwatchStatesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $ActiveWorkoutSessionsTable _activeWorkoutSessionIdTable(
|
|
_$AppDatabase db,
|
|
) => db.activeWorkoutSessions.createAlias(
|
|
'active_score_stopwatch_states__active_workout_session_id__active_workout_sessions__id',
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableProcessedTableManager get activeWorkoutSessionId {
|
|
final $_column = $_itemColumn<String>('active_workout_session_id')!;
|
|
|
|
final manager = $$ActiveWorkoutSessionsTableTableManager(
|
|
$_db,
|
|
$_db.activeWorkoutSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_activeWorkoutSessionIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ActiveScoreStopwatchStatesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ActiveScoreStopwatchStatesTable> {
|
|
$$ActiveScoreStopwatchStatesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get accumulatedMs => $composableBuilder(
|
|
column: $table.accumulatedMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get stoppedAt => $composableBuilder(
|
|
column: $table.stoppedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableFilterComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveScoreStopwatchStatesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ActiveScoreStopwatchStatesTable> {
|
|
$$ActiveScoreStopwatchStatesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get accumulatedMs => $composableBuilder(
|
|
column: $table.accumulatedMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get stoppedAt => $composableBuilder(
|
|
column: $table.stoppedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableOrderingComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableOrderingComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveScoreStopwatchStatesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ActiveScoreStopwatchStatesTable> {
|
|
$$ActiveScoreStopwatchStatesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get setIndex =>
|
|
$composableBuilder(column: $table.setIndex, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get accumulatedMs => $composableBuilder(
|
|
column: $table.accumulatedMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get stoppedAt =>
|
|
$composableBuilder(column: $table.stoppedAt, builder: (column) => column);
|
|
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveScoreStopwatchStatesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ActiveScoreStopwatchStatesTable,
|
|
ActiveScoreStopwatchState,
|
|
$$ActiveScoreStopwatchStatesTableFilterComposer,
|
|
$$ActiveScoreStopwatchStatesTableOrderingComposer,
|
|
$$ActiveScoreStopwatchStatesTableAnnotationComposer,
|
|
$$ActiveScoreStopwatchStatesTableCreateCompanionBuilder,
|
|
$$ActiveScoreStopwatchStatesTableUpdateCompanionBuilder,
|
|
(
|
|
ActiveScoreStopwatchState,
|
|
$$ActiveScoreStopwatchStatesTableReferences,
|
|
),
|
|
ActiveScoreStopwatchState,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
> {
|
|
$$ActiveScoreStopwatchStatesTableTableManager(
|
|
_$AppDatabase db,
|
|
$ActiveScoreStopwatchStatesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ActiveScoreStopwatchStatesTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$ActiveScoreStopwatchStatesTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$ActiveScoreStopwatchStatesTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> activeWorkoutSessionId = const Value.absent(),
|
|
Value<int> programIndex = const Value.absent(),
|
|
Value<int> exerciseIndex = const Value.absent(),
|
|
Value<int> setIndex = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<DateTime> startedAt = const Value.absent(),
|
|
Value<int> accumulatedMs = const Value.absent(),
|
|
Value<DateTime?> stoppedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveScoreStopwatchStatesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
status: status,
|
|
startedAt: startedAt,
|
|
accumulatedMs: accumulatedMs,
|
|
stoppedAt: stoppedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String status,
|
|
required DateTime startedAt,
|
|
required int accumulatedMs,
|
|
Value<DateTime?> stoppedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveScoreStopwatchStatesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
status: status,
|
|
startedAt: startedAt,
|
|
accumulatedMs: accumulatedMs,
|
|
stoppedAt: stoppedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ActiveScoreStopwatchStatesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({activeWorkoutSessionId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (activeWorkoutSessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.activeWorkoutSessionId,
|
|
referencedTable:
|
|
$$ActiveScoreStopwatchStatesTableReferences
|
|
._activeWorkoutSessionIdTable(db),
|
|
referencedColumn:
|
|
$$ActiveScoreStopwatchStatesTableReferences
|
|
._activeWorkoutSessionIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ActiveScoreStopwatchStatesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ActiveScoreStopwatchStatesTable,
|
|
ActiveScoreStopwatchState,
|
|
$$ActiveScoreStopwatchStatesTableFilterComposer,
|
|
$$ActiveScoreStopwatchStatesTableOrderingComposer,
|
|
$$ActiveScoreStopwatchStatesTableAnnotationComposer,
|
|
$$ActiveScoreStopwatchStatesTableCreateCompanionBuilder,
|
|
$$ActiveScoreStopwatchStatesTableUpdateCompanionBuilder,
|
|
(ActiveScoreStopwatchState, $$ActiveScoreStopwatchStatesTableReferences),
|
|
ActiveScoreStopwatchState,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
>;
|
|
typedef $$ActiveSetResultsTableCreateCompanionBuilder =
|
|
ActiveSetResultsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String activeWorkoutSessionId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
Value<DateTime?> startedAt,
|
|
Value<DateTime?> completedAt,
|
|
Value<int?> actualTimeMs,
|
|
Value<int?> actualReps,
|
|
Value<double?> actualScore,
|
|
Value<int?> actualScoreTimeMs,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
Value<String?> note,
|
|
Value<String> status,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ActiveSetResultsTableUpdateCompanionBuilder =
|
|
ActiveSetResultsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> activeWorkoutSessionId,
|
|
Value<String> programSnapshotId,
|
|
Value<String> exerciseSnapshotId,
|
|
Value<int> programIndex,
|
|
Value<int> exerciseIndex,
|
|
Value<int> setIndex,
|
|
Value<DateTime?> startedAt,
|
|
Value<DateTime?> completedAt,
|
|
Value<int?> actualTimeMs,
|
|
Value<int?> actualReps,
|
|
Value<double?> actualScore,
|
|
Value<int?> actualScoreTimeMs,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
Value<String?> note,
|
|
Value<String> status,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ActiveSetResultsTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $ActiveSetResultsTable, ActiveSetResult> {
|
|
$$ActiveSetResultsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $ActiveWorkoutSessionsTable _activeWorkoutSessionIdTable(
|
|
_$AppDatabase db,
|
|
) => db.activeWorkoutSessions.createAlias(
|
|
'active_set_results__active_workout_session_id__active_workout_sessions__id',
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableProcessedTableManager get activeWorkoutSessionId {
|
|
final $_column = $_itemColumn<String>('active_workout_session_id')!;
|
|
|
|
final manager = $$ActiveWorkoutSessionsTableTableManager(
|
|
$_db,
|
|
$_db.activeWorkoutSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_activeWorkoutSessionIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ActiveSetResultsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ActiveSetResultsTable> {
|
|
$$ActiveSetResultsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableFilterComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveSetResultsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ActiveSetResultsTable> {
|
|
$$ActiveSetResultsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableOrderingComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableOrderingComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveSetResultsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ActiveSetResultsTable> {
|
|
$$ActiveSetResultsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get setIndex =>
|
|
$composableBuilder(column: $table.setIndex, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer get activeWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.activeWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ActiveSetResultsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ActiveSetResultsTable,
|
|
ActiveSetResult,
|
|
$$ActiveSetResultsTableFilterComposer,
|
|
$$ActiveSetResultsTableOrderingComposer,
|
|
$$ActiveSetResultsTableAnnotationComposer,
|
|
$$ActiveSetResultsTableCreateCompanionBuilder,
|
|
$$ActiveSetResultsTableUpdateCompanionBuilder,
|
|
(ActiveSetResult, $$ActiveSetResultsTableReferences),
|
|
ActiveSetResult,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
> {
|
|
$$ActiveSetResultsTableTableManager(
|
|
_$AppDatabase db,
|
|
$ActiveSetResultsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ActiveSetResultsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ActiveSetResultsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ActiveSetResultsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> activeWorkoutSessionId = const Value.absent(),
|
|
Value<String> programSnapshotId = const Value.absent(),
|
|
Value<String> exerciseSnapshotId = const Value.absent(),
|
|
Value<int> programIndex = const Value.absent(),
|
|
Value<int> exerciseIndex = const Value.absent(),
|
|
Value<int> setIndex = const Value.absent(),
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveSetResultsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
programSnapshotId: programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
startedAt: startedAt,
|
|
completedAt: completedAt,
|
|
actualTimeMs: actualTimeMs,
|
|
actualReps: actualReps,
|
|
actualScore: actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
note: note,
|
|
status: status,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String activeWorkoutSessionId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ActiveSetResultsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
activeWorkoutSessionId: activeWorkoutSessionId,
|
|
programSnapshotId: programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
startedAt: startedAt,
|
|
completedAt: completedAt,
|
|
actualTimeMs: actualTimeMs,
|
|
actualReps: actualReps,
|
|
actualScore: actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
note: note,
|
|
status: status,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ActiveSetResultsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({activeWorkoutSessionId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (activeWorkoutSessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.activeWorkoutSessionId,
|
|
referencedTable:
|
|
$$ActiveSetResultsTableReferences
|
|
._activeWorkoutSessionIdTable(db),
|
|
referencedColumn:
|
|
$$ActiveSetResultsTableReferences
|
|
._activeWorkoutSessionIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ActiveSetResultsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ActiveSetResultsTable,
|
|
ActiveSetResult,
|
|
$$ActiveSetResultsTableFilterComposer,
|
|
$$ActiveSetResultsTableOrderingComposer,
|
|
$$ActiveSetResultsTableAnnotationComposer,
|
|
$$ActiveSetResultsTableCreateCompanionBuilder,
|
|
$$ActiveSetResultsTableUpdateCompanionBuilder,
|
|
(ActiveSetResult, $$ActiveSetResultsTableReferences),
|
|
ActiveSetResult,
|
|
PrefetchHooks Function({bool activeWorkoutSessionId})
|
|
>;
|
|
typedef $$ChangeLogEntriesTableCreateCompanionBuilder =
|
|
ChangeLogEntriesCompanion Function({
|
|
required String id,
|
|
required String entityType,
|
|
required String entityId,
|
|
required String operation,
|
|
Value<String?> payloadHash,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
required DateTime createdAt,
|
|
Value<DateTime?> syncedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ChangeLogEntriesTableUpdateCompanionBuilder =
|
|
ChangeLogEntriesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> entityType,
|
|
Value<String> entityId,
|
|
Value<String> operation,
|
|
Value<String?> payloadHash,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime?> syncedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ChangeLogEntriesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ChangeLogEntriesTable> {
|
|
$$ChangeLogEntriesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get entityType => $composableBuilder(
|
|
column: $table.entityType,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get entityId => $composableBuilder(
|
|
column: $table.entityId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get operation => $composableBuilder(
|
|
column: $table.operation,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get payloadHash => $composableBuilder(
|
|
column: $table.payloadHash,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get syncedAt => $composableBuilder(
|
|
column: $table.syncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ChangeLogEntriesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ChangeLogEntriesTable> {
|
|
$$ChangeLogEntriesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get entityType => $composableBuilder(
|
|
column: $table.entityType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get entityId => $composableBuilder(
|
|
column: $table.entityId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get operation => $composableBuilder(
|
|
column: $table.operation,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get payloadHash => $composableBuilder(
|
|
column: $table.payloadHash,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get syncedAt => $composableBuilder(
|
|
column: $table.syncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ChangeLogEntriesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ChangeLogEntriesTable> {
|
|
$$ChangeLogEntriesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get entityType => $composableBuilder(
|
|
column: $table.entityType,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get entityId =>
|
|
$composableBuilder(column: $table.entityId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get operation =>
|
|
$composableBuilder(column: $table.operation, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get payloadHash => $composableBuilder(
|
|
column: $table.payloadHash,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get syncedAt =>
|
|
$composableBuilder(column: $table.syncedAt, builder: (column) => column);
|
|
}
|
|
|
|
class $$ChangeLogEntriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ChangeLogEntriesTable,
|
|
ChangeLogEntry,
|
|
$$ChangeLogEntriesTableFilterComposer,
|
|
$$ChangeLogEntriesTableOrderingComposer,
|
|
$$ChangeLogEntriesTableAnnotationComposer,
|
|
$$ChangeLogEntriesTableCreateCompanionBuilder,
|
|
$$ChangeLogEntriesTableUpdateCompanionBuilder,
|
|
(
|
|
ChangeLogEntry,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$ChangeLogEntriesTable,
|
|
ChangeLogEntry
|
|
>,
|
|
),
|
|
ChangeLogEntry,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ChangeLogEntriesTableTableManager(
|
|
_$AppDatabase db,
|
|
$ChangeLogEntriesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ChangeLogEntriesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ChangeLogEntriesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ChangeLogEntriesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> entityType = const Value.absent(),
|
|
Value<String> entityId = const Value.absent(),
|
|
Value<String> operation = const Value.absent(),
|
|
Value<String?> payloadHash = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime?> syncedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChangeLogEntriesCompanion(
|
|
id: id,
|
|
entityType: entityType,
|
|
entityId: entityId,
|
|
operation: operation,
|
|
payloadHash: payloadHash,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
createdAt: createdAt,
|
|
syncedAt: syncedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String entityType,
|
|
required String entityId,
|
|
required String operation,
|
|
Value<String?> payloadHash = const Value.absent(),
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
required DateTime createdAt,
|
|
Value<DateTime?> syncedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChangeLogEntriesCompanion.insert(
|
|
id: id,
|
|
entityType: entityType,
|
|
entityId: entityId,
|
|
operation: operation,
|
|
payloadHash: payloadHash,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
createdAt: createdAt,
|
|
syncedAt: syncedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ChangeLogEntriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ChangeLogEntriesTable,
|
|
ChangeLogEntry,
|
|
$$ChangeLogEntriesTableFilterComposer,
|
|
$$ChangeLogEntriesTableOrderingComposer,
|
|
$$ChangeLogEntriesTableAnnotationComposer,
|
|
$$ChangeLogEntriesTableCreateCompanionBuilder,
|
|
$$ChangeLogEntriesTableUpdateCompanionBuilder,
|
|
(
|
|
ChangeLogEntry,
|
|
BaseReferences<_$AppDatabase, $ChangeLogEntriesTable, ChangeLogEntry>,
|
|
),
|
|
ChangeLogEntry,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$MediaAssetsTableCreateCompanionBuilder =
|
|
MediaAssetsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String kind,
|
|
required String localUri,
|
|
Value<String?> mimeType,
|
|
Value<int?> sizeBytes,
|
|
Value<int?> width,
|
|
Value<int?> height,
|
|
Value<int?> durationMs,
|
|
Value<String?> checksum,
|
|
Value<String?> remoteUri,
|
|
Value<String?> thumbnailLocalUri,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$MediaAssetsTableUpdateCompanionBuilder =
|
|
MediaAssetsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> kind,
|
|
Value<String> localUri,
|
|
Value<String?> mimeType,
|
|
Value<int?> sizeBytes,
|
|
Value<int?> width,
|
|
Value<int?> height,
|
|
Value<int?> durationMs,
|
|
Value<String?> checksum,
|
|
Value<String?> remoteUri,
|
|
Value<String?> thumbnailLocalUri,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$MediaAssetsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $MediaAssetsTable, MediaAsset> {
|
|
$$MediaAssetsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$ExercisesTable, List<Exercise>>
|
|
_exerciseImageReferencesTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.exercises,
|
|
aliasName: 'media_assets__id__exercises__image_media_id',
|
|
);
|
|
|
|
$$ExercisesTableProcessedTableManager get exerciseImageReferences {
|
|
final manager = $$ExercisesTableTableManager(
|
|
$_db,
|
|
$_db.exercises,
|
|
).filter((f) => f.imageMediaId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_exerciseImageReferencesTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ExercisesTable, List<Exercise>>
|
|
_exerciseVideoReferencesTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.exercises,
|
|
aliasName: 'media_assets__id__exercises__video_media_id',
|
|
);
|
|
|
|
$$ExercisesTableProcessedTableManager get exerciseVideoReferences {
|
|
final manager = $$ExercisesTableTableManager(
|
|
$_db,
|
|
$_db.exercises,
|
|
).filter((f) => f.videoMediaId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_exerciseVideoReferencesTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ProgramExercisesTable, List<ProgramExercise>>
|
|
_programExerciseImageSnapshotReferencesTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.programExercises,
|
|
aliasName:
|
|
'media_assets__id__program_exercises__exercise_image_media_id_snapshot',
|
|
);
|
|
|
|
$$ProgramExercisesTableProcessedTableManager
|
|
get programExerciseImageSnapshotReferences {
|
|
final manager =
|
|
$$ProgramExercisesTableTableManager($_db, $_db.programExercises).filter(
|
|
(f) => f.exerciseImageMediaIdSnapshot.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programExerciseImageSnapshotReferencesTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ProgramExercisesTable, List<ProgramExercise>>
|
|
_programExerciseVideoSnapshotReferencesTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.programExercises,
|
|
aliasName:
|
|
'media_assets__id__program_exercises__exercise_video_media_id_snapshot',
|
|
);
|
|
|
|
$$ProgramExercisesTableProcessedTableManager
|
|
get programExerciseVideoSnapshotReferences {
|
|
final manager =
|
|
$$ProgramExercisesTableTableManager($_db, $_db.programExercises).filter(
|
|
(f) => f.exerciseVideoMediaIdSnapshot.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programExerciseVideoSnapshotReferencesTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$MediaAssetsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MediaAssetsTable> {
|
|
$$MediaAssetsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get localUri => $composableBuilder(
|
|
column: $table.localUri,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get mimeType => $composableBuilder(
|
|
column: $table.mimeType,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sizeBytes => $composableBuilder(
|
|
column: $table.sizeBytes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get width => $composableBuilder(
|
|
column: $table.width,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get height => $composableBuilder(
|
|
column: $table.height,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get checksum => $composableBuilder(
|
|
column: $table.checksum,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteUri => $composableBuilder(
|
|
column: $table.remoteUri,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get thumbnailLocalUri => $composableBuilder(
|
|
column: $table.thumbnailLocalUri,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> exerciseImageReferences(
|
|
Expression<bool> Function($$ExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.imageMediaId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> exerciseVideoReferences(
|
|
Expression<bool> Function($$ExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.videoMediaId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> programExerciseImageSnapshotReferences(
|
|
Expression<bool> Function($$ProgramExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.exerciseImageMediaIdSnapshot,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> programExerciseVideoSnapshotReferences(
|
|
Expression<bool> Function($$ProgramExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.exerciseVideoMediaIdSnapshot,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$MediaAssetsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MediaAssetsTable> {
|
|
$$MediaAssetsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get localUri => $composableBuilder(
|
|
column: $table.localUri,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get mimeType => $composableBuilder(
|
|
column: $table.mimeType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sizeBytes => $composableBuilder(
|
|
column: $table.sizeBytes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get width => $composableBuilder(
|
|
column: $table.width,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get height => $composableBuilder(
|
|
column: $table.height,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get checksum => $composableBuilder(
|
|
column: $table.checksum,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteUri => $composableBuilder(
|
|
column: $table.remoteUri,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get thumbnailLocalUri => $composableBuilder(
|
|
column: $table.thumbnailLocalUri,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$MediaAssetsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MediaAssetsTable> {
|
|
$$MediaAssetsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get kind =>
|
|
$composableBuilder(column: $table.kind, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get localUri =>
|
|
$composableBuilder(column: $table.localUri, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get mimeType =>
|
|
$composableBuilder(column: $table.mimeType, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get sizeBytes =>
|
|
$composableBuilder(column: $table.sizeBytes, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get width =>
|
|
$composableBuilder(column: $table.width, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get height =>
|
|
$composableBuilder(column: $table.height, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get checksum =>
|
|
$composableBuilder(column: $table.checksum, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get remoteUri =>
|
|
$composableBuilder(column: $table.remoteUri, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get thumbnailLocalUri => $composableBuilder(
|
|
column: $table.thumbnailLocalUri,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
Expression<T> exerciseImageReferences<T extends Object>(
|
|
Expression<T> Function($$ExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.imageMediaId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> exerciseVideoReferences<T extends Object>(
|
|
Expression<T> Function($$ExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.videoMediaId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> programExerciseImageSnapshotReferences<T extends Object>(
|
|
Expression<T> Function($$ProgramExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.exerciseImageMediaIdSnapshot,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> programExerciseVideoSnapshotReferences<T extends Object>(
|
|
Expression<T> Function($$ProgramExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.exerciseVideoMediaIdSnapshot,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$MediaAssetsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$MediaAssetsTable,
|
|
MediaAsset,
|
|
$$MediaAssetsTableFilterComposer,
|
|
$$MediaAssetsTableOrderingComposer,
|
|
$$MediaAssetsTableAnnotationComposer,
|
|
$$MediaAssetsTableCreateCompanionBuilder,
|
|
$$MediaAssetsTableUpdateCompanionBuilder,
|
|
(MediaAsset, $$MediaAssetsTableReferences),
|
|
MediaAsset,
|
|
PrefetchHooks Function({
|
|
bool exerciseImageReferences,
|
|
bool exerciseVideoReferences,
|
|
bool programExerciseImageSnapshotReferences,
|
|
bool programExerciseVideoSnapshotReferences,
|
|
})
|
|
> {
|
|
$$MediaAssetsTableTableManager(_$AppDatabase db, $MediaAssetsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MediaAssetsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MediaAssetsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MediaAssetsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> kind = const Value.absent(),
|
|
Value<String> localUri = const Value.absent(),
|
|
Value<String?> mimeType = const Value.absent(),
|
|
Value<int?> sizeBytes = const Value.absent(),
|
|
Value<int?> width = const Value.absent(),
|
|
Value<int?> height = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> checksum = const Value.absent(),
|
|
Value<String?> remoteUri = const Value.absent(),
|
|
Value<String?> thumbnailLocalUri = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MediaAssetsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
kind: kind,
|
|
localUri: localUri,
|
|
mimeType: mimeType,
|
|
sizeBytes: sizeBytes,
|
|
width: width,
|
|
height: height,
|
|
durationMs: durationMs,
|
|
checksum: checksum,
|
|
remoteUri: remoteUri,
|
|
thumbnailLocalUri: thumbnailLocalUri,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String kind,
|
|
required String localUri,
|
|
Value<String?> mimeType = const Value.absent(),
|
|
Value<int?> sizeBytes = const Value.absent(),
|
|
Value<int?> width = const Value.absent(),
|
|
Value<int?> height = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> checksum = const Value.absent(),
|
|
Value<String?> remoteUri = const Value.absent(),
|
|
Value<String?> thumbnailLocalUri = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MediaAssetsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
kind: kind,
|
|
localUri: localUri,
|
|
mimeType: mimeType,
|
|
sizeBytes: sizeBytes,
|
|
width: width,
|
|
height: height,
|
|
durationMs: durationMs,
|
|
checksum: checksum,
|
|
remoteUri: remoteUri,
|
|
thumbnailLocalUri: thumbnailLocalUri,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$MediaAssetsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
exerciseImageReferences = false,
|
|
exerciseVideoReferences = false,
|
|
programExerciseImageSnapshotReferences = false,
|
|
programExerciseVideoSnapshotReferences = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (exerciseImageReferences) db.exercises,
|
|
if (exerciseVideoReferences) db.exercises,
|
|
if (programExerciseImageSnapshotReferences)
|
|
db.programExercises,
|
|
if (programExerciseVideoSnapshotReferences)
|
|
db.programExercises,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (exerciseImageReferences)
|
|
await $_getPrefetchedData<
|
|
MediaAsset,
|
|
$MediaAssetsTable,
|
|
Exercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$MediaAssetsTableReferences
|
|
._exerciseImageReferencesTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$MediaAssetsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).exerciseImageReferences,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.imageMediaId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (exerciseVideoReferences)
|
|
await $_getPrefetchedData<
|
|
MediaAsset,
|
|
$MediaAssetsTable,
|
|
Exercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$MediaAssetsTableReferences
|
|
._exerciseVideoReferencesTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$MediaAssetsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).exerciseVideoReferences,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.videoMediaId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (programExerciseImageSnapshotReferences)
|
|
await $_getPrefetchedData<
|
|
MediaAsset,
|
|
$MediaAssetsTable,
|
|
ProgramExercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$MediaAssetsTableReferences
|
|
._programExerciseImageSnapshotReferencesTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$MediaAssetsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programExerciseImageSnapshotReferences,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) =>
|
|
e.exerciseImageMediaIdSnapshot == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (programExerciseVideoSnapshotReferences)
|
|
await $_getPrefetchedData<
|
|
MediaAsset,
|
|
$MediaAssetsTable,
|
|
ProgramExercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$MediaAssetsTableReferences
|
|
._programExerciseVideoSnapshotReferencesTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$MediaAssetsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programExerciseVideoSnapshotReferences,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) =>
|
|
e.exerciseVideoMediaIdSnapshot == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$MediaAssetsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MediaAssetsTable,
|
|
MediaAsset,
|
|
$$MediaAssetsTableFilterComposer,
|
|
$$MediaAssetsTableOrderingComposer,
|
|
$$MediaAssetsTableAnnotationComposer,
|
|
$$MediaAssetsTableCreateCompanionBuilder,
|
|
$$MediaAssetsTableUpdateCompanionBuilder,
|
|
(MediaAsset, $$MediaAssetsTableReferences),
|
|
MediaAsset,
|
|
PrefetchHooks Function({
|
|
bool exerciseImageReferences,
|
|
bool exerciseVideoReferences,
|
|
bool programExerciseImageSnapshotReferences,
|
|
bool programExerciseVideoSnapshotReferences,
|
|
})
|
|
>;
|
|
typedef $$ExercisesTableCreateCompanionBuilder =
|
|
ExercisesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String name,
|
|
Value<String?> description,
|
|
Value<String?> imageMediaId,
|
|
Value<String?> videoMediaId,
|
|
required bool hasTimeMeasure,
|
|
required bool hasRepsMeasure,
|
|
required bool hasScoreMeasure,
|
|
Value<String> scoreInputMode,
|
|
Value<String?> scoreLabel,
|
|
Value<String?> scoreUnit,
|
|
Value<DateTime?> archivedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ExercisesTableUpdateCompanionBuilder =
|
|
ExercisesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> name,
|
|
Value<String?> description,
|
|
Value<String?> imageMediaId,
|
|
Value<String?> videoMediaId,
|
|
Value<bool> hasTimeMeasure,
|
|
Value<bool> hasRepsMeasure,
|
|
Value<bool> hasScoreMeasure,
|
|
Value<String> scoreInputMode,
|
|
Value<String?> scoreLabel,
|
|
Value<String?> scoreUnit,
|
|
Value<DateTime?> archivedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ExercisesTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ExercisesTable, Exercise> {
|
|
$$ExercisesTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $MediaAssetsTable _imageMediaIdTable(_$AppDatabase db) =>
|
|
db.mediaAssets.createAlias('exercises__image_media_id__media_assets__id');
|
|
|
|
$$MediaAssetsTableProcessedTableManager? get imageMediaId {
|
|
final $_column = $_itemColumn<String>('image_media_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$MediaAssetsTableTableManager(
|
|
$_db,
|
|
$_db.mediaAssets,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_imageMediaIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $MediaAssetsTable _videoMediaIdTable(_$AppDatabase db) =>
|
|
db.mediaAssets.createAlias('exercises__video_media_id__media_assets__id');
|
|
|
|
$$MediaAssetsTableProcessedTableManager? get videoMediaId {
|
|
final $_column = $_itemColumn<String>('video_media_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$MediaAssetsTableTableManager(
|
|
$_db,
|
|
$_db.mediaAssets,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_videoMediaIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ProgramExercisesTable, List<ProgramExercise>>
|
|
_programExercisesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.programExercises,
|
|
aliasName: 'exercises__id__program_exercises__source_exercise_id',
|
|
);
|
|
|
|
$$ProgramExercisesTableProcessedTableManager get programExercisesRefs {
|
|
final manager =
|
|
$$ProgramExercisesTableTableManager($_db, $_db.programExercises).filter(
|
|
(f) => f.sourceExerciseId.id.sqlEquals($_itemColumn<String>('id')!),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programExercisesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ExercisesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get hasTimeMeasure => $composableBuilder(
|
|
column: $table.hasTimeMeasure,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get hasRepsMeasure => $composableBuilder(
|
|
column: $table.hasRepsMeasure,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get hasScoreMeasure => $composableBuilder(
|
|
column: $table.hasScoreMeasure,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreInputMode => $composableBuilder(
|
|
column: $table.scoreInputMode,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreLabel => $composableBuilder(
|
|
column: $table.scoreLabel,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreUnit => $composableBuilder(
|
|
column: $table.scoreUnit,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get archivedAt => $composableBuilder(
|
|
column: $table.archivedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$MediaAssetsTableFilterComposer get imageMediaId {
|
|
final $$MediaAssetsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.imageMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableFilterComposer get videoMediaId {
|
|
final $$MediaAssetsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.videoMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> programExercisesRefs(
|
|
Expression<bool> Function($$ProgramExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.sourceExerciseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ExercisesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get hasTimeMeasure => $composableBuilder(
|
|
column: $table.hasTimeMeasure,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get hasRepsMeasure => $composableBuilder(
|
|
column: $table.hasRepsMeasure,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get hasScoreMeasure => $composableBuilder(
|
|
column: $table.hasScoreMeasure,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreInputMode => $composableBuilder(
|
|
column: $table.scoreInputMode,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreLabel => $composableBuilder(
|
|
column: $table.scoreLabel,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreUnit => $composableBuilder(
|
|
column: $table.scoreUnit,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get archivedAt => $composableBuilder(
|
|
column: $table.archivedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$MediaAssetsTableOrderingComposer get imageMediaId {
|
|
final $$MediaAssetsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.imageMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableOrderingComposer get videoMediaId {
|
|
final $$MediaAssetsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.videoMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ExercisesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get hasTimeMeasure => $composableBuilder(
|
|
column: $table.hasTimeMeasure,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get hasRepsMeasure => $composableBuilder(
|
|
column: $table.hasRepsMeasure,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get hasScoreMeasure => $composableBuilder(
|
|
column: $table.hasScoreMeasure,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreInputMode => $composableBuilder(
|
|
column: $table.scoreInputMode,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreLabel => $composableBuilder(
|
|
column: $table.scoreLabel,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreUnit =>
|
|
$composableBuilder(column: $table.scoreUnit, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get archivedAt => $composableBuilder(
|
|
column: $table.archivedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$MediaAssetsTableAnnotationComposer get imageMediaId {
|
|
final $$MediaAssetsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.imageMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableAnnotationComposer get videoMediaId {
|
|
final $$MediaAssetsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.videoMediaId,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> programExercisesRefs<T extends Object>(
|
|
Expression<T> Function($$ProgramExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.sourceExerciseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ExercisesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ExercisesTable,
|
|
Exercise,
|
|
$$ExercisesTableFilterComposer,
|
|
$$ExercisesTableOrderingComposer,
|
|
$$ExercisesTableAnnotationComposer,
|
|
$$ExercisesTableCreateCompanionBuilder,
|
|
$$ExercisesTableUpdateCompanionBuilder,
|
|
(Exercise, $$ExercisesTableReferences),
|
|
Exercise,
|
|
PrefetchHooks Function({
|
|
bool imageMediaId,
|
|
bool videoMediaId,
|
|
bool programExercisesRefs,
|
|
})
|
|
> {
|
|
$$ExercisesTableTableManager(_$AppDatabase db, $ExercisesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ExercisesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ExercisesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ExercisesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> imageMediaId = const Value.absent(),
|
|
Value<String?> videoMediaId = const Value.absent(),
|
|
Value<bool> hasTimeMeasure = const Value.absent(),
|
|
Value<bool> hasRepsMeasure = const Value.absent(),
|
|
Value<bool> hasScoreMeasure = const Value.absent(),
|
|
Value<String> scoreInputMode = const Value.absent(),
|
|
Value<String?> scoreLabel = const Value.absent(),
|
|
Value<String?> scoreUnit = const Value.absent(),
|
|
Value<DateTime?> archivedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExercisesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
description: description,
|
|
imageMediaId: imageMediaId,
|
|
videoMediaId: videoMediaId,
|
|
hasTimeMeasure: hasTimeMeasure,
|
|
hasRepsMeasure: hasRepsMeasure,
|
|
hasScoreMeasure: hasScoreMeasure,
|
|
scoreInputMode: scoreInputMode,
|
|
scoreLabel: scoreLabel,
|
|
scoreUnit: scoreUnit,
|
|
archivedAt: archivedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String name,
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> imageMediaId = const Value.absent(),
|
|
Value<String?> videoMediaId = const Value.absent(),
|
|
required bool hasTimeMeasure,
|
|
required bool hasRepsMeasure,
|
|
required bool hasScoreMeasure,
|
|
Value<String> scoreInputMode = const Value.absent(),
|
|
Value<String?> scoreLabel = const Value.absent(),
|
|
Value<String?> scoreUnit = const Value.absent(),
|
|
Value<DateTime?> archivedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExercisesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
description: description,
|
|
imageMediaId: imageMediaId,
|
|
videoMediaId: videoMediaId,
|
|
hasTimeMeasure: hasTimeMeasure,
|
|
hasRepsMeasure: hasRepsMeasure,
|
|
hasScoreMeasure: hasScoreMeasure,
|
|
scoreInputMode: scoreInputMode,
|
|
scoreLabel: scoreLabel,
|
|
scoreUnit: scoreUnit,
|
|
archivedAt: archivedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ExercisesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
imageMediaId = false,
|
|
videoMediaId = false,
|
|
programExercisesRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (programExercisesRefs) db.programExercises,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (imageMediaId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.imageMediaId,
|
|
referencedTable: $$ExercisesTableReferences
|
|
._imageMediaIdTable(db),
|
|
referencedColumn: $$ExercisesTableReferences
|
|
._imageMediaIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (videoMediaId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.videoMediaId,
|
|
referencedTable: $$ExercisesTableReferences
|
|
._videoMediaIdTable(db),
|
|
referencedColumn: $$ExercisesTableReferences
|
|
._videoMediaIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (programExercisesRefs)
|
|
await $_getPrefetchedData<
|
|
Exercise,
|
|
$ExercisesTable,
|
|
ProgramExercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ExercisesTableReferences
|
|
._programExercisesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ExercisesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programExercisesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.sourceExerciseId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ExercisesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ExercisesTable,
|
|
Exercise,
|
|
$$ExercisesTableFilterComposer,
|
|
$$ExercisesTableOrderingComposer,
|
|
$$ExercisesTableAnnotationComposer,
|
|
$$ExercisesTableCreateCompanionBuilder,
|
|
$$ExercisesTableUpdateCompanionBuilder,
|
|
(Exercise, $$ExercisesTableReferences),
|
|
Exercise,
|
|
PrefetchHooks Function({
|
|
bool imageMediaId,
|
|
bool videoMediaId,
|
|
bool programExercisesRefs,
|
|
})
|
|
>;
|
|
typedef $$ProgramsTableCreateCompanionBuilder =
|
|
ProgramsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String name,
|
|
required int defaultRestSeconds,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProgramsTableUpdateCompanionBuilder =
|
|
ProgramsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> name,
|
|
Value<int> defaultRestSeconds,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProgramsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ProgramsTable, Program> {
|
|
$$ProgramsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$ProgramExercisesTable, List<ProgramExercise>>
|
|
_programExercisesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.programExercises,
|
|
aliasName: 'programs__id__program_exercises__program_id',
|
|
);
|
|
|
|
$$ProgramExercisesTableProcessedTableManager get programExercisesRefs {
|
|
final manager = $$ProgramExercisesTableTableManager(
|
|
$_db,
|
|
$_db.programExercises,
|
|
).filter((f) => f.programId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programExercisesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<
|
|
$WorkoutTemplateProgramsTable,
|
|
List<WorkoutTemplateProgram>
|
|
>
|
|
_workoutTemplateProgramsRefsTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.workoutTemplatePrograms,
|
|
aliasName: 'programs__id__workout_template_programs__source_program_id',
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableProcessedTableManager
|
|
get workoutTemplateProgramsRefs {
|
|
final manager =
|
|
$$WorkoutTemplateProgramsTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplatePrograms,
|
|
).filter(
|
|
(f) => f.sourceProgramId.id.sqlEquals($_itemColumn<String>('id')!),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutTemplateProgramsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get defaultRestSeconds => $composableBuilder(
|
|
column: $table.defaultRestSeconds,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> programExercisesRefs(
|
|
Expression<bool> Function($$ProgramExercisesTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> workoutTemplateProgramsRefs(
|
|
Expression<bool> Function($$WorkoutTemplateProgramsTableFilterComposer f) f,
|
|
) {
|
|
final $$WorkoutTemplateProgramsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.sourceProgramId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get defaultRestSeconds => $composableBuilder(
|
|
column: $table.defaultRestSeconds,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ProgramsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get defaultRestSeconds => $composableBuilder(
|
|
column: $table.defaultRestSeconds,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
Expression<T> programExercisesRefs<T extends Object>(
|
|
Expression<T> Function($$ProgramExercisesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programExercises,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programExercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> workoutTemplateProgramsRefs<T extends Object>(
|
|
Expression<T> Function($$WorkoutTemplateProgramsTableAnnotationComposer a)
|
|
f,
|
|
) {
|
|
final $$WorkoutTemplateProgramsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.sourceProgramId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProgramsTable,
|
|
Program,
|
|
$$ProgramsTableFilterComposer,
|
|
$$ProgramsTableOrderingComposer,
|
|
$$ProgramsTableAnnotationComposer,
|
|
$$ProgramsTableCreateCompanionBuilder,
|
|
$$ProgramsTableUpdateCompanionBuilder,
|
|
(Program, $$ProgramsTableReferences),
|
|
Program,
|
|
PrefetchHooks Function({
|
|
bool programExercisesRefs,
|
|
bool workoutTemplateProgramsRefs,
|
|
})
|
|
> {
|
|
$$ProgramsTableTableManager(_$AppDatabase db, $ProgramsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProgramsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProgramsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProgramsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<int> defaultRestSeconds = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
defaultRestSeconds: defaultRestSeconds,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String name,
|
|
required int defaultRestSeconds,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
name: name,
|
|
defaultRestSeconds: defaultRestSeconds,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProgramsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
programExercisesRefs = false,
|
|
workoutTemplateProgramsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (programExercisesRefs) db.programExercises,
|
|
if (workoutTemplateProgramsRefs) db.workoutTemplatePrograms,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (programExercisesRefs)
|
|
await $_getPrefetchedData<
|
|
Program,
|
|
$ProgramsTable,
|
|
ProgramExercise
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProgramsTableReferences
|
|
._programExercisesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProgramsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programExercisesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.programId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (workoutTemplateProgramsRefs)
|
|
await $_getPrefetchedData<
|
|
Program,
|
|
$ProgramsTable,
|
|
WorkoutTemplateProgram
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProgramsTableReferences
|
|
._workoutTemplateProgramsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProgramsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutTemplateProgramsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.sourceProgramId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProgramsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProgramsTable,
|
|
Program,
|
|
$$ProgramsTableFilterComposer,
|
|
$$ProgramsTableOrderingComposer,
|
|
$$ProgramsTableAnnotationComposer,
|
|
$$ProgramsTableCreateCompanionBuilder,
|
|
$$ProgramsTableUpdateCompanionBuilder,
|
|
(Program, $$ProgramsTableReferences),
|
|
Program,
|
|
PrefetchHooks Function({
|
|
bool programExercisesRefs,
|
|
bool workoutTemplateProgramsRefs,
|
|
})
|
|
>;
|
|
typedef $$ProgramExercisesTableCreateCompanionBuilder =
|
|
ProgramExercisesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String programId,
|
|
Value<String?> sourceExerciseId,
|
|
required int position,
|
|
required String exerciseNameSnapshot,
|
|
Value<String?> exerciseDescriptionSnapshot,
|
|
Value<String?> exerciseImageMediaIdSnapshot,
|
|
Value<String?> exerciseVideoMediaIdSnapshot,
|
|
Value<bool> exerciseArchivedSnapshot,
|
|
required bool availableTimeSnapshot,
|
|
required bool availableRepsSnapshot,
|
|
required bool availableScoreSnapshot,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
required int setsCount,
|
|
required bool timeEnabled,
|
|
required bool repsEnabled,
|
|
required bool scoreEnabled,
|
|
Value<int?> targetTimeSeconds,
|
|
Value<int?> targetReps,
|
|
Value<double?> targetScore,
|
|
Value<int?> targetScoreTimeMs,
|
|
Value<int?> restSecondsOverride,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProgramExercisesTableUpdateCompanionBuilder =
|
|
ProgramExercisesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> programId,
|
|
Value<String?> sourceExerciseId,
|
|
Value<int> position,
|
|
Value<String> exerciseNameSnapshot,
|
|
Value<String?> exerciseDescriptionSnapshot,
|
|
Value<String?> exerciseImageMediaIdSnapshot,
|
|
Value<String?> exerciseVideoMediaIdSnapshot,
|
|
Value<bool> exerciseArchivedSnapshot,
|
|
Value<bool> availableTimeSnapshot,
|
|
Value<bool> availableRepsSnapshot,
|
|
Value<bool> availableScoreSnapshot,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
Value<int> setsCount,
|
|
Value<bool> timeEnabled,
|
|
Value<bool> repsEnabled,
|
|
Value<bool> scoreEnabled,
|
|
Value<int?> targetTimeSeconds,
|
|
Value<int?> targetReps,
|
|
Value<double?> targetScore,
|
|
Value<int?> targetScoreTimeMs,
|
|
Value<int?> restSecondsOverride,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProgramExercisesTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $ProgramExercisesTable, ProgramExercise> {
|
|
$$ProgramExercisesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $ProgramsTable _programIdTable(_$AppDatabase db) =>
|
|
db.programs.createAlias('program_exercises__program_id__programs__id');
|
|
|
|
$$ProgramsTableProcessedTableManager get programId {
|
|
final $_column = $_itemColumn<String>('program_id')!;
|
|
|
|
final manager = $$ProgramsTableTableManager(
|
|
$_db,
|
|
$_db.programs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_programIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $ExercisesTable _sourceExerciseIdTable(_$AppDatabase db) => db
|
|
.exercises
|
|
.createAlias('program_exercises__source_exercise_id__exercises__id');
|
|
|
|
$$ExercisesTableProcessedTableManager? get sourceExerciseId {
|
|
final $_column = $_itemColumn<String>('source_exercise_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$ExercisesTableTableManager(
|
|
$_db,
|
|
$_db.exercises,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_sourceExerciseIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $MediaAssetsTable _exerciseImageMediaIdSnapshotTable(
|
|
_$AppDatabase db,
|
|
) => db.mediaAssets.createAlias(
|
|
'program_exercises__exercise_image_media_id_snapshot__media_assets__id',
|
|
);
|
|
|
|
$$MediaAssetsTableProcessedTableManager? get exerciseImageMediaIdSnapshot {
|
|
final $_column = $_itemColumn<String>('exercise_image_media_id_snapshot');
|
|
if ($_column == null) return null;
|
|
final manager = $$MediaAssetsTableTableManager(
|
|
$_db,
|
|
$_db.mediaAssets,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_exerciseImageMediaIdSnapshotTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $MediaAssetsTable _exerciseVideoMediaIdSnapshotTable(
|
|
_$AppDatabase db,
|
|
) => db.mediaAssets.createAlias(
|
|
'program_exercises__exercise_video_media_id_snapshot__media_assets__id',
|
|
);
|
|
|
|
$$MediaAssetsTableProcessedTableManager? get exerciseVideoMediaIdSnapshot {
|
|
final $_column = $_itemColumn<String>('exercise_video_media_id_snapshot');
|
|
if ($_column == null) return null;
|
|
final manager = $$MediaAssetsTableTableManager(
|
|
$_db,
|
|
$_db.mediaAssets,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_exerciseVideoMediaIdSnapshotTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProgramExercisesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProgramExercisesTable> {
|
|
$$ProgramExercisesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get exerciseDescriptionSnapshot => $composableBuilder(
|
|
column: $table.exerciseDescriptionSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get exerciseArchivedSnapshot => $composableBuilder(
|
|
column: $table.exerciseArchivedSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get availableTimeSnapshot => $composableBuilder(
|
|
column: $table.availableTimeSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get availableRepsSnapshot => $composableBuilder(
|
|
column: $table.availableRepsSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get availableScoreSnapshot => $composableBuilder(
|
|
column: $table.availableScoreSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get setsCount => $composableBuilder(
|
|
column: $table.setsCount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get timeEnabled => $composableBuilder(
|
|
column: $table.timeEnabled,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get repsEnabled => $composableBuilder(
|
|
column: $table.repsEnabled,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get scoreEnabled => $composableBuilder(
|
|
column: $table.scoreEnabled,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetTimeSeconds => $composableBuilder(
|
|
column: $table.targetTimeSeconds,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetReps => $composableBuilder(
|
|
column: $table.targetReps,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get targetScore => $composableBuilder(
|
|
column: $table.targetScore,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetScoreTimeMs => $composableBuilder(
|
|
column: $table.targetScoreTimeMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get restSecondsOverride => $composableBuilder(
|
|
column: $table.restSecondsOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ProgramsTableFilterComposer get programId {
|
|
final $$ProgramsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ExercisesTableFilterComposer get sourceExerciseId {
|
|
final $$ExercisesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceExerciseId,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableFilterComposer get exerciseImageMediaIdSnapshot {
|
|
final $$MediaAssetsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseImageMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableFilterComposer get exerciseVideoMediaIdSnapshot {
|
|
final $$MediaAssetsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseVideoMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramExercisesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProgramExercisesTable> {
|
|
$$ProgramExercisesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get exerciseDescriptionSnapshot => $composableBuilder(
|
|
column: $table.exerciseDescriptionSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get exerciseArchivedSnapshot => $composableBuilder(
|
|
column: $table.exerciseArchivedSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get availableTimeSnapshot => $composableBuilder(
|
|
column: $table.availableTimeSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get availableRepsSnapshot => $composableBuilder(
|
|
column: $table.availableRepsSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get availableScoreSnapshot => $composableBuilder(
|
|
column: $table.availableScoreSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get setsCount => $composableBuilder(
|
|
column: $table.setsCount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get timeEnabled => $composableBuilder(
|
|
column: $table.timeEnabled,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get repsEnabled => $composableBuilder(
|
|
column: $table.repsEnabled,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get scoreEnabled => $composableBuilder(
|
|
column: $table.scoreEnabled,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetTimeSeconds => $composableBuilder(
|
|
column: $table.targetTimeSeconds,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetReps => $composableBuilder(
|
|
column: $table.targetReps,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get targetScore => $composableBuilder(
|
|
column: $table.targetScore,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetScoreTimeMs => $composableBuilder(
|
|
column: $table.targetScoreTimeMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get restSecondsOverride => $composableBuilder(
|
|
column: $table.restSecondsOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ProgramsTableOrderingComposer get programId {
|
|
final $$ProgramsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ExercisesTableOrderingComposer get sourceExerciseId {
|
|
final $$ExercisesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceExerciseId,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableOrderingComposer get exerciseImageMediaIdSnapshot {
|
|
final $$MediaAssetsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseImageMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableOrderingComposer get exerciseVideoMediaIdSnapshot {
|
|
final $$MediaAssetsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseVideoMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramExercisesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProgramExercisesTable> {
|
|
$$ProgramExercisesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get position =>
|
|
$composableBuilder(column: $table.position, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get exerciseDescriptionSnapshot => $composableBuilder(
|
|
column: $table.exerciseDescriptionSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get exerciseArchivedSnapshot => $composableBuilder(
|
|
column: $table.exerciseArchivedSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get availableTimeSnapshot => $composableBuilder(
|
|
column: $table.availableTimeSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get availableRepsSnapshot => $composableBuilder(
|
|
column: $table.availableRepsSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get availableScoreSnapshot => $composableBuilder(
|
|
column: $table.availableScoreSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get setsCount =>
|
|
$composableBuilder(column: $table.setsCount, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get timeEnabled => $composableBuilder(
|
|
column: $table.timeEnabled,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get repsEnabled => $composableBuilder(
|
|
column: $table.repsEnabled,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get scoreEnabled => $composableBuilder(
|
|
column: $table.scoreEnabled,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetTimeSeconds => $composableBuilder(
|
|
column: $table.targetTimeSeconds,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetReps => $composableBuilder(
|
|
column: $table.targetReps,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get targetScore => $composableBuilder(
|
|
column: $table.targetScore,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetScoreTimeMs => $composableBuilder(
|
|
column: $table.targetScoreTimeMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get restSecondsOverride => $composableBuilder(
|
|
column: $table.restSecondsOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$ProgramsTableAnnotationComposer get programId {
|
|
final $$ProgramsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ExercisesTableAnnotationComposer get sourceExerciseId {
|
|
final $$ExercisesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceExerciseId,
|
|
referencedTable: $db.exercises,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ExercisesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.exercises,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableAnnotationComposer get exerciseImageMediaIdSnapshot {
|
|
final $$MediaAssetsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseImageMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$MediaAssetsTableAnnotationComposer get exerciseVideoMediaIdSnapshot {
|
|
final $$MediaAssetsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.exerciseVideoMediaIdSnapshot,
|
|
referencedTable: $db.mediaAssets,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$MediaAssetsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.mediaAssets,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramExercisesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProgramExercisesTable,
|
|
ProgramExercise,
|
|
$$ProgramExercisesTableFilterComposer,
|
|
$$ProgramExercisesTableOrderingComposer,
|
|
$$ProgramExercisesTableAnnotationComposer,
|
|
$$ProgramExercisesTableCreateCompanionBuilder,
|
|
$$ProgramExercisesTableUpdateCompanionBuilder,
|
|
(ProgramExercise, $$ProgramExercisesTableReferences),
|
|
ProgramExercise,
|
|
PrefetchHooks Function({
|
|
bool programId,
|
|
bool sourceExerciseId,
|
|
bool exerciseImageMediaIdSnapshot,
|
|
bool exerciseVideoMediaIdSnapshot,
|
|
})
|
|
> {
|
|
$$ProgramExercisesTableTableManager(
|
|
_$AppDatabase db,
|
|
$ProgramExercisesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProgramExercisesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProgramExercisesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProgramExercisesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> programId = const Value.absent(),
|
|
Value<String?> sourceExerciseId = const Value.absent(),
|
|
Value<int> position = const Value.absent(),
|
|
Value<String> exerciseNameSnapshot = const Value.absent(),
|
|
Value<String?> exerciseDescriptionSnapshot =
|
|
const Value.absent(),
|
|
Value<String?> exerciseImageMediaIdSnapshot =
|
|
const Value.absent(),
|
|
Value<String?> exerciseVideoMediaIdSnapshot =
|
|
const Value.absent(),
|
|
Value<bool> exerciseArchivedSnapshot = const Value.absent(),
|
|
Value<bool> availableTimeSnapshot = const Value.absent(),
|
|
Value<bool> availableRepsSnapshot = const Value.absent(),
|
|
Value<bool> availableScoreSnapshot = const Value.absent(),
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<int> setsCount = const Value.absent(),
|
|
Value<bool> timeEnabled = const Value.absent(),
|
|
Value<bool> repsEnabled = const Value.absent(),
|
|
Value<bool> scoreEnabled = const Value.absent(),
|
|
Value<int?> targetTimeSeconds = const Value.absent(),
|
|
Value<int?> targetReps = const Value.absent(),
|
|
Value<double?> targetScore = const Value.absent(),
|
|
Value<int?> targetScoreTimeMs = const Value.absent(),
|
|
Value<int?> restSecondsOverride = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramExercisesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
programId: programId,
|
|
sourceExerciseId: sourceExerciseId,
|
|
position: position,
|
|
exerciseNameSnapshot: exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot: exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot: exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot: exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot: exerciseArchivedSnapshot,
|
|
availableTimeSnapshot: availableTimeSnapshot,
|
|
availableRepsSnapshot: availableRepsSnapshot,
|
|
availableScoreSnapshot: availableScoreSnapshot,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
setsCount: setsCount,
|
|
timeEnabled: timeEnabled,
|
|
repsEnabled: repsEnabled,
|
|
scoreEnabled: scoreEnabled,
|
|
targetTimeSeconds: targetTimeSeconds,
|
|
targetReps: targetReps,
|
|
targetScore: targetScore,
|
|
targetScoreTimeMs: targetScoreTimeMs,
|
|
restSecondsOverride: restSecondsOverride,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String programId,
|
|
Value<String?> sourceExerciseId = const Value.absent(),
|
|
required int position,
|
|
required String exerciseNameSnapshot,
|
|
Value<String?> exerciseDescriptionSnapshot =
|
|
const Value.absent(),
|
|
Value<String?> exerciseImageMediaIdSnapshot =
|
|
const Value.absent(),
|
|
Value<String?> exerciseVideoMediaIdSnapshot =
|
|
const Value.absent(),
|
|
Value<bool> exerciseArchivedSnapshot = const Value.absent(),
|
|
required bool availableTimeSnapshot,
|
|
required bool availableRepsSnapshot,
|
|
required bool availableScoreSnapshot,
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
required int setsCount,
|
|
required bool timeEnabled,
|
|
required bool repsEnabled,
|
|
required bool scoreEnabled,
|
|
Value<int?> targetTimeSeconds = const Value.absent(),
|
|
Value<int?> targetReps = const Value.absent(),
|
|
Value<double?> targetScore = const Value.absent(),
|
|
Value<int?> targetScoreTimeMs = const Value.absent(),
|
|
Value<int?> restSecondsOverride = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramExercisesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
programId: programId,
|
|
sourceExerciseId: sourceExerciseId,
|
|
position: position,
|
|
exerciseNameSnapshot: exerciseNameSnapshot,
|
|
exerciseDescriptionSnapshot: exerciseDescriptionSnapshot,
|
|
exerciseImageMediaIdSnapshot: exerciseImageMediaIdSnapshot,
|
|
exerciseVideoMediaIdSnapshot: exerciseVideoMediaIdSnapshot,
|
|
exerciseArchivedSnapshot: exerciseArchivedSnapshot,
|
|
availableTimeSnapshot: availableTimeSnapshot,
|
|
availableRepsSnapshot: availableRepsSnapshot,
|
|
availableScoreSnapshot: availableScoreSnapshot,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
setsCount: setsCount,
|
|
timeEnabled: timeEnabled,
|
|
repsEnabled: repsEnabled,
|
|
scoreEnabled: scoreEnabled,
|
|
targetTimeSeconds: targetTimeSeconds,
|
|
targetReps: targetReps,
|
|
targetScore: targetScore,
|
|
targetScoreTimeMs: targetScoreTimeMs,
|
|
restSecondsOverride: restSecondsOverride,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProgramExercisesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
programId = false,
|
|
sourceExerciseId = false,
|
|
exerciseImageMediaIdSnapshot = false,
|
|
exerciseVideoMediaIdSnapshot = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (programId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.programId,
|
|
referencedTable:
|
|
$$ProgramExercisesTableReferences
|
|
._programIdTable(db),
|
|
referencedColumn:
|
|
$$ProgramExercisesTableReferences
|
|
._programIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (sourceExerciseId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.sourceExerciseId,
|
|
referencedTable:
|
|
$$ProgramExercisesTableReferences
|
|
._sourceExerciseIdTable(db),
|
|
referencedColumn:
|
|
$$ProgramExercisesTableReferences
|
|
._sourceExerciseIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (exerciseImageMediaIdSnapshot) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn:
|
|
table.exerciseImageMediaIdSnapshot,
|
|
referencedTable:
|
|
$$ProgramExercisesTableReferences
|
|
._exerciseImageMediaIdSnapshotTable(
|
|
db,
|
|
),
|
|
referencedColumn:
|
|
$$ProgramExercisesTableReferences
|
|
._exerciseImageMediaIdSnapshotTable(
|
|
db,
|
|
)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (exerciseVideoMediaIdSnapshot) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn:
|
|
table.exerciseVideoMediaIdSnapshot,
|
|
referencedTable:
|
|
$$ProgramExercisesTableReferences
|
|
._exerciseVideoMediaIdSnapshotTable(
|
|
db,
|
|
),
|
|
referencedColumn:
|
|
$$ProgramExercisesTableReferences
|
|
._exerciseVideoMediaIdSnapshotTable(
|
|
db,
|
|
)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProgramExercisesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProgramExercisesTable,
|
|
ProgramExercise,
|
|
$$ProgramExercisesTableFilterComposer,
|
|
$$ProgramExercisesTableOrderingComposer,
|
|
$$ProgramExercisesTableAnnotationComposer,
|
|
$$ProgramExercisesTableCreateCompanionBuilder,
|
|
$$ProgramExercisesTableUpdateCompanionBuilder,
|
|
(ProgramExercise, $$ProgramExercisesTableReferences),
|
|
ProgramExercise,
|
|
PrefetchHooks Function({
|
|
bool programId,
|
|
bool sourceExerciseId,
|
|
bool exerciseImageMediaIdSnapshot,
|
|
bool exerciseVideoMediaIdSnapshot,
|
|
})
|
|
>;
|
|
typedef $$WorkoutHistoriesTableCreateCompanionBuilder =
|
|
WorkoutHistoriesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String?> sourceWorkoutTemplateId,
|
|
Value<String?> sourceActiveWorkoutSessionId,
|
|
required String nameSnapshot,
|
|
required DateTime startedAt,
|
|
required DateTime endedAt,
|
|
required int totalActiveMs,
|
|
required bool completed,
|
|
required String historySnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$WorkoutHistoriesTableUpdateCompanionBuilder =
|
|
WorkoutHistoriesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String?> sourceWorkoutTemplateId,
|
|
Value<String?> sourceActiveWorkoutSessionId,
|
|
Value<String> nameSnapshot,
|
|
Value<DateTime> startedAt,
|
|
Value<DateTime> endedAt,
|
|
Value<int> totalActiveMs,
|
|
Value<bool> completed,
|
|
Value<String> historySnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$WorkoutHistoriesTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $WorkoutHistoriesTable, WorkoutHistory> {
|
|
$$WorkoutHistoriesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $WorkoutTemplatesTable _sourceWorkoutTemplateIdTable(
|
|
_$AppDatabase db,
|
|
) => db.workoutTemplates.createAlias(
|
|
'workout_history__source_workout_template_id__workout_templates__id',
|
|
);
|
|
|
|
$$WorkoutTemplatesTableProcessedTableManager? get sourceWorkoutTemplateId {
|
|
final $_column = $_itemColumn<String>('source_workout_template_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$WorkoutTemplatesTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplates,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_sourceWorkoutTemplateIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $ActiveWorkoutSessionsTable _sourceActiveWorkoutSessionIdTable(
|
|
_$AppDatabase db,
|
|
) => db.activeWorkoutSessions.createAlias(
|
|
'workout_history__source_active_workout_session_id__active_workout_sessions__id',
|
|
);
|
|
|
|
$$ActiveWorkoutSessionsTableProcessedTableManager?
|
|
get sourceActiveWorkoutSessionId {
|
|
final $_column = $_itemColumn<String>('source_active_workout_session_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$ActiveWorkoutSessionsTableTableManager(
|
|
$_db,
|
|
$_db.activeWorkoutSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_sourceActiveWorkoutSessionIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<
|
|
$WorkoutHistorySetResultsTable,
|
|
List<WorkoutHistorySetResult>
|
|
>
|
|
_workoutHistorySetResultsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.workoutHistorySetResults,
|
|
aliasName:
|
|
'workout_history__id__workout_history_set_results__workout_history_id',
|
|
);
|
|
|
|
$$WorkoutHistorySetResultsTableProcessedTableManager
|
|
get workoutHistorySetResultsRefs {
|
|
final manager =
|
|
$$WorkoutHistorySetResultsTableTableManager(
|
|
$_db,
|
|
$_db.workoutHistorySetResults,
|
|
).filter(
|
|
(f) => f.workoutHistoryId.id.sqlEquals($_itemColumn<String>('id')!),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutHistorySetResultsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistoriesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistoriesTable> {
|
|
$$WorkoutHistoriesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get nameSnapshot => $composableBuilder(
|
|
column: $table.nameSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get totalActiveMs => $composableBuilder(
|
|
column: $table.totalActiveMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get completed => $composableBuilder(
|
|
column: $table.completed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get historySnapshotJson => $composableBuilder(
|
|
column: $table.historySnapshotJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableFilterComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ActiveWorkoutSessionsTableFilterComposer get sourceActiveWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceActiveWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> workoutHistorySetResultsRefs(
|
|
Expression<bool> Function($$WorkoutHistorySetResultsTableFilterComposer f)
|
|
f,
|
|
) {
|
|
final $$WorkoutHistorySetResultsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistorySetResults,
|
|
getReferencedColumn: (t) => t.workoutHistoryId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistorySetResultsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistorySetResults,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistoriesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistoriesTable> {
|
|
$$WorkoutHistoriesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get nameSnapshot => $composableBuilder(
|
|
column: $table.nameSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get totalActiveMs => $composableBuilder(
|
|
column: $table.totalActiveMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get completed => $composableBuilder(
|
|
column: $table.completed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get historySnapshotJson => $composableBuilder(
|
|
column: $table.historySnapshotJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableOrderingComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ActiveWorkoutSessionsTableOrderingComposer
|
|
get sourceActiveWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableOrderingComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceActiveWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistoriesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistoriesTable> {
|
|
$$WorkoutHistoriesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get nameSnapshot => $composableBuilder(
|
|
column: $table.nameSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get endedAt =>
|
|
$composableBuilder(column: $table.endedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get totalActiveMs => $composableBuilder(
|
|
column: $table.totalActiveMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get completed =>
|
|
$composableBuilder(column: $table.completed, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get historySnapshotJson => $composableBuilder(
|
|
column: $table.historySnapshotJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$WorkoutTemplatesTableAnnotationComposer get sourceWorkoutTemplateId {
|
|
final $$WorkoutTemplatesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceWorkoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ActiveWorkoutSessionsTableAnnotationComposer
|
|
get sourceActiveWorkoutSessionId {
|
|
final $$ActiveWorkoutSessionsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceActiveWorkoutSessionId,
|
|
referencedTable: $db.activeWorkoutSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ActiveWorkoutSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.activeWorkoutSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> workoutHistorySetResultsRefs<T extends Object>(
|
|
Expression<T> Function($$WorkoutHistorySetResultsTableAnnotationComposer a)
|
|
f,
|
|
) {
|
|
final $$WorkoutHistorySetResultsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutHistorySetResults,
|
|
getReferencedColumn: (t) => t.workoutHistoryId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistorySetResultsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistorySetResults,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistoriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutHistoriesTable,
|
|
WorkoutHistory,
|
|
$$WorkoutHistoriesTableFilterComposer,
|
|
$$WorkoutHistoriesTableOrderingComposer,
|
|
$$WorkoutHistoriesTableAnnotationComposer,
|
|
$$WorkoutHistoriesTableCreateCompanionBuilder,
|
|
$$WorkoutHistoriesTableUpdateCompanionBuilder,
|
|
(WorkoutHistory, $$WorkoutHistoriesTableReferences),
|
|
WorkoutHistory,
|
|
PrefetchHooks Function({
|
|
bool sourceWorkoutTemplateId,
|
|
bool sourceActiveWorkoutSessionId,
|
|
bool workoutHistorySetResultsRefs,
|
|
})
|
|
> {
|
|
$$WorkoutHistoriesTableTableManager(
|
|
_$AppDatabase db,
|
|
$WorkoutHistoriesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$WorkoutHistoriesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$WorkoutHistoriesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$WorkoutHistoriesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
Value<String?> sourceActiveWorkoutSessionId =
|
|
const Value.absent(),
|
|
Value<String> nameSnapshot = const Value.absent(),
|
|
Value<DateTime> startedAt = const Value.absent(),
|
|
Value<DateTime> endedAt = const Value.absent(),
|
|
Value<int> totalActiveMs = const Value.absent(),
|
|
Value<bool> completed = const Value.absent(),
|
|
Value<String> historySnapshotJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutHistoriesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId: sourceActiveWorkoutSessionId,
|
|
nameSnapshot: nameSnapshot,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
totalActiveMs: totalActiveMs,
|
|
completed: completed,
|
|
historySnapshotJson: historySnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String?> sourceWorkoutTemplateId = const Value.absent(),
|
|
Value<String?> sourceActiveWorkoutSessionId =
|
|
const Value.absent(),
|
|
required String nameSnapshot,
|
|
required DateTime startedAt,
|
|
required DateTime endedAt,
|
|
required int totalActiveMs,
|
|
required bool completed,
|
|
required String historySnapshotJson,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutHistoriesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
sourceWorkoutTemplateId: sourceWorkoutTemplateId,
|
|
sourceActiveWorkoutSessionId: sourceActiveWorkoutSessionId,
|
|
nameSnapshot: nameSnapshot,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
totalActiveMs: totalActiveMs,
|
|
completed: completed,
|
|
historySnapshotJson: historySnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$WorkoutHistoriesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
sourceWorkoutTemplateId = false,
|
|
sourceActiveWorkoutSessionId = false,
|
|
workoutHistorySetResultsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (workoutHistorySetResultsRefs)
|
|
db.workoutHistorySetResults,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (sourceWorkoutTemplateId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn:
|
|
table.sourceWorkoutTemplateId,
|
|
referencedTable:
|
|
$$WorkoutHistoriesTableReferences
|
|
._sourceWorkoutTemplateIdTable(db),
|
|
referencedColumn:
|
|
$$WorkoutHistoriesTableReferences
|
|
._sourceWorkoutTemplateIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (sourceActiveWorkoutSessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn:
|
|
table.sourceActiveWorkoutSessionId,
|
|
referencedTable:
|
|
$$WorkoutHistoriesTableReferences
|
|
._sourceActiveWorkoutSessionIdTable(
|
|
db,
|
|
),
|
|
referencedColumn:
|
|
$$WorkoutHistoriesTableReferences
|
|
._sourceActiveWorkoutSessionIdTable(
|
|
db,
|
|
)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (workoutHistorySetResultsRefs)
|
|
await $_getPrefetchedData<
|
|
WorkoutHistory,
|
|
$WorkoutHistoriesTable,
|
|
WorkoutHistorySetResult
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$WorkoutHistoriesTableReferences
|
|
._workoutHistorySetResultsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$WorkoutHistoriesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutHistorySetResultsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.workoutHistoryId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$WorkoutHistoriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutHistoriesTable,
|
|
WorkoutHistory,
|
|
$$WorkoutHistoriesTableFilterComposer,
|
|
$$WorkoutHistoriesTableOrderingComposer,
|
|
$$WorkoutHistoriesTableAnnotationComposer,
|
|
$$WorkoutHistoriesTableCreateCompanionBuilder,
|
|
$$WorkoutHistoriesTableUpdateCompanionBuilder,
|
|
(WorkoutHistory, $$WorkoutHistoriesTableReferences),
|
|
WorkoutHistory,
|
|
PrefetchHooks Function({
|
|
bool sourceWorkoutTemplateId,
|
|
bool sourceActiveWorkoutSessionId,
|
|
bool workoutHistorySetResultsRefs,
|
|
})
|
|
>;
|
|
typedef $$WorkoutHistorySetResultsTableCreateCompanionBuilder =
|
|
WorkoutHistorySetResultsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String workoutHistoryId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String programNameSnapshot,
|
|
required String exerciseNameSnapshot,
|
|
required bool timeEnabledSnapshot,
|
|
required bool repsEnabledSnapshot,
|
|
required bool scoreEnabledSnapshot,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<int?> targetTimeSecondsSnapshot,
|
|
Value<int?> targetRepsSnapshot,
|
|
Value<double?> targetScoreSnapshot,
|
|
Value<int?> targetScoreTimeMsSnapshot,
|
|
Value<int?> actualTimeMs,
|
|
Value<int?> actualReps,
|
|
Value<double?> actualScore,
|
|
Value<int?> actualScoreTimeMs,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
Value<DateTime?> startedAt,
|
|
Value<DateTime?> completedAt,
|
|
Value<String> status,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$WorkoutHistorySetResultsTableUpdateCompanionBuilder =
|
|
WorkoutHistorySetResultsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> workoutHistoryId,
|
|
Value<String> programSnapshotId,
|
|
Value<String> exerciseSnapshotId,
|
|
Value<int> programIndex,
|
|
Value<int> exerciseIndex,
|
|
Value<int> setIndex,
|
|
Value<String> programNameSnapshot,
|
|
Value<String> exerciseNameSnapshot,
|
|
Value<bool> timeEnabledSnapshot,
|
|
Value<bool> repsEnabledSnapshot,
|
|
Value<bool> scoreEnabledSnapshot,
|
|
Value<String> scoreInputModeSnapshot,
|
|
Value<int?> targetTimeSecondsSnapshot,
|
|
Value<int?> targetRepsSnapshot,
|
|
Value<double?> targetScoreSnapshot,
|
|
Value<int?> targetScoreTimeMsSnapshot,
|
|
Value<int?> actualTimeMs,
|
|
Value<int?> actualReps,
|
|
Value<double?> actualScore,
|
|
Value<int?> actualScoreTimeMs,
|
|
Value<String?> scoreLabelSnapshot,
|
|
Value<String?> scoreUnitSnapshot,
|
|
Value<DateTime?> startedAt,
|
|
Value<DateTime?> completedAt,
|
|
Value<String> status,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$WorkoutHistorySetResultsTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$WorkoutHistorySetResultsTable,
|
|
WorkoutHistorySetResult
|
|
> {
|
|
$$WorkoutHistorySetResultsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $WorkoutHistoriesTable _workoutHistoryIdTable(_$AppDatabase db) =>
|
|
db.workoutHistories.createAlias(
|
|
'workout_history_set_results__workout_history_id__workout_history__id',
|
|
);
|
|
|
|
$$WorkoutHistoriesTableProcessedTableManager get workoutHistoryId {
|
|
final $_column = $_itemColumn<String>('workout_history_id')!;
|
|
|
|
final manager = $$WorkoutHistoriesTableTableManager(
|
|
$_db,
|
|
$_db.workoutHistories,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_workoutHistoryIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistorySetResultsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistorySetResultsTable> {
|
|
$$WorkoutHistorySetResultsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get timeEnabledSnapshot => $composableBuilder(
|
|
column: $table.timeEnabledSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get repsEnabledSnapshot => $composableBuilder(
|
|
column: $table.repsEnabledSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get scoreEnabledSnapshot => $composableBuilder(
|
|
column: $table.scoreEnabledSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetTimeSecondsSnapshot => $composableBuilder(
|
|
column: $table.targetTimeSecondsSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetRepsSnapshot => $composableBuilder(
|
|
column: $table.targetRepsSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get targetScoreSnapshot => $composableBuilder(
|
|
column: $table.targetScoreSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetScoreTimeMsSnapshot => $composableBuilder(
|
|
column: $table.targetScoreTimeMsSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$WorkoutHistoriesTableFilterComposer get workoutHistoryId {
|
|
final $$WorkoutHistoriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutHistoryId,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistorySetResultsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistorySetResultsTable> {
|
|
$$WorkoutHistorySetResultsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get setIndex => $composableBuilder(
|
|
column: $table.setIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get timeEnabledSnapshot => $composableBuilder(
|
|
column: $table.timeEnabledSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get repsEnabledSnapshot => $composableBuilder(
|
|
column: $table.repsEnabledSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get scoreEnabledSnapshot => $composableBuilder(
|
|
column: $table.scoreEnabledSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetTimeSecondsSnapshot => $composableBuilder(
|
|
column: $table.targetTimeSecondsSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetRepsSnapshot => $composableBuilder(
|
|
column: $table.targetRepsSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get targetScoreSnapshot => $composableBuilder(
|
|
column: $table.targetScoreSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetScoreTimeMsSnapshot => $composableBuilder(
|
|
column: $table.targetScoreTimeMsSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$WorkoutHistoriesTableOrderingComposer get workoutHistoryId {
|
|
final $$WorkoutHistoriesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutHistoryId,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistorySetResultsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $WorkoutHistorySetResultsTable> {
|
|
$$WorkoutHistorySetResultsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get programSnapshotId => $composableBuilder(
|
|
column: $table.programSnapshotId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get exerciseSnapshotId => $composableBuilder(
|
|
column: $table.exerciseSnapshotId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get programIndex => $composableBuilder(
|
|
column: $table.programIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get exerciseIndex => $composableBuilder(
|
|
column: $table.exerciseIndex,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get setIndex =>
|
|
$composableBuilder(column: $table.setIndex, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get exerciseNameSnapshot => $composableBuilder(
|
|
column: $table.exerciseNameSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get timeEnabledSnapshot => $composableBuilder(
|
|
column: $table.timeEnabledSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get repsEnabledSnapshot => $composableBuilder(
|
|
column: $table.repsEnabledSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get scoreEnabledSnapshot => $composableBuilder(
|
|
column: $table.scoreEnabledSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreInputModeSnapshot => $composableBuilder(
|
|
column: $table.scoreInputModeSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetTimeSecondsSnapshot => $composableBuilder(
|
|
column: $table.targetTimeSecondsSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetRepsSnapshot => $composableBuilder(
|
|
column: $table.targetRepsSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get targetScoreSnapshot => $composableBuilder(
|
|
column: $table.targetScoreSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetScoreTimeMsSnapshot => $composableBuilder(
|
|
column: $table.targetScoreTimeMsSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualTimeMs => $composableBuilder(
|
|
column: $table.actualTimeMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualReps => $composableBuilder(
|
|
column: $table.actualReps,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get actualScore => $composableBuilder(
|
|
column: $table.actualScore,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get actualScoreTimeMs => $composableBuilder(
|
|
column: $table.actualScoreTimeMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreLabelSnapshot => $composableBuilder(
|
|
column: $table.scoreLabelSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scoreUnitSnapshot => $composableBuilder(
|
|
column: $table.scoreUnitSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get completedAt => $composableBuilder(
|
|
column: $table.completedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
$$WorkoutHistoriesTableAnnotationComposer get workoutHistoryId {
|
|
final $$WorkoutHistoriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutHistoryId,
|
|
referencedTable: $db.workoutHistories,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutHistoriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutHistories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutHistorySetResultsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutHistorySetResultsTable,
|
|
WorkoutHistorySetResult,
|
|
$$WorkoutHistorySetResultsTableFilterComposer,
|
|
$$WorkoutHistorySetResultsTableOrderingComposer,
|
|
$$WorkoutHistorySetResultsTableAnnotationComposer,
|
|
$$WorkoutHistorySetResultsTableCreateCompanionBuilder,
|
|
$$WorkoutHistorySetResultsTableUpdateCompanionBuilder,
|
|
(WorkoutHistorySetResult, $$WorkoutHistorySetResultsTableReferences),
|
|
WorkoutHistorySetResult,
|
|
PrefetchHooks Function({bool workoutHistoryId})
|
|
> {
|
|
$$WorkoutHistorySetResultsTableTableManager(
|
|
_$AppDatabase db,
|
|
$WorkoutHistorySetResultsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$WorkoutHistorySetResultsTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$WorkoutHistorySetResultsTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$WorkoutHistorySetResultsTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> workoutHistoryId = const Value.absent(),
|
|
Value<String> programSnapshotId = const Value.absent(),
|
|
Value<String> exerciseSnapshotId = const Value.absent(),
|
|
Value<int> programIndex = const Value.absent(),
|
|
Value<int> exerciseIndex = const Value.absent(),
|
|
Value<int> setIndex = const Value.absent(),
|
|
Value<String> programNameSnapshot = const Value.absent(),
|
|
Value<String> exerciseNameSnapshot = const Value.absent(),
|
|
Value<bool> timeEnabledSnapshot = const Value.absent(),
|
|
Value<bool> repsEnabledSnapshot = const Value.absent(),
|
|
Value<bool> scoreEnabledSnapshot = const Value.absent(),
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<int?> targetTimeSecondsSnapshot = const Value.absent(),
|
|
Value<int?> targetRepsSnapshot = const Value.absent(),
|
|
Value<double?> targetScoreSnapshot = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsSnapshot = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutHistorySetResultsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutHistoryId: workoutHistoryId,
|
|
programSnapshotId: programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
programNameSnapshot: programNameSnapshot,
|
|
exerciseNameSnapshot: exerciseNameSnapshot,
|
|
timeEnabledSnapshot: timeEnabledSnapshot,
|
|
repsEnabledSnapshot: repsEnabledSnapshot,
|
|
scoreEnabledSnapshot: scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot: targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot: targetRepsSnapshot,
|
|
targetScoreSnapshot: targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot: targetScoreTimeMsSnapshot,
|
|
actualTimeMs: actualTimeMs,
|
|
actualReps: actualReps,
|
|
actualScore: actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
startedAt: startedAt,
|
|
completedAt: completedAt,
|
|
status: status,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String workoutHistoryId,
|
|
required String programSnapshotId,
|
|
required String exerciseSnapshotId,
|
|
required int programIndex,
|
|
required int exerciseIndex,
|
|
required int setIndex,
|
|
required String programNameSnapshot,
|
|
required String exerciseNameSnapshot,
|
|
required bool timeEnabledSnapshot,
|
|
required bool repsEnabledSnapshot,
|
|
required bool scoreEnabledSnapshot,
|
|
Value<String> scoreInputModeSnapshot = const Value.absent(),
|
|
Value<int?> targetTimeSecondsSnapshot = const Value.absent(),
|
|
Value<int?> targetRepsSnapshot = const Value.absent(),
|
|
Value<double?> targetScoreSnapshot = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsSnapshot = const Value.absent(),
|
|
Value<int?> actualTimeMs = const Value.absent(),
|
|
Value<int?> actualReps = const Value.absent(),
|
|
Value<double?> actualScore = const Value.absent(),
|
|
Value<int?> actualScoreTimeMs = const Value.absent(),
|
|
Value<String?> scoreLabelSnapshot = const Value.absent(),
|
|
Value<String?> scoreUnitSnapshot = const Value.absent(),
|
|
Value<DateTime?> startedAt = const Value.absent(),
|
|
Value<DateTime?> completedAt = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutHistorySetResultsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutHistoryId: workoutHistoryId,
|
|
programSnapshotId: programSnapshotId,
|
|
exerciseSnapshotId: exerciseSnapshotId,
|
|
programIndex: programIndex,
|
|
exerciseIndex: exerciseIndex,
|
|
setIndex: setIndex,
|
|
programNameSnapshot: programNameSnapshot,
|
|
exerciseNameSnapshot: exerciseNameSnapshot,
|
|
timeEnabledSnapshot: timeEnabledSnapshot,
|
|
repsEnabledSnapshot: repsEnabledSnapshot,
|
|
scoreEnabledSnapshot: scoreEnabledSnapshot,
|
|
scoreInputModeSnapshot: scoreInputModeSnapshot,
|
|
targetTimeSecondsSnapshot: targetTimeSecondsSnapshot,
|
|
targetRepsSnapshot: targetRepsSnapshot,
|
|
targetScoreSnapshot: targetScoreSnapshot,
|
|
targetScoreTimeMsSnapshot: targetScoreTimeMsSnapshot,
|
|
actualTimeMs: actualTimeMs,
|
|
actualReps: actualReps,
|
|
actualScore: actualScore,
|
|
actualScoreTimeMs: actualScoreTimeMs,
|
|
scoreLabelSnapshot: scoreLabelSnapshot,
|
|
scoreUnitSnapshot: scoreUnitSnapshot,
|
|
startedAt: startedAt,
|
|
completedAt: completedAt,
|
|
status: status,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$WorkoutHistorySetResultsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({workoutHistoryId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (workoutHistoryId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.workoutHistoryId,
|
|
referencedTable:
|
|
$$WorkoutHistorySetResultsTableReferences
|
|
._workoutHistoryIdTable(db),
|
|
referencedColumn:
|
|
$$WorkoutHistorySetResultsTableReferences
|
|
._workoutHistoryIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$WorkoutHistorySetResultsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutHistorySetResultsTable,
|
|
WorkoutHistorySetResult,
|
|
$$WorkoutHistorySetResultsTableFilterComposer,
|
|
$$WorkoutHistorySetResultsTableOrderingComposer,
|
|
$$WorkoutHistorySetResultsTableAnnotationComposer,
|
|
$$WorkoutHistorySetResultsTableCreateCompanionBuilder,
|
|
$$WorkoutHistorySetResultsTableUpdateCompanionBuilder,
|
|
(WorkoutHistorySetResult, $$WorkoutHistorySetResultsTableReferences),
|
|
WorkoutHistorySetResult,
|
|
PrefetchHooks Function({bool workoutHistoryId})
|
|
>;
|
|
typedef $$WorkoutTemplateProgramsTableCreateCompanionBuilder =
|
|
WorkoutTemplateProgramsCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String workoutTemplateId,
|
|
Value<String?> sourceProgramId,
|
|
required int position,
|
|
required String programNameSnapshot,
|
|
required int defaultRestSecondsSnapshot,
|
|
required String programSnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$WorkoutTemplateProgramsTableUpdateCompanionBuilder =
|
|
WorkoutTemplateProgramsCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> workoutTemplateId,
|
|
Value<String?> sourceProgramId,
|
|
Value<int> position,
|
|
Value<String> programNameSnapshot,
|
|
Value<int> defaultRestSecondsSnapshot,
|
|
Value<String> programSnapshotJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$WorkoutTemplateProgramsTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateProgramsTable,
|
|
WorkoutTemplateProgram
|
|
> {
|
|
$$WorkoutTemplateProgramsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $WorkoutTemplatesTable _workoutTemplateIdTable(_$AppDatabase db) =>
|
|
db.workoutTemplates.createAlias(
|
|
'workout_template_programs__workout_template_id__workout_templates__id',
|
|
);
|
|
|
|
$$WorkoutTemplatesTableProcessedTableManager get workoutTemplateId {
|
|
final $_column = $_itemColumn<String>('workout_template_id')!;
|
|
|
|
final manager = $$WorkoutTemplatesTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplates,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_workoutTemplateIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $ProgramsTable _sourceProgramIdTable(_$AppDatabase db) =>
|
|
db.programs.createAlias(
|
|
'workout_template_programs__source_program_id__programs__id',
|
|
);
|
|
|
|
$$ProgramsTableProcessedTableManager? get sourceProgramId {
|
|
final $_column = $_itemColumn<String>('source_program_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$ProgramsTableTableManager(
|
|
$_db,
|
|
$_db.programs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_sourceProgramIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<
|
|
$WorkoutTemplateExerciseOverridesTable,
|
|
List<WorkoutTemplateExerciseOverride>
|
|
>
|
|
_workoutTemplateExerciseOverridesRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.workoutTemplateExerciseOverrides,
|
|
aliasName:
|
|
'workout_template_programs__id__workout_template_exercise_overrides__workout_template_program_id',
|
|
);
|
|
|
|
$$WorkoutTemplateExerciseOverridesTableProcessedTableManager
|
|
get workoutTemplateExerciseOverridesRefs {
|
|
final manager =
|
|
$$WorkoutTemplateExerciseOverridesTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplateExerciseOverrides,
|
|
).filter(
|
|
(f) => f.workoutTemplateProgramId.id.sqlEquals(
|
|
$_itemColumn<String>('id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_workoutTemplateExerciseOverridesRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateProgramsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateProgramsTable> {
|
|
$$WorkoutTemplateProgramsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get defaultRestSecondsSnapshot => $composableBuilder(
|
|
column: $table.defaultRestSecondsSnapshot,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get programSnapshotJson => $composableBuilder(
|
|
column: $table.programSnapshotJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableFilterComposer get workoutTemplateId {
|
|
final $$WorkoutTemplatesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableFilterComposer get sourceProgramId {
|
|
final $$ProgramsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceProgramId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> workoutTemplateExerciseOverridesRefs(
|
|
Expression<bool> Function(
|
|
$$WorkoutTemplateExerciseOverridesTableFilterComposer f,
|
|
)
|
|
f,
|
|
) {
|
|
final $$WorkoutTemplateExerciseOverridesTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplateExerciseOverrides,
|
|
getReferencedColumn: (t) => t.workoutTemplateProgramId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateExerciseOverridesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplateExerciseOverrides,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateProgramsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateProgramsTable> {
|
|
$$WorkoutTemplateProgramsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get defaultRestSecondsSnapshot => $composableBuilder(
|
|
column: $table.defaultRestSecondsSnapshot,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get programSnapshotJson => $composableBuilder(
|
|
column: $table.programSnapshotJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$WorkoutTemplatesTableOrderingComposer get workoutTemplateId {
|
|
final $$WorkoutTemplatesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableOrderingComposer get sourceProgramId {
|
|
final $$ProgramsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceProgramId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateProgramsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateProgramsTable> {
|
|
$$WorkoutTemplateProgramsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get position =>
|
|
$composableBuilder(column: $table.position, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get programNameSnapshot => $composableBuilder(
|
|
column: $table.programNameSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get defaultRestSecondsSnapshot => $composableBuilder(
|
|
column: $table.defaultRestSecondsSnapshot,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get programSnapshotJson => $composableBuilder(
|
|
column: $table.programSnapshotJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$WorkoutTemplatesTableAnnotationComposer get workoutTemplateId {
|
|
final $$WorkoutTemplatesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateId,
|
|
referencedTable: $db.workoutTemplates,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplatesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplates,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableAnnotationComposer get sourceProgramId {
|
|
final $$ProgramsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sourceProgramId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> workoutTemplateExerciseOverridesRefs<T extends Object>(
|
|
Expression<T> Function(
|
|
$$WorkoutTemplateExerciseOverridesTableAnnotationComposer a,
|
|
)
|
|
f,
|
|
) {
|
|
final $$WorkoutTemplateExerciseOverridesTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.workoutTemplateExerciseOverrides,
|
|
getReferencedColumn: (t) => t.workoutTemplateProgramId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateExerciseOverridesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplateExerciseOverrides,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateProgramsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateProgramsTable,
|
|
WorkoutTemplateProgram,
|
|
$$WorkoutTemplateProgramsTableFilterComposer,
|
|
$$WorkoutTemplateProgramsTableOrderingComposer,
|
|
$$WorkoutTemplateProgramsTableAnnotationComposer,
|
|
$$WorkoutTemplateProgramsTableCreateCompanionBuilder,
|
|
$$WorkoutTemplateProgramsTableUpdateCompanionBuilder,
|
|
(WorkoutTemplateProgram, $$WorkoutTemplateProgramsTableReferences),
|
|
WorkoutTemplateProgram,
|
|
PrefetchHooks Function({
|
|
bool workoutTemplateId,
|
|
bool sourceProgramId,
|
|
bool workoutTemplateExerciseOverridesRefs,
|
|
})
|
|
> {
|
|
$$WorkoutTemplateProgramsTableTableManager(
|
|
_$AppDatabase db,
|
|
$WorkoutTemplateProgramsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$WorkoutTemplateProgramsTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$WorkoutTemplateProgramsTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$WorkoutTemplateProgramsTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> workoutTemplateId = const Value.absent(),
|
|
Value<String?> sourceProgramId = const Value.absent(),
|
|
Value<int> position = const Value.absent(),
|
|
Value<String> programNameSnapshot = const Value.absent(),
|
|
Value<int> defaultRestSecondsSnapshot = const Value.absent(),
|
|
Value<String> programSnapshotJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplateProgramsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutTemplateId: workoutTemplateId,
|
|
sourceProgramId: sourceProgramId,
|
|
position: position,
|
|
programNameSnapshot: programNameSnapshot,
|
|
defaultRestSecondsSnapshot: defaultRestSecondsSnapshot,
|
|
programSnapshotJson: programSnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String workoutTemplateId,
|
|
Value<String?> sourceProgramId = const Value.absent(),
|
|
required int position,
|
|
required String programNameSnapshot,
|
|
required int defaultRestSecondsSnapshot,
|
|
required String programSnapshotJson,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplateProgramsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutTemplateId: workoutTemplateId,
|
|
sourceProgramId: sourceProgramId,
|
|
position: position,
|
|
programNameSnapshot: programNameSnapshot,
|
|
defaultRestSecondsSnapshot: defaultRestSecondsSnapshot,
|
|
programSnapshotJson: programSnapshotJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$WorkoutTemplateProgramsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
workoutTemplateId = false,
|
|
sourceProgramId = false,
|
|
workoutTemplateExerciseOverridesRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (workoutTemplateExerciseOverridesRefs)
|
|
db.workoutTemplateExerciseOverrides,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (workoutTemplateId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.workoutTemplateId,
|
|
referencedTable:
|
|
$$WorkoutTemplateProgramsTableReferences
|
|
._workoutTemplateIdTable(db),
|
|
referencedColumn:
|
|
$$WorkoutTemplateProgramsTableReferences
|
|
._workoutTemplateIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (sourceProgramId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.sourceProgramId,
|
|
referencedTable:
|
|
$$WorkoutTemplateProgramsTableReferences
|
|
._sourceProgramIdTable(db),
|
|
referencedColumn:
|
|
$$WorkoutTemplateProgramsTableReferences
|
|
._sourceProgramIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (workoutTemplateExerciseOverridesRefs)
|
|
await $_getPrefetchedData<
|
|
WorkoutTemplateProgram,
|
|
$WorkoutTemplateProgramsTable,
|
|
WorkoutTemplateExerciseOverride
|
|
>(
|
|
currentTable: table,
|
|
referencedTable:
|
|
$$WorkoutTemplateProgramsTableReferences
|
|
._workoutTemplateExerciseOverridesRefsTable(
|
|
db,
|
|
),
|
|
managerFromTypedResult: (p0) =>
|
|
$$WorkoutTemplateProgramsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).workoutTemplateExerciseOverridesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.workoutTemplateProgramId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$WorkoutTemplateProgramsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateProgramsTable,
|
|
WorkoutTemplateProgram,
|
|
$$WorkoutTemplateProgramsTableFilterComposer,
|
|
$$WorkoutTemplateProgramsTableOrderingComposer,
|
|
$$WorkoutTemplateProgramsTableAnnotationComposer,
|
|
$$WorkoutTemplateProgramsTableCreateCompanionBuilder,
|
|
$$WorkoutTemplateProgramsTableUpdateCompanionBuilder,
|
|
(WorkoutTemplateProgram, $$WorkoutTemplateProgramsTableReferences),
|
|
WorkoutTemplateProgram,
|
|
PrefetchHooks Function({
|
|
bool workoutTemplateId,
|
|
bool sourceProgramId,
|
|
bool workoutTemplateExerciseOverridesRefs,
|
|
})
|
|
>;
|
|
typedef $$WorkoutTemplateExerciseOverridesTableCreateCompanionBuilder =
|
|
WorkoutTemplateExerciseOverridesCompanion Function({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
required String workoutTemplateProgramId,
|
|
required String snapshotProgramExerciseId,
|
|
Value<int?> setsCountOverride,
|
|
Value<int?> targetTimeSecondsOverride,
|
|
Value<int?> targetRepsOverride,
|
|
Value<double?> targetScoreOverride,
|
|
Value<int?> targetScoreTimeMsOverride,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$WorkoutTemplateExerciseOverridesTableUpdateCompanionBuilder =
|
|
WorkoutTemplateExerciseOverridesCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<DateTime?> deletedAt,
|
|
Value<int> schemaVersion,
|
|
Value<String> syncState,
|
|
Value<int> localRevision,
|
|
Value<String> originDeviceId,
|
|
Value<String?> futureOwnerProfileId,
|
|
Value<DateTime?> lastSyncedAt,
|
|
Value<String?> remoteRevision,
|
|
Value<String> workoutTemplateProgramId,
|
|
Value<String> snapshotProgramExerciseId,
|
|
Value<int?> setsCountOverride,
|
|
Value<int?> targetTimeSecondsOverride,
|
|
Value<int?> targetRepsOverride,
|
|
Value<double?> targetScoreOverride,
|
|
Value<int?> targetScoreTimeMsOverride,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$WorkoutTemplateExerciseOverridesTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateExerciseOverridesTable,
|
|
WorkoutTemplateExerciseOverride
|
|
> {
|
|
$$WorkoutTemplateExerciseOverridesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $WorkoutTemplateProgramsTable _workoutTemplateProgramIdTable(
|
|
_$AppDatabase db,
|
|
) => db.workoutTemplatePrograms.createAlias(
|
|
'workout_template_exercise_overrides__workout_template_program_id__workout_template_programs__id',
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableProcessedTableManager
|
|
get workoutTemplateProgramId {
|
|
final $_column = $_itemColumn<String>('workout_template_program_id')!;
|
|
|
|
final manager = $$WorkoutTemplateProgramsTableTableManager(
|
|
$_db,
|
|
$_db.workoutTemplatePrograms,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(
|
|
_workoutTemplateProgramIdTable($_db),
|
|
);
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateExerciseOverridesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateExerciseOverridesTable> {
|
|
$$WorkoutTemplateExerciseOverridesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get snapshotProgramExerciseId => $composableBuilder(
|
|
column: $table.snapshotProgramExerciseId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get setsCountOverride => $composableBuilder(
|
|
column: $table.setsCountOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetTimeSecondsOverride => $composableBuilder(
|
|
column: $table.targetTimeSecondsOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetRepsOverride => $composableBuilder(
|
|
column: $table.targetRepsOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get targetScoreOverride => $composableBuilder(
|
|
column: $table.targetScoreOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get targetScoreTimeMsOverride => $composableBuilder(
|
|
column: $table.targetScoreTimeMsOverride,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableFilterComposer get workoutTemplateProgramId {
|
|
final $$WorkoutTemplateProgramsTableFilterComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateProgramId,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateExerciseOverridesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateExerciseOverridesTable> {
|
|
$$WorkoutTemplateExerciseOverridesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
|
column: $table.deletedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get syncState => $composableBuilder(
|
|
column: $table.syncState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get snapshotProgramExerciseId => $composableBuilder(
|
|
column: $table.snapshotProgramExerciseId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get setsCountOverride => $composableBuilder(
|
|
column: $table.setsCountOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetTimeSecondsOverride => $composableBuilder(
|
|
column: $table.targetTimeSecondsOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetRepsOverride => $composableBuilder(
|
|
column: $table.targetRepsOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get targetScoreOverride => $composableBuilder(
|
|
column: $table.targetScoreOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get targetScoreTimeMsOverride => $composableBuilder(
|
|
column: $table.targetScoreTimeMsOverride,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableOrderingComposer get workoutTemplateProgramId {
|
|
final $$WorkoutTemplateProgramsTableOrderingComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateProgramId,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateExerciseOverridesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $WorkoutTemplateExerciseOverridesTable> {
|
|
$$WorkoutTemplateExerciseOverridesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get deletedAt =>
|
|
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaVersion => $composableBuilder(
|
|
column: $table.schemaVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get syncState =>
|
|
$composableBuilder(column: $table.syncState, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get localRevision => $composableBuilder(
|
|
column: $table.localRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originDeviceId => $composableBuilder(
|
|
column: $table.originDeviceId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get futureOwnerProfileId => $composableBuilder(
|
|
column: $table.futureOwnerProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get lastSyncedAt => $composableBuilder(
|
|
column: $table.lastSyncedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get remoteRevision => $composableBuilder(
|
|
column: $table.remoteRevision,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get snapshotProgramExerciseId => $composableBuilder(
|
|
column: $table.snapshotProgramExerciseId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get setsCountOverride => $composableBuilder(
|
|
column: $table.setsCountOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetTimeSecondsOverride => $composableBuilder(
|
|
column: $table.targetTimeSecondsOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetRepsOverride => $composableBuilder(
|
|
column: $table.targetRepsOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get targetScoreOverride => $composableBuilder(
|
|
column: $table.targetScoreOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get targetScoreTimeMsOverride => $composableBuilder(
|
|
column: $table.targetScoreTimeMsOverride,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$WorkoutTemplateProgramsTableAnnotationComposer
|
|
get workoutTemplateProgramId {
|
|
final $$WorkoutTemplateProgramsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.workoutTemplateProgramId,
|
|
referencedTable: $db.workoutTemplatePrograms,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$WorkoutTemplateProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.workoutTemplatePrograms,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$WorkoutTemplateExerciseOverridesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateExerciseOverridesTable,
|
|
WorkoutTemplateExerciseOverride,
|
|
$$WorkoutTemplateExerciseOverridesTableFilterComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableOrderingComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableAnnotationComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableCreateCompanionBuilder,
|
|
$$WorkoutTemplateExerciseOverridesTableUpdateCompanionBuilder,
|
|
(
|
|
WorkoutTemplateExerciseOverride,
|
|
$$WorkoutTemplateExerciseOverridesTableReferences,
|
|
),
|
|
WorkoutTemplateExerciseOverride,
|
|
PrefetchHooks Function({bool workoutTemplateProgramId})
|
|
> {
|
|
$$WorkoutTemplateExerciseOverridesTableTableManager(
|
|
_$AppDatabase db,
|
|
$WorkoutTemplateExerciseOverridesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$WorkoutTemplateExerciseOverridesTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$WorkoutTemplateExerciseOverridesTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$WorkoutTemplateExerciseOverridesTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
Value<String> syncState = const Value.absent(),
|
|
Value<int> localRevision = const Value.absent(),
|
|
Value<String> originDeviceId = const Value.absent(),
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
Value<String> workoutTemplateProgramId = const Value.absent(),
|
|
Value<String> snapshotProgramExerciseId = const Value.absent(),
|
|
Value<int?> setsCountOverride = const Value.absent(),
|
|
Value<int?> targetTimeSecondsOverride = const Value.absent(),
|
|
Value<int?> targetRepsOverride = const Value.absent(),
|
|
Value<double?> targetScoreOverride = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsOverride = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplateExerciseOverridesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutTemplateProgramId: workoutTemplateProgramId,
|
|
snapshotProgramExerciseId: snapshotProgramExerciseId,
|
|
setsCountOverride: setsCountOverride,
|
|
targetTimeSecondsOverride: targetTimeSecondsOverride,
|
|
targetRepsOverride: targetRepsOverride,
|
|
targetScoreOverride: targetScoreOverride,
|
|
targetScoreTimeMsOverride: targetScoreTimeMsOverride,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
Value<DateTime?> deletedAt = const Value.absent(),
|
|
Value<int> schemaVersion = const Value.absent(),
|
|
required String syncState,
|
|
required int localRevision,
|
|
required String originDeviceId,
|
|
Value<String?> futureOwnerProfileId = const Value.absent(),
|
|
Value<DateTime?> lastSyncedAt = const Value.absent(),
|
|
Value<String?> remoteRevision = const Value.absent(),
|
|
required String workoutTemplateProgramId,
|
|
required String snapshotProgramExerciseId,
|
|
Value<int?> setsCountOverride = const Value.absent(),
|
|
Value<int?> targetTimeSecondsOverride = const Value.absent(),
|
|
Value<int?> targetRepsOverride = const Value.absent(),
|
|
Value<double?> targetScoreOverride = const Value.absent(),
|
|
Value<int?> targetScoreTimeMsOverride = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => WorkoutTemplateExerciseOverridesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
deletedAt: deletedAt,
|
|
schemaVersion: schemaVersion,
|
|
syncState: syncState,
|
|
localRevision: localRevision,
|
|
originDeviceId: originDeviceId,
|
|
futureOwnerProfileId: futureOwnerProfileId,
|
|
lastSyncedAt: lastSyncedAt,
|
|
remoteRevision: remoteRevision,
|
|
workoutTemplateProgramId: workoutTemplateProgramId,
|
|
snapshotProgramExerciseId: snapshotProgramExerciseId,
|
|
setsCountOverride: setsCountOverride,
|
|
targetTimeSecondsOverride: targetTimeSecondsOverride,
|
|
targetRepsOverride: targetRepsOverride,
|
|
targetScoreOverride: targetScoreOverride,
|
|
targetScoreTimeMsOverride: targetScoreTimeMsOverride,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$WorkoutTemplateExerciseOverridesTableReferences(
|
|
db,
|
|
table,
|
|
e,
|
|
),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({workoutTemplateProgramId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (workoutTemplateProgramId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.workoutTemplateProgramId,
|
|
referencedTable:
|
|
$$WorkoutTemplateExerciseOverridesTableReferences
|
|
._workoutTemplateProgramIdTable(db),
|
|
referencedColumn:
|
|
$$WorkoutTemplateExerciseOverridesTableReferences
|
|
._workoutTemplateProgramIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$WorkoutTemplateExerciseOverridesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$WorkoutTemplateExerciseOverridesTable,
|
|
WorkoutTemplateExerciseOverride,
|
|
$$WorkoutTemplateExerciseOverridesTableFilterComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableOrderingComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableAnnotationComposer,
|
|
$$WorkoutTemplateExerciseOverridesTableCreateCompanionBuilder,
|
|
$$WorkoutTemplateExerciseOverridesTableUpdateCompanionBuilder,
|
|
(
|
|
WorkoutTemplateExerciseOverride,
|
|
$$WorkoutTemplateExerciseOverridesTableReferences,
|
|
),
|
|
WorkoutTemplateExerciseOverride,
|
|
PrefetchHooks Function({bool workoutTemplateProgramId})
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$WorkoutTemplatesTableTableManager get workoutTemplates =>
|
|
$$WorkoutTemplatesTableTableManager(_db, _db.workoutTemplates);
|
|
$$ActiveWorkoutSessionsTableTableManager get activeWorkoutSessions =>
|
|
$$ActiveWorkoutSessionsTableTableManager(_db, _db.activeWorkoutSessions);
|
|
$$ActiveRestStatesTableTableManager get activeRestStates =>
|
|
$$ActiveRestStatesTableTableManager(_db, _db.activeRestStates);
|
|
$$ActiveScoreStopwatchStatesTableTableManager
|
|
get activeScoreStopwatchStates =>
|
|
$$ActiveScoreStopwatchStatesTableTableManager(
|
|
_db,
|
|
_db.activeScoreStopwatchStates,
|
|
);
|
|
$$ActiveSetResultsTableTableManager get activeSetResults =>
|
|
$$ActiveSetResultsTableTableManager(_db, _db.activeSetResults);
|
|
$$ChangeLogEntriesTableTableManager get changeLogEntries =>
|
|
$$ChangeLogEntriesTableTableManager(_db, _db.changeLogEntries);
|
|
$$MediaAssetsTableTableManager get mediaAssets =>
|
|
$$MediaAssetsTableTableManager(_db, _db.mediaAssets);
|
|
$$ExercisesTableTableManager get exercises =>
|
|
$$ExercisesTableTableManager(_db, _db.exercises);
|
|
$$ProgramsTableTableManager get programs =>
|
|
$$ProgramsTableTableManager(_db, _db.programs);
|
|
$$ProgramExercisesTableTableManager get programExercises =>
|
|
$$ProgramExercisesTableTableManager(_db, _db.programExercises);
|
|
$$WorkoutHistoriesTableTableManager get workoutHistories =>
|
|
$$WorkoutHistoriesTableTableManager(_db, _db.workoutHistories);
|
|
$$WorkoutHistorySetResultsTableTableManager get workoutHistorySetResults =>
|
|
$$WorkoutHistorySetResultsTableTableManager(
|
|
_db,
|
|
_db.workoutHistorySetResults,
|
|
);
|
|
$$WorkoutTemplateProgramsTableTableManager get workoutTemplatePrograms =>
|
|
$$WorkoutTemplateProgramsTableTableManager(
|
|
_db,
|
|
_db.workoutTemplatePrograms,
|
|
);
|
|
$$WorkoutTemplateExerciseOverridesTableTableManager
|
|
get workoutTemplateExerciseOverrides =>
|
|
$$WorkoutTemplateExerciseOverridesTableTableManager(
|
|
_db,
|
|
_db.workoutTemplateExerciseOverrides,
|
|
);
|
|
}
|