added sound during countdown, and upgraded minsdkversion
This commit is contained in:
@ -35,7 +35,7 @@ class AppDatabase extends _$AppDatabase {
|
||||
AppDatabase() : super(_openConnection());
|
||||
|
||||
@override
|
||||
int get schemaVersion => 33;
|
||||
int get schemaVersion => 35;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -155,10 +155,10 @@ class Activities extends Table {
|
||||
|
||||
class ActivityActions extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
IntColumn get activityId =>
|
||||
integer().references(Activities, #id, onDelete: KeyAction.cascade)();
|
||||
IntColumn get activityId => integer().references(Activities, #id, onDelete: KeyAction.cascade)();
|
||||
IntColumn get actionId =>
|
||||
integer().references(Actions, #id, onDelete: KeyAction.cascade)();
|
||||
IntColumn get sessionId => integer().references(Sessions, #id, onDelete: KeyAction.cascade)();
|
||||
IntColumn get position => integer()();
|
||||
DateTimeColumn get createdAt =>
|
||||
dateTime().withDefault(Variable(DateTime.now()))();
|
||||
|
@ -2365,6 +2365,15 @@ class $ActivityActionsTable extends ActivityActions
|
||||
requiredDuringInsert: true,
|
||||
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
||||
'REFERENCES actions (id) ON DELETE CASCADE'));
|
||||
static const VerificationMeta _sessionIdMeta =
|
||||
const VerificationMeta('sessionId');
|
||||
@override
|
||||
late final GeneratedColumn<int> sessionId = GeneratedColumn<int>(
|
||||
'session_id', aliasedName, false,
|
||||
type: DriftSqlType.int,
|
||||
requiredDuringInsert: true,
|
||||
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
||||
'REFERENCES sessions (id) ON DELETE CASCADE'));
|
||||
static const VerificationMeta _positionMeta =
|
||||
const VerificationMeta('position');
|
||||
@override
|
||||
@ -2381,7 +2390,7 @@ class $ActivityActionsTable extends ActivityActions
|
||||
defaultValue: Variable(DateTime.now()));
|
||||
@override
|
||||
List<GeneratedColumn> get $columns =>
|
||||
[id, activityId, actionId, position, createdAt];
|
||||
[id, activityId, actionId, sessionId, position, createdAt];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
@ -2409,6 +2418,12 @@ class $ActivityActionsTable extends ActivityActions
|
||||
} else if (isInserting) {
|
||||
context.missing(_actionIdMeta);
|
||||
}
|
||||
if (data.containsKey('session_id')) {
|
||||
context.handle(_sessionIdMeta,
|
||||
sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_sessionIdMeta);
|
||||
}
|
||||
if (data.containsKey('position')) {
|
||||
context.handle(_positionMeta,
|
||||
position.isAcceptableOrUnknown(data['position']!, _positionMeta));
|
||||
@ -2434,6 +2449,8 @@ class $ActivityActionsTable extends ActivityActions
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}activity_id'])!,
|
||||
actionId: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}action_id'])!,
|
||||
sessionId: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}session_id'])!,
|
||||
position: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}position'])!,
|
||||
createdAt: attachedDatabase.typeMapping
|
||||
@ -2451,12 +2468,14 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
final int id;
|
||||
final int activityId;
|
||||
final int actionId;
|
||||
final int sessionId;
|
||||
final int position;
|
||||
final DateTime createdAt;
|
||||
const ActivityAction(
|
||||
{required this.id,
|
||||
required this.activityId,
|
||||
required this.actionId,
|
||||
required this.sessionId,
|
||||
required this.position,
|
||||
required this.createdAt});
|
||||
@override
|
||||
@ -2465,6 +2484,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
map['id'] = Variable<int>(id);
|
||||
map['activity_id'] = Variable<int>(activityId);
|
||||
map['action_id'] = Variable<int>(actionId);
|
||||
map['session_id'] = Variable<int>(sessionId);
|
||||
map['position'] = Variable<int>(position);
|
||||
map['created_at'] = Variable<DateTime>(createdAt);
|
||||
return map;
|
||||
@ -2475,6 +2495,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
id: Value(id),
|
||||
activityId: Value(activityId),
|
||||
actionId: Value(actionId),
|
||||
sessionId: Value(sessionId),
|
||||
position: Value(position),
|
||||
createdAt: Value(createdAt),
|
||||
);
|
||||
@ -2487,6 +2508,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
id: serializer.fromJson<int>(json['id']),
|
||||
activityId: serializer.fromJson<int>(json['activityId']),
|
||||
actionId: serializer.fromJson<int>(json['actionId']),
|
||||
sessionId: serializer.fromJson<int>(json['sessionId']),
|
||||
position: serializer.fromJson<int>(json['position']),
|
||||
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
||||
);
|
||||
@ -2498,6 +2520,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
'id': serializer.toJson<int>(id),
|
||||
'activityId': serializer.toJson<int>(activityId),
|
||||
'actionId': serializer.toJson<int>(actionId),
|
||||
'sessionId': serializer.toJson<int>(sessionId),
|
||||
'position': serializer.toJson<int>(position),
|
||||
'createdAt': serializer.toJson<DateTime>(createdAt),
|
||||
};
|
||||
@ -2507,12 +2530,14 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
{int? id,
|
||||
int? activityId,
|
||||
int? actionId,
|
||||
int? sessionId,
|
||||
int? position,
|
||||
DateTime? createdAt}) =>
|
||||
ActivityAction(
|
||||
id: id ?? this.id,
|
||||
activityId: activityId ?? this.activityId,
|
||||
actionId: actionId ?? this.actionId,
|
||||
sessionId: sessionId ?? this.sessionId,
|
||||
position: position ?? this.position,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
@ -2522,6 +2547,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
activityId:
|
||||
data.activityId.present ? data.activityId.value : this.activityId,
|
||||
actionId: data.actionId.present ? data.actionId.value : this.actionId,
|
||||
sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
|
||||
position: data.position.present ? data.position.value : this.position,
|
||||
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
||||
);
|
||||
@ -2533,6 +2559,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
..write('id: $id, ')
|
||||
..write('activityId: $activityId, ')
|
||||
..write('actionId: $actionId, ')
|
||||
..write('sessionId: $sessionId, ')
|
||||
..write('position: $position, ')
|
||||
..write('createdAt: $createdAt')
|
||||
..write(')'))
|
||||
@ -2541,7 +2568,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(id, activityId, actionId, position, createdAt);
|
||||
Object.hash(id, activityId, actionId, sessionId, position, createdAt);
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
@ -2549,6 +2576,7 @@ class ActivityAction extends DataClass implements Insertable<ActivityAction> {
|
||||
other.id == this.id &&
|
||||
other.activityId == this.activityId &&
|
||||
other.actionId == this.actionId &&
|
||||
other.sessionId == this.sessionId &&
|
||||
other.position == this.position &&
|
||||
other.createdAt == this.createdAt);
|
||||
}
|
||||
@ -2557,12 +2585,14 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
final Value<int> id;
|
||||
final Value<int> activityId;
|
||||
final Value<int> actionId;
|
||||
final Value<int> sessionId;
|
||||
final Value<int> position;
|
||||
final Value<DateTime> createdAt;
|
||||
const ActivityActionsCompanion({
|
||||
this.id = const Value.absent(),
|
||||
this.activityId = const Value.absent(),
|
||||
this.actionId = const Value.absent(),
|
||||
this.sessionId = const Value.absent(),
|
||||
this.position = const Value.absent(),
|
||||
this.createdAt = const Value.absent(),
|
||||
});
|
||||
@ -2570,15 +2600,18 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
this.id = const Value.absent(),
|
||||
required int activityId,
|
||||
required int actionId,
|
||||
required int sessionId,
|
||||
required int position,
|
||||
this.createdAt = const Value.absent(),
|
||||
}) : activityId = Value(activityId),
|
||||
actionId = Value(actionId),
|
||||
sessionId = Value(sessionId),
|
||||
position = Value(position);
|
||||
static Insertable<ActivityAction> custom({
|
||||
Expression<int>? id,
|
||||
Expression<int>? activityId,
|
||||
Expression<int>? actionId,
|
||||
Expression<int>? sessionId,
|
||||
Expression<int>? position,
|
||||
Expression<DateTime>? createdAt,
|
||||
}) {
|
||||
@ -2586,6 +2619,7 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
if (id != null) 'id': id,
|
||||
if (activityId != null) 'activity_id': activityId,
|
||||
if (actionId != null) 'action_id': actionId,
|
||||
if (sessionId != null) 'session_id': sessionId,
|
||||
if (position != null) 'position': position,
|
||||
if (createdAt != null) 'created_at': createdAt,
|
||||
});
|
||||
@ -2595,12 +2629,14 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
{Value<int>? id,
|
||||
Value<int>? activityId,
|
||||
Value<int>? actionId,
|
||||
Value<int>? sessionId,
|
||||
Value<int>? position,
|
||||
Value<DateTime>? createdAt}) {
|
||||
return ActivityActionsCompanion(
|
||||
id: id ?? this.id,
|
||||
activityId: activityId ?? this.activityId,
|
||||
actionId: actionId ?? this.actionId,
|
||||
sessionId: sessionId ?? this.sessionId,
|
||||
position: position ?? this.position,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
@ -2618,6 +2654,9 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
if (actionId.present) {
|
||||
map['action_id'] = Variable<int>(actionId.value);
|
||||
}
|
||||
if (sessionId.present) {
|
||||
map['session_id'] = Variable<int>(sessionId.value);
|
||||
}
|
||||
if (position.present) {
|
||||
map['position'] = Variable<int>(position.value);
|
||||
}
|
||||
@ -2633,6 +2672,7 @@ class ActivityActionsCompanion extends UpdateCompanion<ActivityAction> {
|
||||
..write('id: $id, ')
|
||||
..write('activityId: $activityId, ')
|
||||
..write('actionId: $actionId, ')
|
||||
..write('sessionId: $sessionId, ')
|
||||
..write('position: $position, ')
|
||||
..write('createdAt: $createdAt')
|
||||
..write(')'))
|
||||
@ -3359,6 +3399,13 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
TableUpdate('activity_actions', kind: UpdateKind.delete),
|
||||
],
|
||||
),
|
||||
WritePropagation(
|
||||
on: TableUpdateQuery.onTableName('sessions',
|
||||
limitUpdateKind: UpdateKind.delete),
|
||||
result: [
|
||||
TableUpdate('activity_actions', kind: UpdateKind.delete),
|
||||
],
|
||||
),
|
||||
WritePropagation(
|
||||
on: TableUpdateQuery.onTableName('media_items',
|
||||
limitUpdateKind: UpdateKind.delete),
|
||||
@ -3411,6 +3458,23 @@ final class $$SessionsTableReferences
|
||||
return ProcessedTableManager(
|
||||
manager.$state.copyWith(prefetchedData: cache));
|
||||
}
|
||||
|
||||
static MultiTypedResultKey<$ActivityActionsTable, List<ActivityAction>>
|
||||
_activityActionsRefsTable(_$AppDatabase db) =>
|
||||
MultiTypedResultKey.fromTable(db.activityActions,
|
||||
aliasName: $_aliasNameGenerator(
|
||||
db.sessions.id, db.activityActions.sessionId));
|
||||
|
||||
$$ActivityActionsTableProcessedTableManager get activityActionsRefs {
|
||||
final manager =
|
||||
$$ActivityActionsTableTableManager($_db, $_db.activityActions)
|
||||
.filter((f) => f.sessionId.id($_item.id));
|
||||
|
||||
final cache =
|
||||
$_typedResult.readTableOrNull(_activityActionsRefsTable($_db));
|
||||
return ProcessedTableManager(
|
||||
manager.$state.copyWith(prefetchedData: cache));
|
||||
}
|
||||
}
|
||||
|
||||
class $$SessionsTableFilterComposer
|
||||
@ -3468,6 +3532,27 @@ class $$SessionsTableFilterComposer
|
||||
));
|
||||
return f(composer);
|
||||
}
|
||||
|
||||
Expression<bool> activityActionsRefs(
|
||||
Expression<bool> Function($$ActivityActionsTableFilterComposer f) f) {
|
||||
final $$ActivityActionsTableFilterComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
getCurrentColumn: (t) => t.id,
|
||||
referencedTable: $db.activityActions,
|
||||
getReferencedColumn: (t) => t.sessionId,
|
||||
builder: (joinBuilder,
|
||||
{$addJoinBuilderToRootComposer,
|
||||
$removeJoinBuilderFromRootComposer}) =>
|
||||
$$ActivityActionsTableFilterComposer(
|
||||
$db: $db,
|
||||
$table: $db.activityActions,
|
||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||
joinBuilder: joinBuilder,
|
||||
$removeJoinBuilderFromRootComposer:
|
||||
$removeJoinBuilderFromRootComposer,
|
||||
));
|
||||
return f(composer);
|
||||
}
|
||||
}
|
||||
|
||||
class $$SessionsTableOrderingComposer
|
||||
@ -3559,6 +3644,27 @@ class $$SessionsTableAnnotationComposer
|
||||
));
|
||||
return f(composer);
|
||||
}
|
||||
|
||||
Expression<T> activityActionsRefs<T extends Object>(
|
||||
Expression<T> Function($$ActivityActionsTableAnnotationComposer a) f) {
|
||||
final $$ActivityActionsTableAnnotationComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
getCurrentColumn: (t) => t.id,
|
||||
referencedTable: $db.activityActions,
|
||||
getReferencedColumn: (t) => t.sessionId,
|
||||
builder: (joinBuilder,
|
||||
{$addJoinBuilderToRootComposer,
|
||||
$removeJoinBuilderFromRootComposer}) =>
|
||||
$$ActivityActionsTableAnnotationComposer(
|
||||
$db: $db,
|
||||
$table: $db.activityActions,
|
||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||
joinBuilder: joinBuilder,
|
||||
$removeJoinBuilderFromRootComposer:
|
||||
$removeJoinBuilderFromRootComposer,
|
||||
));
|
||||
return f(composer);
|
||||
}
|
||||
}
|
||||
|
||||
class $$SessionsTableTableManager extends RootTableManager<
|
||||
@ -3572,7 +3678,8 @@ class $$SessionsTableTableManager extends RootTableManager<
|
||||
$$SessionsTableUpdateCompanionBuilder,
|
||||
(Session, $$SessionsTableReferences),
|
||||
Session,
|
||||
PrefetchHooks Function({bool sessionActivitiesRefs})> {
|
||||
PrefetchHooks Function(
|
||||
{bool sessionActivitiesRefs, bool activityActionsRefs})> {
|
||||
$$SessionsTableTableManager(_$AppDatabase db, $SessionsTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
@ -3627,11 +3734,13 @@ class $$SessionsTableTableManager extends RootTableManager<
|
||||
.map((e) =>
|
||||
(e.readTable(table), $$SessionsTableReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({sessionActivitiesRefs = false}) {
|
||||
prefetchHooksCallback: (
|
||||
{sessionActivitiesRefs = false, activityActionsRefs = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [
|
||||
if (sessionActivitiesRefs) db.sessionActivities
|
||||
if (sessionActivitiesRefs) db.sessionActivities,
|
||||
if (activityActionsRefs) db.activityActions
|
||||
],
|
||||
addJoins: null,
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
@ -3647,6 +3756,18 @@ class $$SessionsTableTableManager extends RootTableManager<
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems
|
||||
.where((e) => e.sessionId == item.id),
|
||||
typedResults: items),
|
||||
if (activityActionsRefs)
|
||||
await $_getPrefetchedData(
|
||||
currentTable: table,
|
||||
referencedTable: $$SessionsTableReferences
|
||||
._activityActionsRefsTable(db),
|
||||
managerFromTypedResult: (p0) =>
|
||||
$$SessionsTableReferences(db, table, p0)
|
||||
.activityActionsRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems
|
||||
.where((e) => e.sessionId == item.id),
|
||||
typedResults: items)
|
||||
];
|
||||
},
|
||||
@ -3666,7 +3787,8 @@ typedef $$SessionsTableProcessedTableManager = ProcessedTableManager<
|
||||
$$SessionsTableUpdateCompanionBuilder,
|
||||
(Session, $$SessionsTableReferences),
|
||||
Session,
|
||||
PrefetchHooks Function({bool sessionActivitiesRefs})>;
|
||||
PrefetchHooks Function(
|
||||
{bool sessionActivitiesRefs, bool activityActionsRefs})>;
|
||||
typedef $$ActivitiesTableCreateCompanionBuilder = ActivitiesCompanion Function({
|
||||
Value<int> id,
|
||||
required String title,
|
||||
@ -4953,6 +5075,7 @@ typedef $$ActivityActionsTableCreateCompanionBuilder = ActivityActionsCompanion
|
||||
Value<int> id,
|
||||
required int activityId,
|
||||
required int actionId,
|
||||
required int sessionId,
|
||||
required int position,
|
||||
Value<DateTime> createdAt,
|
||||
});
|
||||
@ -4961,6 +5084,7 @@ typedef $$ActivityActionsTableUpdateCompanionBuilder = ActivityActionsCompanion
|
||||
Value<int> id,
|
||||
Value<int> activityId,
|
||||
Value<int> actionId,
|
||||
Value<int> sessionId,
|
||||
Value<int> position,
|
||||
Value<DateTime> createdAt,
|
||||
});
|
||||
@ -4995,6 +5119,19 @@ final class $$ActivityActionsTableReferences extends BaseReferences<
|
||||
return ProcessedTableManager(
|
||||
manager.$state.copyWith(prefetchedData: [item]));
|
||||
}
|
||||
|
||||
static $SessionsTable _sessionIdTable(_$AppDatabase db) =>
|
||||
db.sessions.createAlias(
|
||||
$_aliasNameGenerator(db.activityActions.sessionId, db.sessions.id));
|
||||
|
||||
$$SessionsTableProcessedTableManager get sessionId {
|
||||
final manager = $$SessionsTableTableManager($_db, $_db.sessions)
|
||||
.filter((f) => f.id($_item.sessionId!));
|
||||
final item = $_typedResult.readTableOrNull(_sessionIdTable($_db));
|
||||
if (item == null) return manager;
|
||||
return ProcessedTableManager(
|
||||
manager.$state.copyWith(prefetchedData: [item]));
|
||||
}
|
||||
}
|
||||
|
||||
class $$ActivityActionsTableFilterComposer
|
||||
@ -5054,6 +5191,26 @@ class $$ActivityActionsTableFilterComposer
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
|
||||
$$SessionsTableFilterComposer get sessionId {
|
||||
final $$SessionsTableFilterComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
getCurrentColumn: (t) => t.sessionId,
|
||||
referencedTable: $db.sessions,
|
||||
getReferencedColumn: (t) => t.id,
|
||||
builder: (joinBuilder,
|
||||
{$addJoinBuilderToRootComposer,
|
||||
$removeJoinBuilderFromRootComposer}) =>
|
||||
$$SessionsTableFilterComposer(
|
||||
$db: $db,
|
||||
$table: $db.sessions,
|
||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||
joinBuilder: joinBuilder,
|
||||
$removeJoinBuilderFromRootComposer:
|
||||
$removeJoinBuilderFromRootComposer,
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
}
|
||||
|
||||
class $$ActivityActionsTableOrderingComposer
|
||||
@ -5113,6 +5270,26 @@ class $$ActivityActionsTableOrderingComposer
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
|
||||
$$SessionsTableOrderingComposer get sessionId {
|
||||
final $$SessionsTableOrderingComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
getCurrentColumn: (t) => t.sessionId,
|
||||
referencedTable: $db.sessions,
|
||||
getReferencedColumn: (t) => t.id,
|
||||
builder: (joinBuilder,
|
||||
{$addJoinBuilderToRootComposer,
|
||||
$removeJoinBuilderFromRootComposer}) =>
|
||||
$$SessionsTableOrderingComposer(
|
||||
$db: $db,
|
||||
$table: $db.sessions,
|
||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||
joinBuilder: joinBuilder,
|
||||
$removeJoinBuilderFromRootComposer:
|
||||
$removeJoinBuilderFromRootComposer,
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
}
|
||||
|
||||
class $$ActivityActionsTableAnnotationComposer
|
||||
@ -5172,6 +5349,26 @@ class $$ActivityActionsTableAnnotationComposer
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
|
||||
$$SessionsTableAnnotationComposer get sessionId {
|
||||
final $$SessionsTableAnnotationComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
getCurrentColumn: (t) => t.sessionId,
|
||||
referencedTable: $db.sessions,
|
||||
getReferencedColumn: (t) => t.id,
|
||||
builder: (joinBuilder,
|
||||
{$addJoinBuilderToRootComposer,
|
||||
$removeJoinBuilderFromRootComposer}) =>
|
||||
$$SessionsTableAnnotationComposer(
|
||||
$db: $db,
|
||||
$table: $db.sessions,
|
||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||
joinBuilder: joinBuilder,
|
||||
$removeJoinBuilderFromRootComposer:
|
||||
$removeJoinBuilderFromRootComposer,
|
||||
));
|
||||
return composer;
|
||||
}
|
||||
}
|
||||
|
||||
class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
@ -5185,7 +5382,7 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
$$ActivityActionsTableUpdateCompanionBuilder,
|
||||
(ActivityAction, $$ActivityActionsTableReferences),
|
||||
ActivityAction,
|
||||
PrefetchHooks Function({bool activityId, bool actionId})> {
|
||||
PrefetchHooks Function({bool activityId, bool actionId, bool sessionId})> {
|
||||
$$ActivityActionsTableTableManager(
|
||||
_$AppDatabase db, $ActivityActionsTable table)
|
||||
: super(TableManagerState(
|
||||
@ -5201,6 +5398,7 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<int> activityId = const Value.absent(),
|
||||
Value<int> actionId = const Value.absent(),
|
||||
Value<int> sessionId = const Value.absent(),
|
||||
Value<int> position = const Value.absent(),
|
||||
Value<DateTime> createdAt = const Value.absent(),
|
||||
}) =>
|
||||
@ -5208,6 +5406,7 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
id: id,
|
||||
activityId: activityId,
|
||||
actionId: actionId,
|
||||
sessionId: sessionId,
|
||||
position: position,
|
||||
createdAt: createdAt,
|
||||
),
|
||||
@ -5215,6 +5414,7 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
Value<int> id = const Value.absent(),
|
||||
required int activityId,
|
||||
required int actionId,
|
||||
required int sessionId,
|
||||
required int position,
|
||||
Value<DateTime> createdAt = const Value.absent(),
|
||||
}) =>
|
||||
@ -5222,6 +5422,7 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
id: id,
|
||||
activityId: activityId,
|
||||
actionId: actionId,
|
||||
sessionId: sessionId,
|
||||
position: position,
|
||||
createdAt: createdAt,
|
||||
),
|
||||
@ -5231,7 +5432,8 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
$$ActivityActionsTableReferences(db, table, e)
|
||||
))
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({activityId = false, actionId = false}) {
|
||||
prefetchHooksCallback: (
|
||||
{activityId = false, actionId = false, sessionId = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [],
|
||||
@ -5269,6 +5471,16 @@ class $$ActivityActionsTableTableManager extends RootTableManager<
|
||||
$$ActivityActionsTableReferences._actionIdTable(db).id,
|
||||
) as T;
|
||||
}
|
||||
if (sessionId) {
|
||||
state = state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.sessionId,
|
||||
referencedTable:
|
||||
$$ActivityActionsTableReferences._sessionIdTable(db),
|
||||
referencedColumn:
|
||||
$$ActivityActionsTableReferences._sessionIdTable(db).id,
|
||||
) as T;
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
@ -5291,7 +5503,7 @@ typedef $$ActivityActionsTableProcessedTableManager = ProcessedTableManager<
|
||||
$$ActivityActionsTableUpdateCompanionBuilder,
|
||||
(ActivityAction, $$ActivityActionsTableReferences),
|
||||
ActivityAction,
|
||||
PrefetchHooks Function({bool activityId, bool actionId})>;
|
||||
PrefetchHooks Function({bool activityId, bool actionId, bool sessionId})>;
|
||||
typedef $$MediaItemsTableCreateCompanionBuilder = MediaItemsCompanion Function({
|
||||
Value<int> id,
|
||||
required String title,
|
||||
|
@ -5287,6 +5287,329 @@ i1.GeneratedColumn<String> _column_62(String aliasedName) => i1.GeneratedColumn<
|
||||
type: i1.DriftSqlType.string,
|
||||
defaultValue: Variable(
|
||||
"{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}"));
|
||||
|
||||
final class Schema34 extends i0.VersionedSchema {
|
||||
Schema34({required super.database}) : super(version: 34);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
sessions,
|
||||
activities,
|
||||
sessionActivities,
|
||||
actions,
|
||||
activityActions,
|
||||
mediaItems,
|
||||
objectMediaItems,
|
||||
];
|
||||
late final Shape12 sessions = Shape12(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sessions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
_column_20,
|
||||
_column_4,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape17 activities = Shape17(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'activities',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_40,
|
||||
_column_36,
|
||||
_column_37,
|
||||
_column_38,
|
||||
_column_27,
|
||||
_column_28,
|
||||
_column_29,
|
||||
_column_35,
|
||||
_column_31,
|
||||
_column_32,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape13 sessionActivities = Shape13(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'session_activities',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_21,
|
||||
_column_22,
|
||||
_column_19,
|
||||
_column_10,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape21 actions = Shape21(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'actions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_41,
|
||||
_column_2,
|
||||
_column_42,
|
||||
_column_43,
|
||||
_column_44,
|
||||
_column_45,
|
||||
_column_46,
|
||||
_column_47,
|
||||
_column_48,
|
||||
_column_49,
|
||||
_column_53,
|
||||
_column_54,
|
||||
_column_51,
|
||||
_column_52,
|
||||
_column_58,
|
||||
_column_62,
|
||||
_column_12,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape22 activityActions = Shape22(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'activity_actions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_9,
|
||||
_column_23,
|
||||
_column_8,
|
||||
_column_19,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape5 mediaItems = Shape5(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'media_items',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_41,
|
||||
_column_2,
|
||||
_column_25,
|
||||
_column_6,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape6 objectMediaItems = Shape6(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'object_media_items',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_15,
|
||||
_column_16,
|
||||
_column_24,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
}
|
||||
|
||||
class Shape22 extends i0.VersionedTable {
|
||||
Shape22({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get activityId =>
|
||||
columnsByName['activity_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get actionId =>
|
||||
columnsByName['action_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get sessionId =>
|
||||
columnsByName['session_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get position =>
|
||||
columnsByName['position']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
final class Schema35 extends i0.VersionedSchema {
|
||||
Schema35({required super.database}) : super(version: 35);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
sessions,
|
||||
activities,
|
||||
sessionActivities,
|
||||
actions,
|
||||
activityActions,
|
||||
mediaItems,
|
||||
objectMediaItems,
|
||||
];
|
||||
late final Shape12 sessions = Shape12(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sessions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
_column_20,
|
||||
_column_4,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape17 activities = Shape17(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'activities',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_40,
|
||||
_column_36,
|
||||
_column_37,
|
||||
_column_38,
|
||||
_column_27,
|
||||
_column_28,
|
||||
_column_29,
|
||||
_column_35,
|
||||
_column_31,
|
||||
_column_32,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape13 sessionActivities = Shape13(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'session_activities',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_21,
|
||||
_column_22,
|
||||
_column_19,
|
||||
_column_10,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape21 actions = Shape21(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'actions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_41,
|
||||
_column_2,
|
||||
_column_42,
|
||||
_column_43,
|
||||
_column_44,
|
||||
_column_45,
|
||||
_column_46,
|
||||
_column_47,
|
||||
_column_48,
|
||||
_column_49,
|
||||
_column_53,
|
||||
_column_54,
|
||||
_column_51,
|
||||
_column_52,
|
||||
_column_58,
|
||||
_column_62,
|
||||
_column_12,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape22 activityActions = Shape22(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'activity_actions',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_22,
|
||||
_column_23,
|
||||
_column_21,
|
||||
_column_19,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape5 mediaItems = Shape5(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'media_items',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_41,
|
||||
_column_2,
|
||||
_column_25,
|
||||
_column_6,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape6 objectMediaItems = Shape6(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'object_media_items',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_15,
|
||||
_column_16,
|
||||
_column_24,
|
||||
_column_5,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
}
|
||||
|
||||
i0.MigrationStepWithVersion migrationSteps({
|
||||
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
|
||||
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
||||
@ -5320,6 +5643,8 @@ i0.MigrationStepWithVersion migrationSteps({
|
||||
required Future<void> Function(i1.Migrator m, Schema31 schema) from30To31,
|
||||
required Future<void> Function(i1.Migrator m, Schema32 schema) from31To32,
|
||||
required Future<void> Function(i1.Migrator m, Schema33 schema) from32To33,
|
||||
required Future<void> Function(i1.Migrator m, Schema34 schema) from33To34,
|
||||
required Future<void> Function(i1.Migrator m, Schema35 schema) from34To35,
|
||||
}) {
|
||||
return (currentVersion, database) async {
|
||||
switch (currentVersion) {
|
||||
@ -5483,6 +5808,16 @@ i0.MigrationStepWithVersion migrationSteps({
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from32To33(migrator, schema);
|
||||
return 33;
|
||||
case 33:
|
||||
final schema = Schema34(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from33To34(migrator, schema);
|
||||
return 34;
|
||||
case 34:
|
||||
final schema = Schema35(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from34To35(migrator, schema);
|
||||
return 35;
|
||||
default:
|
||||
throw ArgumentError.value('Unknown migration from $currentVersion');
|
||||
}
|
||||
@ -5522,6 +5857,8 @@ i1.OnUpgrade stepByStep({
|
||||
required Future<void> Function(i1.Migrator m, Schema31 schema) from30To31,
|
||||
required Future<void> Function(i1.Migrator m, Schema32 schema) from31To32,
|
||||
required Future<void> Function(i1.Migrator m, Schema33 schema) from32To33,
|
||||
required Future<void> Function(i1.Migrator m, Schema34 schema) from33To34,
|
||||
required Future<void> Function(i1.Migrator m, Schema35 schema) from34To35,
|
||||
}) =>
|
||||
i0.VersionedSchema.stepByStepHelper(
|
||||
step: migrationSteps(
|
||||
@ -5557,4 +5894,6 @@ i1.OnUpgrade stepByStep({
|
||||
from30To31: from30To31,
|
||||
from31To32: from31To32,
|
||||
from32To33: from32To33,
|
||||
from33To34: from33To34,
|
||||
from34To35: from34To35,
|
||||
));
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -43,14 +43,14 @@ Future<void> seedDb(AppDatabase database) async {
|
||||
['BgheYcxhrsw', MediaType.youtube]
|
||||
];
|
||||
|
||||
final List<String> actionTypes = [
|
||||
"[[{\"actionID\": 0, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 1, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 2, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 3, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 4, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 5, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}]]",
|
||||
"[[{\"actionID\": 0, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 1, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 2, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 3, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 4, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 5, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 6, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 7, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 8, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 9, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 10, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 11, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 12, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 13, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 14, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 15, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 16, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 17, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 18, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 19, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}]]"
|
||||
];
|
||||
// final List<String> actionTypes = [
|
||||
// "[[{\"actionID\": 0, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 1, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 2, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 3, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 4, \"name\": \"1, 3, 5\", \"type\": \"repititions\", \"amount\": 1, \"weight\": 0}, {\"actionID\": 5, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}]]",
|
||||
// "[[{\"actionID\": 0, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 1, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 2, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 3, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 4, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 5, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 6, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 7, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 8, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 9, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 10, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 11, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 12, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 13, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 14, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 15, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}], [{\"actionID\": 16, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weight\": 80}, {\"actionID\": 17, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 5}, {\"actionID\": 18, \"name\": \"Long Pulls\", \"type\": \"seconds\", \"amount\": 5, \"weights\": 80}, {\"actionID\": 19, \"name\": \"Rest\", \"type\": \"seconds\", \"amount\": 300}]]"
|
||||
// ];
|
||||
|
||||
final int totalSessions = 15;
|
||||
final int totalActivities = 6;
|
||||
final int totalActions = 5;
|
||||
// final int totalActions = 5;
|
||||
final int totalMedia = 5;
|
||||
final random = Random();
|
||||
|
||||
@ -73,7 +73,8 @@ Future<void> seedDb(AppDatabase database) async {
|
||||
|
||||
Map<Symbol, Value> payload = {
|
||||
Symbol('title'): Value<String>(exercise['name']),
|
||||
Symbol('description'): Value<String>(json.encode(exercise['instructions'])),
|
||||
Symbol('description'):
|
||||
Value<String>(json.encode(exercise['instructions'])),
|
||||
Symbol('force'): Value<String>(exercise['force'] ?? "")
|
||||
};
|
||||
|
||||
@ -125,8 +126,7 @@ Future<void> seedDb(AppDatabase database) async {
|
||||
.into(database.mediaItems)
|
||||
.insert(MediaItemsCompanion.insert(
|
||||
title: exercise['name'],
|
||||
description:
|
||||
exercise['name'],
|
||||
description: exercise['name'],
|
||||
reference: mediaItem,
|
||||
type: MediaType.image))
|
||||
.then((mediaId) async {
|
||||
@ -175,32 +175,56 @@ Future<void> seedDb(AppDatabase database) async {
|
||||
));
|
||||
|
||||
// actions
|
||||
for (int k = 0; k <= random.nextInt(totalActions); k++) {
|
||||
await database
|
||||
.into(database.actions)
|
||||
.insert(ActionsCompanion.insert(
|
||||
title: 'Test action $k',
|
||||
description:
|
||||
'$k Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.',
|
||||
totalSets: 5,
|
||||
totalReps: "[1]",
|
||||
restBeforeSets: Value(30000),
|
||||
restBetweenSets: Value(300000),
|
||||
restBetweenReps: Value(15000),
|
||||
restAfterSets: Value(300000),
|
||||
repType: RepType.time,
|
||||
repLength: Value(10000),
|
||||
repWeights: Value("[110]"),
|
||||
setWeights: Value("[1]"),
|
||||
isAlternating: Value(true),
|
||||
set: actionTypes[random.nextInt(actionTypes.length)]))
|
||||
.then((actionId) async {
|
||||
// add activity action association
|
||||
await database.into(database.activityActions).insert(
|
||||
ActivityActionsCompanion.insert(
|
||||
activityId: activityId, actionId: actionId, position: k));
|
||||
});
|
||||
}
|
||||
// await database
|
||||
// .into(database.actions)
|
||||
// .insert(ActionsCompanion.insert(
|
||||
// title: 'Test action',
|
||||
// description:
|
||||
// 'Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.',
|
||||
// totalSets: 5,
|
||||
// totalReps: "[1]",
|
||||
// restBeforeSets: Value(30000),
|
||||
// restBetweenSets: Value(300000),
|
||||
// restBetweenReps: Value(15000),
|
||||
// restAfterSets: Value(300000),
|
||||
// repType: RepType.time,
|
||||
// repLength: Value(10000),
|
||||
// repWeights: Value("[110]"),
|
||||
// setWeights: Value("[1]"),
|
||||
// isAlternating: Value(true),
|
||||
// set: actionTypes[random.nextInt(actionTypes.length)]))
|
||||
// .then((actionId) async {
|
||||
// // add activity action association
|
||||
// await database.into(database.activityActions).insert(
|
||||
// ActivityActionsCompanion.insert(
|
||||
// activityId: activityId, actionId: actionId, sessionId: sessionId, position: 0));
|
||||
// });
|
||||
// for (int k = 0; k <= random.nextInt(totalActions); k++) {
|
||||
// await database
|
||||
// .into(database.actions)
|
||||
// .insert(ActionsCompanion.insert(
|
||||
// title: 'Test action $k',
|
||||
// description:
|
||||
// '$k Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.',
|
||||
// totalSets: 5,
|
||||
// totalReps: "[1]",
|
||||
// restBeforeSets: Value(30000),
|
||||
// restBetweenSets: Value(300000),
|
||||
// restBetweenReps: Value(15000),
|
||||
// restAfterSets: Value(300000),
|
||||
// repType: RepType.time,
|
||||
// repLength: Value(10000),
|
||||
// repWeights: Value("[110]"),
|
||||
// setWeights: Value("[1]"),
|
||||
// isAlternating: Value(true),
|
||||
// set: actionTypes[random.nextInt(actionTypes.length)]))
|
||||
// .then((actionId) async {
|
||||
// // add activity action association
|
||||
// await database.into(database.activityActions).insert(
|
||||
// ActivityActionsCompanion.insert(
|
||||
// activityId: activityId, actionId: actionId, position: k));
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
for (int n = 0; n <= random.nextInt(totalMedia); n++) {
|
||||
|
Reference in New Issue
Block a user