From be33f2c3d86234b261fb3d021bcbe6bb2532ceb8 Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Sat, 28 Jun 2025 14:43:09 +0200 Subject: [PATCH] regenerated drift database g dart --- lib/data/database.g.dart | 128 ++++++++++++++++++++++++++++++--------- 1 file changed, 98 insertions(+), 30 deletions(-) diff --git a/lib/data/database.g.dart b/lib/data/database.g.dart index 58c1e34..a3cb17e 100644 --- a/lib/data/database.g.dart +++ b/lib/data/database.g.dart @@ -913,15 +913,26 @@ class $MatchTableTable extends MatchTable late final GeneratedColumn groupId = GeneratedColumn( 'group_id', aliasedName, - true, + false, type: DriftSqlType.string, - requiredDuringInsert: false, + requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES group_table (id)', ), ); + static const VerificationMeta _createdAtMeta = const VerificationMeta( + 'createdAt', + ); @override - List get $columns => [id, gameId, groupId]; + late final GeneratedColumn createdAt = GeneratedColumn( + 'created_at', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + @override + List get $columns => [id, gameId, groupId, createdAt]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -952,6 +963,16 @@ class $MatchTableTable extends MatchTable _groupIdMeta, groupId.isAcceptableOrUnknown(data['group_id']!, _groupIdMeta), ); + } else if (isInserting) { + context.missing(_groupIdMeta); + } + if (data.containsKey('created_at')) { + context.handle( + _createdAtMeta, + createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), + ); + } else if (isInserting) { + context.missing(_createdAtMeta); } return context; } @@ -973,7 +994,11 @@ class $MatchTableTable extends MatchTable groupId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}group_id'], - ), + )!, + createdAt: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}created_at'], + )!, ); } @@ -986,16 +1011,21 @@ class $MatchTableTable extends MatchTable class MatchTableData extends DataClass implements Insertable { final String id; final int gameId; - final String? groupId; - const MatchTableData({required this.id, required this.gameId, this.groupId}); + final String groupId; + final DateTime createdAt; + const MatchTableData({ + required this.id, + required this.gameId, + required this.groupId, + required this.createdAt, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['game_id'] = Variable(gameId); - if (!nullToAbsent || groupId != null) { - map['group_id'] = Variable(groupId); - } + map['group_id'] = Variable(groupId); + map['created_at'] = Variable(createdAt); return map; } @@ -1003,9 +1033,8 @@ class MatchTableData extends DataClass implements Insertable { return MatchTableCompanion( id: Value(id), gameId: Value(gameId), - groupId: groupId == null && nullToAbsent - ? const Value.absent() - : Value(groupId), + groupId: Value(groupId), + createdAt: Value(createdAt), ); } @@ -1017,7 +1046,8 @@ class MatchTableData extends DataClass implements Insertable { return MatchTableData( id: serializer.fromJson(json['id']), gameId: serializer.fromJson(json['gameId']), - groupId: serializer.fromJson(json['groupId']), + groupId: serializer.fromJson(json['groupId']), + createdAt: serializer.fromJson(json['createdAt']), ); } @override @@ -1026,24 +1056,28 @@ class MatchTableData extends DataClass implements Insertable { return { 'id': serializer.toJson(id), 'gameId': serializer.toJson(gameId), - 'groupId': serializer.toJson(groupId), + 'groupId': serializer.toJson(groupId), + 'createdAt': serializer.toJson(createdAt), }; } MatchTableData copyWith({ String? id, int? gameId, - Value groupId = const Value.absent(), + String? groupId, + DateTime? createdAt, }) => MatchTableData( id: id ?? this.id, gameId: gameId ?? this.gameId, - groupId: groupId.present ? groupId.value : this.groupId, + groupId: groupId ?? this.groupId, + createdAt: createdAt ?? this.createdAt, ); MatchTableData copyWithCompanion(MatchTableCompanion data) { return MatchTableData( id: data.id.present ? data.id.value : this.id, gameId: data.gameId.present ? data.gameId.value : this.gameId, groupId: data.groupId.present ? data.groupId.value : this.groupId, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @@ -1052,50 +1086,59 @@ class MatchTableData extends DataClass implements Insertable { return (StringBuffer('MatchTableData(') ..write('id: $id, ') ..write('gameId: $gameId, ') - ..write('groupId: $groupId') + ..write('groupId: $groupId, ') + ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override - int get hashCode => Object.hash(id, gameId, groupId); + int get hashCode => Object.hash(id, gameId, groupId, createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is MatchTableData && other.id == this.id && other.gameId == this.gameId && - other.groupId == this.groupId); + other.groupId == this.groupId && + other.createdAt == this.createdAt); } class MatchTableCompanion extends UpdateCompanion { final Value id; final Value gameId; - final Value groupId; + final Value groupId; + final Value createdAt; final Value rowid; const MatchTableCompanion({ this.id = const Value.absent(), this.gameId = const Value.absent(), this.groupId = const Value.absent(), + this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); MatchTableCompanion.insert({ required String id, required int gameId, - this.groupId = const Value.absent(), + required String groupId, + required DateTime createdAt, this.rowid = const Value.absent(), }) : id = Value(id), - gameId = Value(gameId); + gameId = Value(gameId), + groupId = Value(groupId), + createdAt = Value(createdAt); static Insertable custom({ Expression? id, Expression? gameId, Expression? groupId, + Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (gameId != null) 'game_id': gameId, if (groupId != null) 'group_id': groupId, + if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } @@ -1103,13 +1146,15 @@ class MatchTableCompanion extends UpdateCompanion { MatchTableCompanion copyWith({ Value? id, Value? gameId, - Value? groupId, + Value? groupId, + Value? createdAt, Value? rowid, }) { return MatchTableCompanion( id: id ?? this.id, gameId: gameId ?? this.gameId, groupId: groupId ?? this.groupId, + createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @@ -1126,6 +1171,9 @@ class MatchTableCompanion extends UpdateCompanion { if (groupId.present) { map['group_id'] = Variable(groupId.value); } + if (createdAt.present) { + map['created_at'] = Variable(createdAt.value); + } if (rowid.present) { map['rowid'] = Variable(rowid.value); } @@ -1138,6 +1186,7 @@ class MatchTableCompanion extends UpdateCompanion { ..write('id: $id, ') ..write('gameId: $gameId, ') ..write('groupId: $groupId, ') + ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); @@ -3449,14 +3498,16 @@ typedef $$MatchTableTableCreateCompanionBuilder = MatchTableCompanion Function({ required String id, required int gameId, - Value groupId, + required String groupId, + required DateTime createdAt, Value rowid, }); typedef $$MatchTableTableUpdateCompanionBuilder = MatchTableCompanion Function({ Value id, Value gameId, - Value groupId, + Value groupId, + Value createdAt, Value rowid, }); @@ -3486,9 +3537,9 @@ final class $$MatchTableTableReferences $_aliasNameGenerator(db.matchTable.groupId, db.groupTable.id), ); - $$GroupTableTableProcessedTableManager? get groupId { - final $_column = $_itemColumn('group_id'); - if ($_column == null) return null; + $$GroupTableTableProcessedTableManager get groupId { + final $_column = $_itemColumn('group_id')!; + final manager = $$GroupTableTableTableManager( $_db, $_db.groupTable, @@ -3587,6 +3638,11 @@ class $$MatchTableTableFilterComposer builder: (column) => ColumnFilters(column), ); + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, + builder: (column) => ColumnFilters(column), + ); + $$GameTableTableFilterComposer get gameId { final $$GameTableTableFilterComposer composer = $composerBuilder( composer: this, @@ -3723,6 +3779,11 @@ class $$MatchTableTableOrderingComposer builder: (column) => ColumnOrderings(column), ); + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, + builder: (column) => ColumnOrderings(column), + ); + $$GameTableTableOrderingComposer get gameId { final $$GameTableTableOrderingComposer composer = $composerBuilder( composer: this, @@ -3782,6 +3843,9 @@ class $$MatchTableTableAnnotationComposer GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + $$GameTableTableAnnotationComposer get gameId { final $$GameTableTableAnnotationComposer composer = $composerBuilder( composer: this, @@ -3941,24 +4005,28 @@ class $$MatchTableTableTableManager ({ Value id = const Value.absent(), Value gameId = const Value.absent(), - Value groupId = const Value.absent(), + Value groupId = const Value.absent(), + Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => MatchTableCompanion( id: id, gameId: gameId, groupId: groupId, + createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required int gameId, - Value groupId = const Value.absent(), + required String groupId, + required DateTime createdAt, Value rowid = const Value.absent(), }) => MatchTableCompanion.insert( id: id, gameId: gameId, groupId: groupId, + createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0