2010 lines
69 KiB
Dart
2010 lines
69 KiB
Dart
// dart format width=80
|
|
// GENERATED CODE, DO NOT EDIT BY HAND.
|
|
// ignore_for_file: type=lint
|
|
import 'package:drift/drift.dart';
|
|
|
|
class Sessions extends Table with TableInfo<Sessions, SessionsData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
Sessions(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> content = GeneratedColumn<String>(
|
|
'body', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> address = GeneratedColumn<String>(
|
|
'address', aliasedName, true,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 256),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false);
|
|
late final GeneratedColumn<DateTime> date = GeneratedColumn<DateTime>(
|
|
'date', aliasedName, true,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: false);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, title, content, status, address, date, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'sessions';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
SessionsData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return SessionsData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
content: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}body'])!,
|
|
status: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}status'])!,
|
|
address: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}address']),
|
|
date: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}date']),
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Sessions createAlias(String alias) {
|
|
return Sessions(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class SessionsData extends DataClass implements Insertable<SessionsData> {
|
|
final int id;
|
|
final String title;
|
|
final String content;
|
|
final String status;
|
|
final String? address;
|
|
final DateTime? date;
|
|
final DateTime createdAt;
|
|
const SessionsData(
|
|
{required this.id,
|
|
required this.title,
|
|
required this.content,
|
|
required this.status,
|
|
this.address,
|
|
this.date,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['body'] = Variable<String>(content);
|
|
map['status'] = Variable<String>(status);
|
|
if (!nullToAbsent || address != null) {
|
|
map['address'] = Variable<String>(address);
|
|
}
|
|
if (!nullToAbsent || date != null) {
|
|
map['date'] = Variable<DateTime>(date);
|
|
}
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
SessionsCompanion toCompanion(bool nullToAbsent) {
|
|
return SessionsCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
content: Value(content),
|
|
status: Value(status),
|
|
address: address == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(address),
|
|
date: date == null && nullToAbsent ? const Value.absent() : Value(date),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory SessionsData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return SessionsData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
content: serializer.fromJson<String>(json['content']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
address: serializer.fromJson<String?>(json['address']),
|
|
date: serializer.fromJson<DateTime?>(json['date']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'content': serializer.toJson<String>(content),
|
|
'status': serializer.toJson<String>(status),
|
|
'address': serializer.toJson<String?>(address),
|
|
'date': serializer.toJson<DateTime?>(date),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
SessionsData copyWith(
|
|
{int? id,
|
|
String? title,
|
|
String? content,
|
|
String? status,
|
|
Value<String?> address = const Value.absent(),
|
|
Value<DateTime?> date = const Value.absent(),
|
|
DateTime? createdAt}) =>
|
|
SessionsData(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
content: content ?? this.content,
|
|
status: status ?? this.status,
|
|
address: address.present ? address.value : this.address,
|
|
date: date.present ? date.value : this.date,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
SessionsData copyWithCompanion(SessionsCompanion data) {
|
|
return SessionsData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
content: data.content.present ? data.content.value : this.content,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
address: data.address.present ? data.address.value : this.address,
|
|
date: data.date.present ? data.date.value : this.date,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SessionsData(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('content: $content, ')
|
|
..write('status: $status, ')
|
|
..write('address: $address, ')
|
|
..write('date: $date, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, title, content, status, address, date, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is SessionsData &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.content == this.content &&
|
|
other.status == this.status &&
|
|
other.address == this.address &&
|
|
other.date == this.date &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class SessionsCompanion extends UpdateCompanion<SessionsData> {
|
|
final Value<int> id;
|
|
final Value<String> title;
|
|
final Value<String> content;
|
|
final Value<String> status;
|
|
final Value<String?> address;
|
|
final Value<DateTime?> date;
|
|
final Value<DateTime> createdAt;
|
|
const SessionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.content = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.address = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
SessionsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String title,
|
|
required String content,
|
|
required String status,
|
|
this.address = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
}) : title = Value(title),
|
|
content = Value(content),
|
|
status = Value(status);
|
|
static Insertable<SessionsData> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? content,
|
|
Expression<String>? status,
|
|
Expression<String>? address,
|
|
Expression<DateTime>? date,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (content != null) 'body': content,
|
|
if (status != null) 'status': status,
|
|
if (address != null) 'address': address,
|
|
if (date != null) 'date': date,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
SessionsCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<String>? title,
|
|
Value<String>? content,
|
|
Value<String>? status,
|
|
Value<String?>? address,
|
|
Value<DateTime?>? date,
|
|
Value<DateTime>? createdAt}) {
|
|
return SessionsCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
content: content ?? this.content,
|
|
status: status ?? this.status,
|
|
address: address ?? this.address,
|
|
date: date ?? this.date,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (content.present) {
|
|
map['body'] = Variable<String>(content.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (address.present) {
|
|
map['address'] = Variable<String>(address.value);
|
|
}
|
|
if (date.present) {
|
|
map['date'] = Variable<DateTime>(date.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SessionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('content: $content, ')
|
|
..write('status: $status, ')
|
|
..write('address: $address, ')
|
|
..write('date: $date, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class Activities extends Table with TableInfo<Activities, ActivitiesData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
Activities(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> type = GeneratedColumn<String>(
|
|
'type', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'body', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, title, type, description, category, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'activities';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActivitiesData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActivitiesData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
type: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}type'])!,
|
|
description: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}body'])!,
|
|
category: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}category'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Activities createAlias(String alias) {
|
|
return Activities(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActivitiesData extends DataClass implements Insertable<ActivitiesData> {
|
|
final int id;
|
|
final String title;
|
|
final String type;
|
|
final String description;
|
|
final String category;
|
|
final DateTime createdAt;
|
|
const ActivitiesData(
|
|
{required this.id,
|
|
required this.title,
|
|
required this.type,
|
|
required this.description,
|
|
required this.category,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['type'] = Variable<String>(type);
|
|
map['body'] = Variable<String>(description);
|
|
map['category'] = Variable<String>(category);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ActivitiesCompanion toCompanion(bool nullToAbsent) {
|
|
return ActivitiesCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
type: Value(type),
|
|
description: Value(description),
|
|
category: Value(category),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory ActivitiesData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActivitiesData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
type: serializer.fromJson<String>(json['type']),
|
|
description: serializer.fromJson<String>(json['description']),
|
|
category: serializer.fromJson<String>(json['category']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'type': serializer.toJson<String>(type),
|
|
'description': serializer.toJson<String>(description),
|
|
'category': serializer.toJson<String>(category),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
ActivitiesData copyWith(
|
|
{int? id,
|
|
String? title,
|
|
String? type,
|
|
String? description,
|
|
String? category,
|
|
DateTime? createdAt}) =>
|
|
ActivitiesData(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
type: type ?? this.type,
|
|
description: description ?? this.description,
|
|
category: category ?? this.category,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
ActivitiesData copyWithCompanion(ActivitiesCompanion data) {
|
|
return ActivitiesData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
description:
|
|
data.description.present ? data.description.value : this.description,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActivitiesData(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('type: $type, ')
|
|
..write('description: $description, ')
|
|
..write('category: $category, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, title, type, description, category, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActivitiesData &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.type == this.type &&
|
|
other.description == this.description &&
|
|
other.category == this.category &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ActivitiesCompanion extends UpdateCompanion<ActivitiesData> {
|
|
final Value<int> id;
|
|
final Value<String> title;
|
|
final Value<String> type;
|
|
final Value<String> description;
|
|
final Value<String> category;
|
|
final Value<DateTime> createdAt;
|
|
const ActivitiesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
ActivitiesCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String title,
|
|
required String type,
|
|
required String description,
|
|
required String category,
|
|
this.createdAt = const Value.absent(),
|
|
}) : title = Value(title),
|
|
type = Value(type),
|
|
description = Value(description),
|
|
category = Value(category);
|
|
static Insertable<ActivitiesData> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? type,
|
|
Expression<String>? description,
|
|
Expression<String>? category,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (type != null) 'type': type,
|
|
if (description != null) 'body': description,
|
|
if (category != null) 'category': category,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
ActivitiesCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<String>? title,
|
|
Value<String>? type,
|
|
Value<String>? description,
|
|
Value<String>? category,
|
|
Value<DateTime>? createdAt}) {
|
|
return ActivitiesCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
type: type ?? this.type,
|
|
description: description ?? this.description,
|
|
category: category ?? this.category,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(type.value);
|
|
}
|
|
if (description.present) {
|
|
map['body'] = Variable<String>(description.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActivitiesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('type: $type, ')
|
|
..write('description: $description, ')
|
|
..write('category: $category, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class SessionActivities extends Table
|
|
with TableInfo<SessionActivities, SessionActivitiesData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
SessionActivities(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
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'));
|
|
late final GeneratedColumn<int> activityId = GeneratedColumn<int>(
|
|
'activity_id', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES activities (id) ON DELETE CASCADE'));
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position', aliasedName, false,
|
|
type: DriftSqlType.int, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> results = GeneratedColumn<String>(
|
|
'results', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
late final GeneratedColumn<String> achievements = GeneratedColumn<String>(
|
|
'achievements', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, sessionId, activityId, position, results, achievements, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'session_activities';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
SessionActivitiesData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return SessionActivitiesData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
sessionId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}session_id'])!,
|
|
activityId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}activity_id'])!,
|
|
position: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}position'])!,
|
|
results: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}results']),
|
|
achievements: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}achievements']),
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
SessionActivities createAlias(String alias) {
|
|
return SessionActivities(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class SessionActivitiesData extends DataClass
|
|
implements Insertable<SessionActivitiesData> {
|
|
final int id;
|
|
final int sessionId;
|
|
final int activityId;
|
|
final int position;
|
|
final String? results;
|
|
final String? achievements;
|
|
final DateTime createdAt;
|
|
const SessionActivitiesData(
|
|
{required this.id,
|
|
required this.sessionId,
|
|
required this.activityId,
|
|
required this.position,
|
|
this.results,
|
|
this.achievements,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['session_id'] = Variable<int>(sessionId);
|
|
map['activity_id'] = Variable<int>(activityId);
|
|
map['position'] = Variable<int>(position);
|
|
if (!nullToAbsent || results != null) {
|
|
map['results'] = Variable<String>(results);
|
|
}
|
|
if (!nullToAbsent || achievements != null) {
|
|
map['achievements'] = Variable<String>(achievements);
|
|
}
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
SessionActivitiesCompanion toCompanion(bool nullToAbsent) {
|
|
return SessionActivitiesCompanion(
|
|
id: Value(id),
|
|
sessionId: Value(sessionId),
|
|
activityId: Value(activityId),
|
|
position: Value(position),
|
|
results: results == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(results),
|
|
achievements: achievements == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(achievements),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory SessionActivitiesData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return SessionActivitiesData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
sessionId: serializer.fromJson<int>(json['sessionId']),
|
|
activityId: serializer.fromJson<int>(json['activityId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
results: serializer.fromJson<String?>(json['results']),
|
|
achievements: serializer.fromJson<String?>(json['achievements']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'sessionId': serializer.toJson<int>(sessionId),
|
|
'activityId': serializer.toJson<int>(activityId),
|
|
'position': serializer.toJson<int>(position),
|
|
'results': serializer.toJson<String?>(results),
|
|
'achievements': serializer.toJson<String?>(achievements),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
SessionActivitiesData copyWith(
|
|
{int? id,
|
|
int? sessionId,
|
|
int? activityId,
|
|
int? position,
|
|
Value<String?> results = const Value.absent(),
|
|
Value<String?> achievements = const Value.absent(),
|
|
DateTime? createdAt}) =>
|
|
SessionActivitiesData(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
activityId: activityId ?? this.activityId,
|
|
position: position ?? this.position,
|
|
results: results.present ? results.value : this.results,
|
|
achievements:
|
|
achievements.present ? achievements.value : this.achievements,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
SessionActivitiesData copyWithCompanion(SessionActivitiesCompanion data) {
|
|
return SessionActivitiesData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
|
|
activityId:
|
|
data.activityId.present ? data.activityId.value : this.activityId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
results: data.results.present ? data.results.value : this.results,
|
|
achievements: data.achievements.present
|
|
? data.achievements.value
|
|
: this.achievements,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SessionActivitiesData(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('activityId: $activityId, ')
|
|
..write('position: $position, ')
|
|
..write('results: $results, ')
|
|
..write('achievements: $achievements, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id, sessionId, activityId, position, results, achievements, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is SessionActivitiesData &&
|
|
other.id == this.id &&
|
|
other.sessionId == this.sessionId &&
|
|
other.activityId == this.activityId &&
|
|
other.position == this.position &&
|
|
other.results == this.results &&
|
|
other.achievements == this.achievements &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class SessionActivitiesCompanion
|
|
extends UpdateCompanion<SessionActivitiesData> {
|
|
final Value<int> id;
|
|
final Value<int> sessionId;
|
|
final Value<int> activityId;
|
|
final Value<int> position;
|
|
final Value<String?> results;
|
|
final Value<String?> achievements;
|
|
final Value<DateTime> createdAt;
|
|
const SessionActivitiesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.sessionId = const Value.absent(),
|
|
this.activityId = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.results = const Value.absent(),
|
|
this.achievements = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
SessionActivitiesCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required int sessionId,
|
|
required int activityId,
|
|
required int position,
|
|
this.results = const Value.absent(),
|
|
this.achievements = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
}) : sessionId = Value(sessionId),
|
|
activityId = Value(activityId),
|
|
position = Value(position);
|
|
static Insertable<SessionActivitiesData> custom({
|
|
Expression<int>? id,
|
|
Expression<int>? sessionId,
|
|
Expression<int>? activityId,
|
|
Expression<int>? position,
|
|
Expression<String>? results,
|
|
Expression<String>? achievements,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (sessionId != null) 'session_id': sessionId,
|
|
if (activityId != null) 'activity_id': activityId,
|
|
if (position != null) 'position': position,
|
|
if (results != null) 'results': results,
|
|
if (achievements != null) 'achievements': achievements,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
SessionActivitiesCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<int>? sessionId,
|
|
Value<int>? activityId,
|
|
Value<int>? position,
|
|
Value<String?>? results,
|
|
Value<String?>? achievements,
|
|
Value<DateTime>? createdAt}) {
|
|
return SessionActivitiesCompanion(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
activityId: activityId ?? this.activityId,
|
|
position: position ?? this.position,
|
|
results: results ?? this.results,
|
|
achievements: achievements ?? this.achievements,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (sessionId.present) {
|
|
map['session_id'] = Variable<int>(sessionId.value);
|
|
}
|
|
if (activityId.present) {
|
|
map['activity_id'] = Variable<int>(activityId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (results.present) {
|
|
map['results'] = Variable<String>(results.value);
|
|
}
|
|
if (achievements.present) {
|
|
map['achievements'] = Variable<String>(achievements.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SessionActivitiesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('activityId: $activityId, ')
|
|
..write('position: $position, ')
|
|
..write('results: $results, ')
|
|
..write('achievements: $achievements, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class Actions extends Table with TableInfo<Actions, ActionsData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
Actions(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'body', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> set = GeneratedColumn<String>(
|
|
'set', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, title, description, set, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'actions';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActionsData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActionsData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
description: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}body'])!,
|
|
set: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}set'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Actions createAlias(String alias) {
|
|
return Actions(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActionsData extends DataClass implements Insertable<ActionsData> {
|
|
final int id;
|
|
final String title;
|
|
final String description;
|
|
final String set;
|
|
final DateTime createdAt;
|
|
const ActionsData(
|
|
{required this.id,
|
|
required this.title,
|
|
required this.description,
|
|
required this.set,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['body'] = Variable<String>(description);
|
|
map['set'] = Variable<String>(set);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ActionsCompanion toCompanion(bool nullToAbsent) {
|
|
return ActionsCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
description: Value(description),
|
|
set: Value(set),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory ActionsData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActionsData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
description: serializer.fromJson<String>(json['description']),
|
|
set: serializer.fromJson<String>(json['set']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'description': serializer.toJson<String>(description),
|
|
'set': serializer.toJson<String>(set),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
ActionsData copyWith(
|
|
{int? id,
|
|
String? title,
|
|
String? description,
|
|
String? set,
|
|
DateTime? createdAt}) =>
|
|
ActionsData(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
set: set ?? this.set,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
ActionsData copyWithCompanion(ActionsCompanion data) {
|
|
return ActionsData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
description:
|
|
data.description.present ? data.description.value : this.description,
|
|
set: data.set.present ? data.set.value : this.set,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActionsData(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('set: $set, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, title, description, set, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActionsData &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.description == this.description &&
|
|
other.set == this.set &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ActionsCompanion extends UpdateCompanion<ActionsData> {
|
|
final Value<int> id;
|
|
final Value<String> title;
|
|
final Value<String> description;
|
|
final Value<String> set;
|
|
final Value<DateTime> createdAt;
|
|
const ActionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.set = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
ActionsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String title,
|
|
required String description,
|
|
required String set,
|
|
this.createdAt = const Value.absent(),
|
|
}) : title = Value(title),
|
|
description = Value(description),
|
|
set = Value(set);
|
|
static Insertable<ActionsData> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? description,
|
|
Expression<String>? set,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (description != null) 'body': description,
|
|
if (set != null) 'set': set,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
ActionsCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<String>? title,
|
|
Value<String>? description,
|
|
Value<String>? set,
|
|
Value<DateTime>? createdAt}) {
|
|
return ActionsCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
set: set ?? this.set,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (description.present) {
|
|
map['body'] = Variable<String>(description.value);
|
|
}
|
|
if (set.present) {
|
|
map['set'] = Variable<String>(set.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('set: $set, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class ActivityActions extends Table
|
|
with TableInfo<ActivityActions, ActivityActionsData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
ActivityActions(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<int> activityId = GeneratedColumn<int>(
|
|
'activity_id', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES activities (id) ON DELETE CASCADE'));
|
|
late final GeneratedColumn<int> actionId = GeneratedColumn<int>(
|
|
'action_id', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES actions (id) ON DELETE CASCADE'));
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position', aliasedName, false,
|
|
type: DriftSqlType.int, requiredDuringInsert: true);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, activityId, actionId, position, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'activity_actions';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ActivityActionsData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ActivityActionsData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
activityId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}activity_id'])!,
|
|
actionId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}action_id'])!,
|
|
position: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}position'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
ActivityActions createAlias(String alias) {
|
|
return ActivityActions(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ActivityActionsData extends DataClass
|
|
implements Insertable<ActivityActionsData> {
|
|
final int id;
|
|
final int activityId;
|
|
final int actionId;
|
|
final int position;
|
|
final DateTime createdAt;
|
|
const ActivityActionsData(
|
|
{required this.id,
|
|
required this.activityId,
|
|
required this.actionId,
|
|
required this.position,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['activity_id'] = Variable<int>(activityId);
|
|
map['action_id'] = Variable<int>(actionId);
|
|
map['position'] = Variable<int>(position);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ActivityActionsCompanion toCompanion(bool nullToAbsent) {
|
|
return ActivityActionsCompanion(
|
|
id: Value(id),
|
|
activityId: Value(activityId),
|
|
actionId: Value(actionId),
|
|
position: Value(position),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory ActivityActionsData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ActivityActionsData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
activityId: serializer.fromJson<int>(json['activityId']),
|
|
actionId: serializer.fromJson<int>(json['actionId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'activityId': serializer.toJson<int>(activityId),
|
|
'actionId': serializer.toJson<int>(actionId),
|
|
'position': serializer.toJson<int>(position),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
ActivityActionsData copyWith(
|
|
{int? id,
|
|
int? activityId,
|
|
int? actionId,
|
|
int? position,
|
|
DateTime? createdAt}) =>
|
|
ActivityActionsData(
|
|
id: id ?? this.id,
|
|
activityId: activityId ?? this.activityId,
|
|
actionId: actionId ?? this.actionId,
|
|
position: position ?? this.position,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
ActivityActionsData copyWithCompanion(ActivityActionsCompanion data) {
|
|
return ActivityActionsData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
activityId:
|
|
data.activityId.present ? data.activityId.value : this.activityId,
|
|
actionId: data.actionId.present ? data.actionId.value : this.actionId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActivityActionsData(')
|
|
..write('id: $id, ')
|
|
..write('activityId: $activityId, ')
|
|
..write('actionId: $actionId, ')
|
|
..write('position: $position, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, activityId, actionId, position, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ActivityActionsData &&
|
|
other.id == this.id &&
|
|
other.activityId == this.activityId &&
|
|
other.actionId == this.actionId &&
|
|
other.position == this.position &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ActivityActionsCompanion extends UpdateCompanion<ActivityActionsData> {
|
|
final Value<int> id;
|
|
final Value<int> activityId;
|
|
final Value<int> actionId;
|
|
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.position = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
ActivityActionsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required int activityId,
|
|
required int actionId,
|
|
required int position,
|
|
this.createdAt = const Value.absent(),
|
|
}) : activityId = Value(activityId),
|
|
actionId = Value(actionId),
|
|
position = Value(position);
|
|
static Insertable<ActivityActionsData> custom({
|
|
Expression<int>? id,
|
|
Expression<int>? activityId,
|
|
Expression<int>? actionId,
|
|
Expression<int>? position,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (activityId != null) 'activity_id': activityId,
|
|
if (actionId != null) 'action_id': actionId,
|
|
if (position != null) 'position': position,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
ActivityActionsCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<int>? activityId,
|
|
Value<int>? actionId,
|
|
Value<int>? position,
|
|
Value<DateTime>? createdAt}) {
|
|
return ActivityActionsCompanion(
|
|
id: id ?? this.id,
|
|
activityId: activityId ?? this.activityId,
|
|
actionId: actionId ?? this.actionId,
|
|
position: position ?? this.position,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (activityId.present) {
|
|
map['activity_id'] = Variable<int>(activityId.value);
|
|
}
|
|
if (actionId.present) {
|
|
map['action_id'] = Variable<int>(actionId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ActivityActionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('activityId: $activityId, ')
|
|
..write('actionId: $actionId, ')
|
|
..write('position: $position, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class MediaItems extends Table with TableInfo<MediaItems, MediaItemsData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
MediaItems(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 3, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'body', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> reference = GeneratedColumn<String>(
|
|
'reference', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> type = GeneratedColumn<String>(
|
|
'type', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, title, description, reference, type, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'media_items';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
MediaItemsData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return MediaItemsData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
description: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}body'])!,
|
|
reference: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}reference'])!,
|
|
type: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}type'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
MediaItems createAlias(String alias) {
|
|
return MediaItems(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class MediaItemsData extends DataClass implements Insertable<MediaItemsData> {
|
|
final int id;
|
|
final String title;
|
|
final String description;
|
|
final String reference;
|
|
final String type;
|
|
final DateTime createdAt;
|
|
const MediaItemsData(
|
|
{required this.id,
|
|
required this.title,
|
|
required this.description,
|
|
required this.reference,
|
|
required this.type,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['body'] = Variable<String>(description);
|
|
map['reference'] = Variable<String>(reference);
|
|
map['type'] = Variable<String>(type);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
MediaItemsCompanion toCompanion(bool nullToAbsent) {
|
|
return MediaItemsCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
description: Value(description),
|
|
reference: Value(reference),
|
|
type: Value(type),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory MediaItemsData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return MediaItemsData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
description: serializer.fromJson<String>(json['description']),
|
|
reference: serializer.fromJson<String>(json['reference']),
|
|
type: serializer.fromJson<String>(json['type']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'description': serializer.toJson<String>(description),
|
|
'reference': serializer.toJson<String>(reference),
|
|
'type': serializer.toJson<String>(type),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
MediaItemsData copyWith(
|
|
{int? id,
|
|
String? title,
|
|
String? description,
|
|
String? reference,
|
|
String? type,
|
|
DateTime? createdAt}) =>
|
|
MediaItemsData(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
reference: reference ?? this.reference,
|
|
type: type ?? this.type,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
MediaItemsData copyWithCompanion(MediaItemsCompanion data) {
|
|
return MediaItemsData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
description:
|
|
data.description.present ? data.description.value : this.description,
|
|
reference: data.reference.present ? data.reference.value : this.reference,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MediaItemsData(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('reference: $reference, ')
|
|
..write('type: $type, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, title, description, reference, type, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is MediaItemsData &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.description == this.description &&
|
|
other.reference == this.reference &&
|
|
other.type == this.type &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class MediaItemsCompanion extends UpdateCompanion<MediaItemsData> {
|
|
final Value<int> id;
|
|
final Value<String> title;
|
|
final Value<String> description;
|
|
final Value<String> reference;
|
|
final Value<String> type;
|
|
final Value<DateTime> createdAt;
|
|
const MediaItemsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.reference = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
MediaItemsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String title,
|
|
required String description,
|
|
required String reference,
|
|
required String type,
|
|
this.createdAt = const Value.absent(),
|
|
}) : title = Value(title),
|
|
description = Value(description),
|
|
reference = Value(reference),
|
|
type = Value(type);
|
|
static Insertable<MediaItemsData> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? description,
|
|
Expression<String>? reference,
|
|
Expression<String>? type,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (description != null) 'body': description,
|
|
if (reference != null) 'reference': reference,
|
|
if (type != null) 'type': type,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
MediaItemsCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<String>? title,
|
|
Value<String>? description,
|
|
Value<String>? reference,
|
|
Value<String>? type,
|
|
Value<DateTime>? createdAt}) {
|
|
return MediaItemsCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
reference: reference ?? this.reference,
|
|
type: type ?? this.type,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (description.present) {
|
|
map['body'] = Variable<String>(description.value);
|
|
}
|
|
if (reference.present) {
|
|
map['reference'] = Variable<String>(reference.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(type.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MediaItemsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('reference: $reference, ')
|
|
..write('type: $type, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class ObjectMediaItems extends Table
|
|
with TableInfo<ObjectMediaItems, ObjectMediaItemsData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
ObjectMediaItems(this.attachedDatabase, [this._alias]);
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
late final GeneratedColumn<int> objectId = GeneratedColumn<int>(
|
|
'object_id', aliasedName, false,
|
|
type: DriftSqlType.int, requiredDuringInsert: true);
|
|
late final GeneratedColumn<String> objectType = GeneratedColumn<String>(
|
|
'object_type', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
late final GeneratedColumn<int> mediaId = GeneratedColumn<int>(
|
|
'media_id', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES media_items (id) ON DELETE CASCADE'));
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: Variable(DateTime.now()));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, objectId, objectType, mediaId, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'object_media_items';
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ObjectMediaItemsData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ObjectMediaItemsData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
objectId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}object_id'])!,
|
|
objectType: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}object_type'])!,
|
|
mediaId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}media_id'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
ObjectMediaItems createAlias(String alias) {
|
|
return ObjectMediaItems(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ObjectMediaItemsData extends DataClass
|
|
implements Insertable<ObjectMediaItemsData> {
|
|
final int id;
|
|
final int objectId;
|
|
final String objectType;
|
|
final int mediaId;
|
|
final DateTime createdAt;
|
|
const ObjectMediaItemsData(
|
|
{required this.id,
|
|
required this.objectId,
|
|
required this.objectType,
|
|
required this.mediaId,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['object_id'] = Variable<int>(objectId);
|
|
map['object_type'] = Variable<String>(objectType);
|
|
map['media_id'] = Variable<int>(mediaId);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ObjectMediaItemsCompanion toCompanion(bool nullToAbsent) {
|
|
return ObjectMediaItemsCompanion(
|
|
id: Value(id),
|
|
objectId: Value(objectId),
|
|
objectType: Value(objectType),
|
|
mediaId: Value(mediaId),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory ObjectMediaItemsData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ObjectMediaItemsData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
objectId: serializer.fromJson<int>(json['objectId']),
|
|
objectType: serializer.fromJson<String>(json['objectType']),
|
|
mediaId: serializer.fromJson<int>(json['mediaId']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'objectId': serializer.toJson<int>(objectId),
|
|
'objectType': serializer.toJson<String>(objectType),
|
|
'mediaId': serializer.toJson<int>(mediaId),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
ObjectMediaItemsData copyWith(
|
|
{int? id,
|
|
int? objectId,
|
|
String? objectType,
|
|
int? mediaId,
|
|
DateTime? createdAt}) =>
|
|
ObjectMediaItemsData(
|
|
id: id ?? this.id,
|
|
objectId: objectId ?? this.objectId,
|
|
objectType: objectType ?? this.objectType,
|
|
mediaId: mediaId ?? this.mediaId,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
ObjectMediaItemsData copyWithCompanion(ObjectMediaItemsCompanion data) {
|
|
return ObjectMediaItemsData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
objectId: data.objectId.present ? data.objectId.value : this.objectId,
|
|
objectType:
|
|
data.objectType.present ? data.objectType.value : this.objectType,
|
|
mediaId: data.mediaId.present ? data.mediaId.value : this.mediaId,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ObjectMediaItemsData(')
|
|
..write('id: $id, ')
|
|
..write('objectId: $objectId, ')
|
|
..write('objectType: $objectType, ')
|
|
..write('mediaId: $mediaId, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, objectId, objectType, mediaId, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ObjectMediaItemsData &&
|
|
other.id == this.id &&
|
|
other.objectId == this.objectId &&
|
|
other.objectType == this.objectType &&
|
|
other.mediaId == this.mediaId &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ObjectMediaItemsCompanion extends UpdateCompanion<ObjectMediaItemsData> {
|
|
final Value<int> id;
|
|
final Value<int> objectId;
|
|
final Value<String> objectType;
|
|
final Value<int> mediaId;
|
|
final Value<DateTime> createdAt;
|
|
const ObjectMediaItemsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.objectId = const Value.absent(),
|
|
this.objectType = const Value.absent(),
|
|
this.mediaId = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
});
|
|
ObjectMediaItemsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required int objectId,
|
|
required String objectType,
|
|
required int mediaId,
|
|
this.createdAt = const Value.absent(),
|
|
}) : objectId = Value(objectId),
|
|
objectType = Value(objectType),
|
|
mediaId = Value(mediaId);
|
|
static Insertable<ObjectMediaItemsData> custom({
|
|
Expression<int>? id,
|
|
Expression<int>? objectId,
|
|
Expression<String>? objectType,
|
|
Expression<int>? mediaId,
|
|
Expression<DateTime>? createdAt,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (objectId != null) 'object_id': objectId,
|
|
if (objectType != null) 'object_type': objectType,
|
|
if (mediaId != null) 'media_id': mediaId,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
});
|
|
}
|
|
|
|
ObjectMediaItemsCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<int>? objectId,
|
|
Value<String>? objectType,
|
|
Value<int>? mediaId,
|
|
Value<DateTime>? createdAt}) {
|
|
return ObjectMediaItemsCompanion(
|
|
id: id ?? this.id,
|
|
objectId: objectId ?? this.objectId,
|
|
objectType: objectType ?? this.objectType,
|
|
mediaId: mediaId ?? this.mediaId,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (objectId.present) {
|
|
map['object_id'] = Variable<int>(objectId.value);
|
|
}
|
|
if (objectType.present) {
|
|
map['object_type'] = Variable<String>(objectType.value);
|
|
}
|
|
if (mediaId.present) {
|
|
map['media_id'] = Variable<int>(mediaId.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ObjectMediaItemsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('objectId: $objectId, ')
|
|
..write('objectType: $objectType, ')
|
|
..write('mediaId: $mediaId, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class DatabaseAtV9 extends GeneratedDatabase {
|
|
DatabaseAtV9(QueryExecutor e) : super(e);
|
|
late final Sessions sessions = Sessions(this);
|
|
late final Activities activities = Activities(this);
|
|
late final SessionActivities sessionActivities = SessionActivities(this);
|
|
late final Actions actions = Actions(this);
|
|
late final ActivityActions activityActions = ActivityActions(this);
|
|
late final MediaItems mediaItems = MediaItems(this);
|
|
late final ObjectMediaItems objectMediaItems = ObjectMediaItems(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
sessions,
|
|
activities,
|
|
sessionActivities,
|
|
actions,
|
|
activityActions,
|
|
mediaItems,
|
|
objectMediaItems
|
|
];
|
|
@override
|
|
int get schemaVersion => 9;
|
|
}
|