1584 lines
52 KiB
Dart
1584 lines
52 KiB
Dart
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|||
|
|
|
|||
|
|
part of 'task_store.dart';
|
|||
|
|
|
|||
|
|
// ignore_for_file: type=lint
|
|||
|
|
class $UploadTasksTable extends UploadTasks
|
|||
|
|
with TableInfo<$UploadTasksTable, UploadTask> {
|
|||
|
|
@override
|
|||
|
|
final GeneratedDatabase attachedDatabase;
|
|||
|
|
final String? _alias;
|
|||
|
|
$UploadTasksTable(this.attachedDatabase, [this._alias]);
|
|||
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|||
|
|
'id',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _accountIdMeta = const VerificationMeta(
|
|||
|
|
'accountId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> accountId = GeneratedColumn<String>(
|
|||
|
|
'account_id',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _albumIdMeta = const VerificationMeta(
|
|||
|
|
'albumId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> albumId = GeneratedColumn<String>(
|
|||
|
|
'album_id',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _categoryIdMeta = const VerificationMeta(
|
|||
|
|
'categoryId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> categoryId = GeneratedColumn<String>(
|
|||
|
|
'category_id',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _clientTaskIdMeta = const VerificationMeta(
|
|||
|
|
'clientTaskId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> clientTaskId = GeneratedColumn<String>(
|
|||
|
|
'client_task_id',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _sourceFilePathMeta = const VerificationMeta(
|
|||
|
|
'sourceFilePath',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> sourceFilePath = GeneratedColumn<String>(
|
|||
|
|
'source_file_path',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _filenameMeta = const VerificationMeta(
|
|||
|
|
'filename',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> filename = GeneratedColumn<String>(
|
|||
|
|
'filename',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _bytesMeta = const VerificationMeta('bytes');
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<int> bytes = GeneratedColumn<int>(
|
|||
|
|
'bytes',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.int,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _contentTypeMeta = const VerificationMeta(
|
|||
|
|
'contentType',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> contentType = GeneratedColumn<String>(
|
|||
|
|
'content_type',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumnWithTypeConverter<UploadTaskState, String> state =
|
|||
|
|
GeneratedColumn<String>(
|
|||
|
|
'state',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
).withConverter<UploadTaskState>($UploadTasksTable.$converterstate);
|
|||
|
|
static const VerificationMeta _attemptMeta = const VerificationMeta(
|
|||
|
|
'attempt',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<int> attempt = GeneratedColumn<int>(
|
|||
|
|
'attempt',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.int,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
defaultValue: const Constant(0),
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _nextRetryAtMeta = const VerificationMeta(
|
|||
|
|
'nextRetryAt',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<DateTime> nextRetryAt = GeneratedColumn<DateTime>(
|
|||
|
|
'next_retry_at',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.dateTime,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _serverUploadIdMeta = const VerificationMeta(
|
|||
|
|
'serverUploadId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> serverUploadId = GeneratedColumn<String>(
|
|||
|
|
'server_upload_id',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _serverPhotoIdMeta = const VerificationMeta(
|
|||
|
|
'serverPhotoId',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> serverPhotoId = GeneratedColumn<String>(
|
|||
|
|
'server_photo_id',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _lastErrorMeta = const VerificationMeta(
|
|||
|
|
'lastError',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<String> lastError = GeneratedColumn<String>(
|
|||
|
|
'last_error',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.string,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _cleanedAtMeta = const VerificationMeta(
|
|||
|
|
'cleanedAt',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<DateTime> cleanedAt = GeneratedColumn<DateTime>(
|
|||
|
|
'cleaned_at',
|
|||
|
|
aliasedName,
|
|||
|
|
true,
|
|||
|
|
type: DriftSqlType.dateTime,
|
|||
|
|
requiredDuringInsert: false,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|||
|
|
'createdAt',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|||
|
|
'created_at',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.dateTime,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|||
|
|
'updatedAt',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|||
|
|
'updated_at',
|
|||
|
|
aliasedName,
|
|||
|
|
false,
|
|||
|
|
type: DriftSqlType.dateTime,
|
|||
|
|
requiredDuringInsert: true,
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
List<GeneratedColumn> get $columns => [
|
|||
|
|
id,
|
|||
|
|
accountId,
|
|||
|
|
albumId,
|
|||
|
|
categoryId,
|
|||
|
|
clientTaskId,
|
|||
|
|
sourceFilePath,
|
|||
|
|
filename,
|
|||
|
|
bytes,
|
|||
|
|
contentType,
|
|||
|
|
state,
|
|||
|
|
attempt,
|
|||
|
|
nextRetryAt,
|
|||
|
|
serverUploadId,
|
|||
|
|
serverPhotoId,
|
|||
|
|
lastError,
|
|||
|
|
cleanedAt,
|
|||
|
|
createdAt,
|
|||
|
|
updatedAt,
|
|||
|
|
];
|
|||
|
|
@override
|
|||
|
|
String get aliasedName => _alias ?? actualTableName;
|
|||
|
|
@override
|
|||
|
|
String get actualTableName => $name;
|
|||
|
|
static const String $name = 'upload_tasks';
|
|||
|
|
@override
|
|||
|
|
VerificationContext validateIntegrity(
|
|||
|
|
Insertable<UploadTask> instance, {
|
|||
|
|
bool isInserting = false,
|
|||
|
|
}) {
|
|||
|
|
final context = VerificationContext();
|
|||
|
|
final data = instance.toColumns(true);
|
|||
|
|
if (data.containsKey('id')) {
|
|||
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_idMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('account_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_accountIdMeta,
|
|||
|
|
accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_accountIdMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('album_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_albumIdMeta,
|
|||
|
|
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_albumIdMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('category_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_categoryIdMeta,
|
|||
|
|
categoryId.isAcceptableOrUnknown(data['category_id']!, _categoryIdMeta),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('client_task_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_clientTaskIdMeta,
|
|||
|
|
clientTaskId.isAcceptableOrUnknown(
|
|||
|
|
data['client_task_id']!,
|
|||
|
|
_clientTaskIdMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_clientTaskIdMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('source_file_path')) {
|
|||
|
|
context.handle(
|
|||
|
|
_sourceFilePathMeta,
|
|||
|
|
sourceFilePath.isAcceptableOrUnknown(
|
|||
|
|
data['source_file_path']!,
|
|||
|
|
_sourceFilePathMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_sourceFilePathMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('filename')) {
|
|||
|
|
context.handle(
|
|||
|
|
_filenameMeta,
|
|||
|
|
filename.isAcceptableOrUnknown(data['filename']!, _filenameMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_filenameMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('bytes')) {
|
|||
|
|
context.handle(
|
|||
|
|
_bytesMeta,
|
|||
|
|
bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_bytesMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('content_type')) {
|
|||
|
|
context.handle(
|
|||
|
|
_contentTypeMeta,
|
|||
|
|
contentType.isAcceptableOrUnknown(
|
|||
|
|
data['content_type']!,
|
|||
|
|
_contentTypeMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_contentTypeMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('attempt')) {
|
|||
|
|
context.handle(
|
|||
|
|
_attemptMeta,
|
|||
|
|
attempt.isAcceptableOrUnknown(data['attempt']!, _attemptMeta),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('next_retry_at')) {
|
|||
|
|
context.handle(
|
|||
|
|
_nextRetryAtMeta,
|
|||
|
|
nextRetryAt.isAcceptableOrUnknown(
|
|||
|
|
data['next_retry_at']!,
|
|||
|
|
_nextRetryAtMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('server_upload_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_serverUploadIdMeta,
|
|||
|
|
serverUploadId.isAcceptableOrUnknown(
|
|||
|
|
data['server_upload_id']!,
|
|||
|
|
_serverUploadIdMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('server_photo_id')) {
|
|||
|
|
context.handle(
|
|||
|
|
_serverPhotoIdMeta,
|
|||
|
|
serverPhotoId.isAcceptableOrUnknown(
|
|||
|
|
data['server_photo_id']!,
|
|||
|
|
_serverPhotoIdMeta,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('last_error')) {
|
|||
|
|
context.handle(
|
|||
|
|
_lastErrorMeta,
|
|||
|
|
lastError.isAcceptableOrUnknown(data['last_error']!, _lastErrorMeta),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('cleaned_at')) {
|
|||
|
|
context.handle(
|
|||
|
|
_cleanedAtMeta,
|
|||
|
|
cleanedAt.isAcceptableOrUnknown(data['cleaned_at']!, _cleanedAtMeta),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('created_at')) {
|
|||
|
|
context.handle(
|
|||
|
|
_createdAtMeta,
|
|||
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_createdAtMeta);
|
|||
|
|
}
|
|||
|
|
if (data.containsKey('updated_at')) {
|
|||
|
|
context.handle(
|
|||
|
|
_updatedAtMeta,
|
|||
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|||
|
|
);
|
|||
|
|
} else if (isInserting) {
|
|||
|
|
context.missing(_updatedAtMeta);
|
|||
|
|
}
|
|||
|
|
return context;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|||
|
|
@override
|
|||
|
|
UploadTask map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|||
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|||
|
|
return UploadTask(
|
|||
|
|
id: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}id'],
|
|||
|
|
)!,
|
|||
|
|
accountId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}account_id'],
|
|||
|
|
)!,
|
|||
|
|
albumId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}album_id'],
|
|||
|
|
)!,
|
|||
|
|
categoryId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}category_id'],
|
|||
|
|
),
|
|||
|
|
clientTaskId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}client_task_id'],
|
|||
|
|
)!,
|
|||
|
|
sourceFilePath: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}source_file_path'],
|
|||
|
|
)!,
|
|||
|
|
filename: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}filename'],
|
|||
|
|
)!,
|
|||
|
|
bytes: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.int,
|
|||
|
|
data['${effectivePrefix}bytes'],
|
|||
|
|
)!,
|
|||
|
|
contentType: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}content_type'],
|
|||
|
|
)!,
|
|||
|
|
state: $UploadTasksTable.$converterstate.fromSql(
|
|||
|
|
attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}state'],
|
|||
|
|
)!,
|
|||
|
|
),
|
|||
|
|
attempt: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.int,
|
|||
|
|
data['${effectivePrefix}attempt'],
|
|||
|
|
)!,
|
|||
|
|
nextRetryAt: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.dateTime,
|
|||
|
|
data['${effectivePrefix}next_retry_at'],
|
|||
|
|
),
|
|||
|
|
serverUploadId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}server_upload_id'],
|
|||
|
|
),
|
|||
|
|
serverPhotoId: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}server_photo_id'],
|
|||
|
|
),
|
|||
|
|
lastError: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.string,
|
|||
|
|
data['${effectivePrefix}last_error'],
|
|||
|
|
),
|
|||
|
|
cleanedAt: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.dateTime,
|
|||
|
|
data['${effectivePrefix}cleaned_at'],
|
|||
|
|
),
|
|||
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.dateTime,
|
|||
|
|
data['${effectivePrefix}created_at'],
|
|||
|
|
)!,
|
|||
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|||
|
|
DriftSqlType.dateTime,
|
|||
|
|
data['${effectivePrefix}updated_at'],
|
|||
|
|
)!,
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
$UploadTasksTable createAlias(String alias) {
|
|||
|
|
return $UploadTasksTable(attachedDatabase, alias);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
static TypeConverter<UploadTaskState, String> $converterstate =
|
|||
|
|
const _UploadTaskStateConverter();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class UploadTask extends DataClass implements Insertable<UploadTask> {
|
|||
|
|
/// 任务 ID(客户端生成 uuid,PK;与服务端 uploadId 无关)。
|
|||
|
|
final String id;
|
|||
|
|
|
|||
|
|
/// 账号隔离键(登录账号,见 Session.account)。
|
|||
|
|
final String accountId;
|
|||
|
|
|
|||
|
|
/// 目标相册 ID。
|
|||
|
|
final String albumId;
|
|||
|
|
|
|||
|
|
/// 目标分类 ID;缺省为相册默认分类(契约 UploadInitRequest.categoryId)。
|
|||
|
|
final String? categoryId;
|
|||
|
|
|
|||
|
|
/// 客户端幂等键(同账号同相册内唯一,应用侧校验,见库级文档)。
|
|||
|
|
final String clientTaskId;
|
|||
|
|
|
|||
|
|
/// 源文件绝对路径(受管目录副本:app 支持目录/uploads/{albumId}/)。
|
|||
|
|
final String sourceFilePath;
|
|||
|
|
|
|||
|
|
/// 原始文件名(仅元数据, maxLength 255,契约对齐)。
|
|||
|
|
final String filename;
|
|||
|
|
|
|||
|
|
/// 申明文件字节数(完成核验时与服务端逐一比对)。
|
|||
|
|
final int bytes;
|
|||
|
|
|
|||
|
|
/// MIME 类型(白名单 image/jpeg | image/png | image/heic)。
|
|||
|
|
final String contentType;
|
|||
|
|
|
|||
|
|
/// 任务状态(状态机见 task_state.dart)。
|
|||
|
|
final UploadTaskState state;
|
|||
|
|
|
|||
|
|
/// 已尝试传输次数(退避与上限判断依据)。
|
|||
|
|
final int attempt;
|
|||
|
|
|
|||
|
|
/// 下次可重试时间(waitingNetwork/retryableFailed 的退避闹钟);null=无
|
|||
|
|
/// 待重试。
|
|||
|
|
final DateTime? nextRetryAt;
|
|||
|
|
|
|||
|
|
/// 服务端上传会话 ID(initUpload 成功后回填,重试复用)。
|
|||
|
|
final String? serverUploadId;
|
|||
|
|
|
|||
|
|
/// 服务端预创建照片 ID(initUpload 成功后回填)。
|
|||
|
|
final String? serverPhotoId;
|
|||
|
|
|
|||
|
|
/// 最近一次失败原因(错误码文本,见 core/error_codes.dart;成功迁移时
|
|||
|
|
/// 清除)。
|
|||
|
|
final String? lastError;
|
|||
|
|
|
|||
|
|
/// 源文件已清理时间(保留策略执行器写入;null=未清理)。实现增补字段,
|
|||
|
|
/// 见库级文档。
|
|||
|
|
final DateTime? cleanedAt;
|
|||
|
|
|
|||
|
|
/// 创建时间(入 preparing 时刻)。
|
|||
|
|
final DateTime createdAt;
|
|||
|
|
|
|||
|
|
/// 最近更新时间(每次状态迁移刷新;保留策略的年龄基准)。
|
|||
|
|
final DateTime updatedAt;
|
|||
|
|
const UploadTask({
|
|||
|
|
required this.id,
|
|||
|
|
required this.accountId,
|
|||
|
|
required this.albumId,
|
|||
|
|
this.categoryId,
|
|||
|
|
required this.clientTaskId,
|
|||
|
|
required this.sourceFilePath,
|
|||
|
|
required this.filename,
|
|||
|
|
required this.bytes,
|
|||
|
|
required this.contentType,
|
|||
|
|
required this.state,
|
|||
|
|
required this.attempt,
|
|||
|
|
this.nextRetryAt,
|
|||
|
|
this.serverUploadId,
|
|||
|
|
this.serverPhotoId,
|
|||
|
|
this.lastError,
|
|||
|
|
this.cleanedAt,
|
|||
|
|
required this.createdAt,
|
|||
|
|
required this.updatedAt,
|
|||
|
|
});
|
|||
|
|
@override
|
|||
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|||
|
|
final map = <String, Expression>{};
|
|||
|
|
map['id'] = Variable<String>(id);
|
|||
|
|
map['account_id'] = Variable<String>(accountId);
|
|||
|
|
map['album_id'] = Variable<String>(albumId);
|
|||
|
|
if (!nullToAbsent || categoryId != null) {
|
|||
|
|
map['category_id'] = Variable<String>(categoryId);
|
|||
|
|
}
|
|||
|
|
map['client_task_id'] = Variable<String>(clientTaskId);
|
|||
|
|
map['source_file_path'] = Variable<String>(sourceFilePath);
|
|||
|
|
map['filename'] = Variable<String>(filename);
|
|||
|
|
map['bytes'] = Variable<int>(bytes);
|
|||
|
|
map['content_type'] = Variable<String>(contentType);
|
|||
|
|
{
|
|||
|
|
map['state'] = Variable<String>(
|
|||
|
|
$UploadTasksTable.$converterstate.toSql(state),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
map['attempt'] = Variable<int>(attempt);
|
|||
|
|
if (!nullToAbsent || nextRetryAt != null) {
|
|||
|
|
map['next_retry_at'] = Variable<DateTime>(nextRetryAt);
|
|||
|
|
}
|
|||
|
|
if (!nullToAbsent || serverUploadId != null) {
|
|||
|
|
map['server_upload_id'] = Variable<String>(serverUploadId);
|
|||
|
|
}
|
|||
|
|
if (!nullToAbsent || serverPhotoId != null) {
|
|||
|
|
map['server_photo_id'] = Variable<String>(serverPhotoId);
|
|||
|
|
}
|
|||
|
|
if (!nullToAbsent || lastError != null) {
|
|||
|
|
map['last_error'] = Variable<String>(lastError);
|
|||
|
|
}
|
|||
|
|
if (!nullToAbsent || cleanedAt != null) {
|
|||
|
|
map['cleaned_at'] = Variable<DateTime>(cleanedAt);
|
|||
|
|
}
|
|||
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|||
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|||
|
|
return map;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UploadTasksCompanion toCompanion(bool nullToAbsent) {
|
|||
|
|
return UploadTasksCompanion(
|
|||
|
|
id: Value(id),
|
|||
|
|
accountId: Value(accountId),
|
|||
|
|
albumId: Value(albumId),
|
|||
|
|
categoryId: categoryId == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(categoryId),
|
|||
|
|
clientTaskId: Value(clientTaskId),
|
|||
|
|
sourceFilePath: Value(sourceFilePath),
|
|||
|
|
filename: Value(filename),
|
|||
|
|
bytes: Value(bytes),
|
|||
|
|
contentType: Value(contentType),
|
|||
|
|
state: Value(state),
|
|||
|
|
attempt: Value(attempt),
|
|||
|
|
nextRetryAt: nextRetryAt == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(nextRetryAt),
|
|||
|
|
serverUploadId: serverUploadId == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(serverUploadId),
|
|||
|
|
serverPhotoId: serverPhotoId == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(serverPhotoId),
|
|||
|
|
lastError: lastError == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(lastError),
|
|||
|
|
cleanedAt: cleanedAt == null && nullToAbsent
|
|||
|
|
? const Value.absent()
|
|||
|
|
: Value(cleanedAt),
|
|||
|
|
createdAt: Value(createdAt),
|
|||
|
|
updatedAt: Value(updatedAt),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
factory UploadTask.fromJson(
|
|||
|
|
Map<String, dynamic> json, {
|
|||
|
|
ValueSerializer? serializer,
|
|||
|
|
}) {
|
|||
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|||
|
|
return UploadTask(
|
|||
|
|
id: serializer.fromJson<String>(json['id']),
|
|||
|
|
accountId: serializer.fromJson<String>(json['accountId']),
|
|||
|
|
albumId: serializer.fromJson<String>(json['albumId']),
|
|||
|
|
categoryId: serializer.fromJson<String?>(json['categoryId']),
|
|||
|
|
clientTaskId: serializer.fromJson<String>(json['clientTaskId']),
|
|||
|
|
sourceFilePath: serializer.fromJson<String>(json['sourceFilePath']),
|
|||
|
|
filename: serializer.fromJson<String>(json['filename']),
|
|||
|
|
bytes: serializer.fromJson<int>(json['bytes']),
|
|||
|
|
contentType: serializer.fromJson<String>(json['contentType']),
|
|||
|
|
state: serializer.fromJson<UploadTaskState>(json['state']),
|
|||
|
|
attempt: serializer.fromJson<int>(json['attempt']),
|
|||
|
|
nextRetryAt: serializer.fromJson<DateTime?>(json['nextRetryAt']),
|
|||
|
|
serverUploadId: serializer.fromJson<String?>(json['serverUploadId']),
|
|||
|
|
serverPhotoId: serializer.fromJson<String?>(json['serverPhotoId']),
|
|||
|
|
lastError: serializer.fromJson<String?>(json['lastError']),
|
|||
|
|
cleanedAt: serializer.fromJson<DateTime?>(json['cleanedAt']),
|
|||
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|||
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
@override
|
|||
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|||
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|||
|
|
return <String, dynamic>{
|
|||
|
|
'id': serializer.toJson<String>(id),
|
|||
|
|
'accountId': serializer.toJson<String>(accountId),
|
|||
|
|
'albumId': serializer.toJson<String>(albumId),
|
|||
|
|
'categoryId': serializer.toJson<String?>(categoryId),
|
|||
|
|
'clientTaskId': serializer.toJson<String>(clientTaskId),
|
|||
|
|
'sourceFilePath': serializer.toJson<String>(sourceFilePath),
|
|||
|
|
'filename': serializer.toJson<String>(filename),
|
|||
|
|
'bytes': serializer.toJson<int>(bytes),
|
|||
|
|
'contentType': serializer.toJson<String>(contentType),
|
|||
|
|
'state': serializer.toJson<UploadTaskState>(state),
|
|||
|
|
'attempt': serializer.toJson<int>(attempt),
|
|||
|
|
'nextRetryAt': serializer.toJson<DateTime?>(nextRetryAt),
|
|||
|
|
'serverUploadId': serializer.toJson<String?>(serverUploadId),
|
|||
|
|
'serverPhotoId': serializer.toJson<String?>(serverPhotoId),
|
|||
|
|
'lastError': serializer.toJson<String?>(lastError),
|
|||
|
|
'cleanedAt': serializer.toJson<DateTime?>(cleanedAt),
|
|||
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|||
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UploadTask copyWith({
|
|||
|
|
String? id,
|
|||
|
|
String? accountId,
|
|||
|
|
String? albumId,
|
|||
|
|
Value<String?> categoryId = const Value.absent(),
|
|||
|
|
String? clientTaskId,
|
|||
|
|
String? sourceFilePath,
|
|||
|
|
String? filename,
|
|||
|
|
int? bytes,
|
|||
|
|
String? contentType,
|
|||
|
|
UploadTaskState? state,
|
|||
|
|
int? attempt,
|
|||
|
|
Value<DateTime?> nextRetryAt = const Value.absent(),
|
|||
|
|
Value<String?> serverUploadId = const Value.absent(),
|
|||
|
|
Value<String?> serverPhotoId = const Value.absent(),
|
|||
|
|
Value<String?> lastError = const Value.absent(),
|
|||
|
|
Value<DateTime?> cleanedAt = const Value.absent(),
|
|||
|
|
DateTime? createdAt,
|
|||
|
|
DateTime? updatedAt,
|
|||
|
|
}) => UploadTask(
|
|||
|
|
id: id ?? this.id,
|
|||
|
|
accountId: accountId ?? this.accountId,
|
|||
|
|
albumId: albumId ?? this.albumId,
|
|||
|
|
categoryId: categoryId.present ? categoryId.value : this.categoryId,
|
|||
|
|
clientTaskId: clientTaskId ?? this.clientTaskId,
|
|||
|
|
sourceFilePath: sourceFilePath ?? this.sourceFilePath,
|
|||
|
|
filename: filename ?? this.filename,
|
|||
|
|
bytes: bytes ?? this.bytes,
|
|||
|
|
contentType: contentType ?? this.contentType,
|
|||
|
|
state: state ?? this.state,
|
|||
|
|
attempt: attempt ?? this.attempt,
|
|||
|
|
nextRetryAt: nextRetryAt.present ? nextRetryAt.value : this.nextRetryAt,
|
|||
|
|
serverUploadId: serverUploadId.present
|
|||
|
|
? serverUploadId.value
|
|||
|
|
: this.serverUploadId,
|
|||
|
|
serverPhotoId: serverPhotoId.present
|
|||
|
|
? serverPhotoId.value
|
|||
|
|
: this.serverPhotoId,
|
|||
|
|
lastError: lastError.present ? lastError.value : this.lastError,
|
|||
|
|
cleanedAt: cleanedAt.present ? cleanedAt.value : this.cleanedAt,
|
|||
|
|
createdAt: createdAt ?? this.createdAt,
|
|||
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|||
|
|
);
|
|||
|
|
UploadTask copyWithCompanion(UploadTasksCompanion data) {
|
|||
|
|
return UploadTask(
|
|||
|
|
id: data.id.present ? data.id.value : this.id,
|
|||
|
|
accountId: data.accountId.present ? data.accountId.value : this.accountId,
|
|||
|
|
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
|||
|
|
categoryId: data.categoryId.present
|
|||
|
|
? data.categoryId.value
|
|||
|
|
: this.categoryId,
|
|||
|
|
clientTaskId: data.clientTaskId.present
|
|||
|
|
? data.clientTaskId.value
|
|||
|
|
: this.clientTaskId,
|
|||
|
|
sourceFilePath: data.sourceFilePath.present
|
|||
|
|
? data.sourceFilePath.value
|
|||
|
|
: this.sourceFilePath,
|
|||
|
|
filename: data.filename.present ? data.filename.value : this.filename,
|
|||
|
|
bytes: data.bytes.present ? data.bytes.value : this.bytes,
|
|||
|
|
contentType: data.contentType.present
|
|||
|
|
? data.contentType.value
|
|||
|
|
: this.contentType,
|
|||
|
|
state: data.state.present ? data.state.value : this.state,
|
|||
|
|
attempt: data.attempt.present ? data.attempt.value : this.attempt,
|
|||
|
|
nextRetryAt: data.nextRetryAt.present
|
|||
|
|
? data.nextRetryAt.value
|
|||
|
|
: this.nextRetryAt,
|
|||
|
|
serverUploadId: data.serverUploadId.present
|
|||
|
|
? data.serverUploadId.value
|
|||
|
|
: this.serverUploadId,
|
|||
|
|
serverPhotoId: data.serverPhotoId.present
|
|||
|
|
? data.serverPhotoId.value
|
|||
|
|
: this.serverPhotoId,
|
|||
|
|
lastError: data.lastError.present ? data.lastError.value : this.lastError,
|
|||
|
|
cleanedAt: data.cleanedAt.present ? data.cleanedAt.value : this.cleanedAt,
|
|||
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|||
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
String toString() {
|
|||
|
|
return (StringBuffer('UploadTask(')
|
|||
|
|
..write('id: $id, ')
|
|||
|
|
..write('accountId: $accountId, ')
|
|||
|
|
..write('albumId: $albumId, ')
|
|||
|
|
..write('categoryId: $categoryId, ')
|
|||
|
|
..write('clientTaskId: $clientTaskId, ')
|
|||
|
|
..write('sourceFilePath: $sourceFilePath, ')
|
|||
|
|
..write('filename: $filename, ')
|
|||
|
|
..write('bytes: $bytes, ')
|
|||
|
|
..write('contentType: $contentType, ')
|
|||
|
|
..write('state: $state, ')
|
|||
|
|
..write('attempt: $attempt, ')
|
|||
|
|
..write('nextRetryAt: $nextRetryAt, ')
|
|||
|
|
..write('serverUploadId: $serverUploadId, ')
|
|||
|
|
..write('serverPhotoId: $serverPhotoId, ')
|
|||
|
|
..write('lastError: $lastError, ')
|
|||
|
|
..write('cleanedAt: $cleanedAt, ')
|
|||
|
|
..write('createdAt: $createdAt, ')
|
|||
|
|
..write('updatedAt: $updatedAt')
|
|||
|
|
..write(')'))
|
|||
|
|
.toString();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
int get hashCode => Object.hash(
|
|||
|
|
id,
|
|||
|
|
accountId,
|
|||
|
|
albumId,
|
|||
|
|
categoryId,
|
|||
|
|
clientTaskId,
|
|||
|
|
sourceFilePath,
|
|||
|
|
filename,
|
|||
|
|
bytes,
|
|||
|
|
contentType,
|
|||
|
|
state,
|
|||
|
|
attempt,
|
|||
|
|
nextRetryAt,
|
|||
|
|
serverUploadId,
|
|||
|
|
serverPhotoId,
|
|||
|
|
lastError,
|
|||
|
|
cleanedAt,
|
|||
|
|
createdAt,
|
|||
|
|
updatedAt,
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
bool operator ==(Object other) =>
|
|||
|
|
identical(this, other) ||
|
|||
|
|
(other is UploadTask &&
|
|||
|
|
other.id == this.id &&
|
|||
|
|
other.accountId == this.accountId &&
|
|||
|
|
other.albumId == this.albumId &&
|
|||
|
|
other.categoryId == this.categoryId &&
|
|||
|
|
other.clientTaskId == this.clientTaskId &&
|
|||
|
|
other.sourceFilePath == this.sourceFilePath &&
|
|||
|
|
other.filename == this.filename &&
|
|||
|
|
other.bytes == this.bytes &&
|
|||
|
|
other.contentType == this.contentType &&
|
|||
|
|
other.state == this.state &&
|
|||
|
|
other.attempt == this.attempt &&
|
|||
|
|
other.nextRetryAt == this.nextRetryAt &&
|
|||
|
|
other.serverUploadId == this.serverUploadId &&
|
|||
|
|
other.serverPhotoId == this.serverPhotoId &&
|
|||
|
|
other.lastError == this.lastError &&
|
|||
|
|
other.cleanedAt == this.cleanedAt &&
|
|||
|
|
other.createdAt == this.createdAt &&
|
|||
|
|
other.updatedAt == this.updatedAt);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class UploadTasksCompanion extends UpdateCompanion<UploadTask> {
|
|||
|
|
final Value<String> id;
|
|||
|
|
final Value<String> accountId;
|
|||
|
|
final Value<String> albumId;
|
|||
|
|
final Value<String?> categoryId;
|
|||
|
|
final Value<String> clientTaskId;
|
|||
|
|
final Value<String> sourceFilePath;
|
|||
|
|
final Value<String> filename;
|
|||
|
|
final Value<int> bytes;
|
|||
|
|
final Value<String> contentType;
|
|||
|
|
final Value<UploadTaskState> state;
|
|||
|
|
final Value<int> attempt;
|
|||
|
|
final Value<DateTime?> nextRetryAt;
|
|||
|
|
final Value<String?> serverUploadId;
|
|||
|
|
final Value<String?> serverPhotoId;
|
|||
|
|
final Value<String?> lastError;
|
|||
|
|
final Value<DateTime?> cleanedAt;
|
|||
|
|
final Value<DateTime> createdAt;
|
|||
|
|
final Value<DateTime> updatedAt;
|
|||
|
|
final Value<int> rowid;
|
|||
|
|
const UploadTasksCompanion({
|
|||
|
|
this.id = const Value.absent(),
|
|||
|
|
this.accountId = const Value.absent(),
|
|||
|
|
this.albumId = const Value.absent(),
|
|||
|
|
this.categoryId = const Value.absent(),
|
|||
|
|
this.clientTaskId = const Value.absent(),
|
|||
|
|
this.sourceFilePath = const Value.absent(),
|
|||
|
|
this.filename = const Value.absent(),
|
|||
|
|
this.bytes = const Value.absent(),
|
|||
|
|
this.contentType = const Value.absent(),
|
|||
|
|
this.state = const Value.absent(),
|
|||
|
|
this.attempt = const Value.absent(),
|
|||
|
|
this.nextRetryAt = const Value.absent(),
|
|||
|
|
this.serverUploadId = const Value.absent(),
|
|||
|
|
this.serverPhotoId = const Value.absent(),
|
|||
|
|
this.lastError = const Value.absent(),
|
|||
|
|
this.cleanedAt = const Value.absent(),
|
|||
|
|
this.createdAt = const Value.absent(),
|
|||
|
|
this.updatedAt = const Value.absent(),
|
|||
|
|
this.rowid = const Value.absent(),
|
|||
|
|
});
|
|||
|
|
UploadTasksCompanion.insert({
|
|||
|
|
required String id,
|
|||
|
|
required String accountId,
|
|||
|
|
required String albumId,
|
|||
|
|
this.categoryId = const Value.absent(),
|
|||
|
|
required String clientTaskId,
|
|||
|
|
required String sourceFilePath,
|
|||
|
|
required String filename,
|
|||
|
|
required int bytes,
|
|||
|
|
required String contentType,
|
|||
|
|
required UploadTaskState state,
|
|||
|
|
this.attempt = const Value.absent(),
|
|||
|
|
this.nextRetryAt = const Value.absent(),
|
|||
|
|
this.serverUploadId = const Value.absent(),
|
|||
|
|
this.serverPhotoId = const Value.absent(),
|
|||
|
|
this.lastError = const Value.absent(),
|
|||
|
|
this.cleanedAt = const Value.absent(),
|
|||
|
|
required DateTime createdAt,
|
|||
|
|
required DateTime updatedAt,
|
|||
|
|
this.rowid = const Value.absent(),
|
|||
|
|
}) : id = Value(id),
|
|||
|
|
accountId = Value(accountId),
|
|||
|
|
albumId = Value(albumId),
|
|||
|
|
clientTaskId = Value(clientTaskId),
|
|||
|
|
sourceFilePath = Value(sourceFilePath),
|
|||
|
|
filename = Value(filename),
|
|||
|
|
bytes = Value(bytes),
|
|||
|
|
contentType = Value(contentType),
|
|||
|
|
state = Value(state),
|
|||
|
|
createdAt = Value(createdAt),
|
|||
|
|
updatedAt = Value(updatedAt);
|
|||
|
|
static Insertable<UploadTask> custom({
|
|||
|
|
Expression<String>? id,
|
|||
|
|
Expression<String>? accountId,
|
|||
|
|
Expression<String>? albumId,
|
|||
|
|
Expression<String>? categoryId,
|
|||
|
|
Expression<String>? clientTaskId,
|
|||
|
|
Expression<String>? sourceFilePath,
|
|||
|
|
Expression<String>? filename,
|
|||
|
|
Expression<int>? bytes,
|
|||
|
|
Expression<String>? contentType,
|
|||
|
|
Expression<String>? state,
|
|||
|
|
Expression<int>? attempt,
|
|||
|
|
Expression<DateTime>? nextRetryAt,
|
|||
|
|
Expression<String>? serverUploadId,
|
|||
|
|
Expression<String>? serverPhotoId,
|
|||
|
|
Expression<String>? lastError,
|
|||
|
|
Expression<DateTime>? cleanedAt,
|
|||
|
|
Expression<DateTime>? createdAt,
|
|||
|
|
Expression<DateTime>? updatedAt,
|
|||
|
|
Expression<int>? rowid,
|
|||
|
|
}) {
|
|||
|
|
return RawValuesInsertable({
|
|||
|
|
if (id != null) 'id': id,
|
|||
|
|
if (accountId != null) 'account_id': accountId,
|
|||
|
|
if (albumId != null) 'album_id': albumId,
|
|||
|
|
if (categoryId != null) 'category_id': categoryId,
|
|||
|
|
if (clientTaskId != null) 'client_task_id': clientTaskId,
|
|||
|
|
if (sourceFilePath != null) 'source_file_path': sourceFilePath,
|
|||
|
|
if (filename != null) 'filename': filename,
|
|||
|
|
if (bytes != null) 'bytes': bytes,
|
|||
|
|
if (contentType != null) 'content_type': contentType,
|
|||
|
|
if (state != null) 'state': state,
|
|||
|
|
if (attempt != null) 'attempt': attempt,
|
|||
|
|
if (nextRetryAt != null) 'next_retry_at': nextRetryAt,
|
|||
|
|
if (serverUploadId != null) 'server_upload_id': serverUploadId,
|
|||
|
|
if (serverPhotoId != null) 'server_photo_id': serverPhotoId,
|
|||
|
|
if (lastError != null) 'last_error': lastError,
|
|||
|
|
if (cleanedAt != null) 'cleaned_at': cleanedAt,
|
|||
|
|
if (createdAt != null) 'created_at': createdAt,
|
|||
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|||
|
|
if (rowid != null) 'rowid': rowid,
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UploadTasksCompanion copyWith({
|
|||
|
|
Value<String>? id,
|
|||
|
|
Value<String>? accountId,
|
|||
|
|
Value<String>? albumId,
|
|||
|
|
Value<String?>? categoryId,
|
|||
|
|
Value<String>? clientTaskId,
|
|||
|
|
Value<String>? sourceFilePath,
|
|||
|
|
Value<String>? filename,
|
|||
|
|
Value<int>? bytes,
|
|||
|
|
Value<String>? contentType,
|
|||
|
|
Value<UploadTaskState>? state,
|
|||
|
|
Value<int>? attempt,
|
|||
|
|
Value<DateTime?>? nextRetryAt,
|
|||
|
|
Value<String?>? serverUploadId,
|
|||
|
|
Value<String?>? serverPhotoId,
|
|||
|
|
Value<String?>? lastError,
|
|||
|
|
Value<DateTime?>? cleanedAt,
|
|||
|
|
Value<DateTime>? createdAt,
|
|||
|
|
Value<DateTime>? updatedAt,
|
|||
|
|
Value<int>? rowid,
|
|||
|
|
}) {
|
|||
|
|
return UploadTasksCompanion(
|
|||
|
|
id: id ?? this.id,
|
|||
|
|
accountId: accountId ?? this.accountId,
|
|||
|
|
albumId: albumId ?? this.albumId,
|
|||
|
|
categoryId: categoryId ?? this.categoryId,
|
|||
|
|
clientTaskId: clientTaskId ?? this.clientTaskId,
|
|||
|
|
sourceFilePath: sourceFilePath ?? this.sourceFilePath,
|
|||
|
|
filename: filename ?? this.filename,
|
|||
|
|
bytes: bytes ?? this.bytes,
|
|||
|
|
contentType: contentType ?? this.contentType,
|
|||
|
|
state: state ?? this.state,
|
|||
|
|
attempt: attempt ?? this.attempt,
|
|||
|
|
nextRetryAt: nextRetryAt ?? this.nextRetryAt,
|
|||
|
|
serverUploadId: serverUploadId ?? this.serverUploadId,
|
|||
|
|
serverPhotoId: serverPhotoId ?? this.serverPhotoId,
|
|||
|
|
lastError: lastError ?? this.lastError,
|
|||
|
|
cleanedAt: cleanedAt ?? this.cleanedAt,
|
|||
|
|
createdAt: createdAt ?? this.createdAt,
|
|||
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|||
|
|
rowid: rowid ?? this.rowid,
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|||
|
|
final map = <String, Expression>{};
|
|||
|
|
if (id.present) {
|
|||
|
|
map['id'] = Variable<String>(id.value);
|
|||
|
|
}
|
|||
|
|
if (accountId.present) {
|
|||
|
|
map['account_id'] = Variable<String>(accountId.value);
|
|||
|
|
}
|
|||
|
|
if (albumId.present) {
|
|||
|
|
map['album_id'] = Variable<String>(albumId.value);
|
|||
|
|
}
|
|||
|
|
if (categoryId.present) {
|
|||
|
|
map['category_id'] = Variable<String>(categoryId.value);
|
|||
|
|
}
|
|||
|
|
if (clientTaskId.present) {
|
|||
|
|
map['client_task_id'] = Variable<String>(clientTaskId.value);
|
|||
|
|
}
|
|||
|
|
if (sourceFilePath.present) {
|
|||
|
|
map['source_file_path'] = Variable<String>(sourceFilePath.value);
|
|||
|
|
}
|
|||
|
|
if (filename.present) {
|
|||
|
|
map['filename'] = Variable<String>(filename.value);
|
|||
|
|
}
|
|||
|
|
if (bytes.present) {
|
|||
|
|
map['bytes'] = Variable<int>(bytes.value);
|
|||
|
|
}
|
|||
|
|
if (contentType.present) {
|
|||
|
|
map['content_type'] = Variable<String>(contentType.value);
|
|||
|
|
}
|
|||
|
|
if (state.present) {
|
|||
|
|
map['state'] = Variable<String>(
|
|||
|
|
$UploadTasksTable.$converterstate.toSql(state.value),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
if (attempt.present) {
|
|||
|
|
map['attempt'] = Variable<int>(attempt.value);
|
|||
|
|
}
|
|||
|
|
if (nextRetryAt.present) {
|
|||
|
|
map['next_retry_at'] = Variable<DateTime>(nextRetryAt.value);
|
|||
|
|
}
|
|||
|
|
if (serverUploadId.present) {
|
|||
|
|
map['server_upload_id'] = Variable<String>(serverUploadId.value);
|
|||
|
|
}
|
|||
|
|
if (serverPhotoId.present) {
|
|||
|
|
map['server_photo_id'] = Variable<String>(serverPhotoId.value);
|
|||
|
|
}
|
|||
|
|
if (lastError.present) {
|
|||
|
|
map['last_error'] = Variable<String>(lastError.value);
|
|||
|
|
}
|
|||
|
|
if (cleanedAt.present) {
|
|||
|
|
map['cleaned_at'] = Variable<DateTime>(cleanedAt.value);
|
|||
|
|
}
|
|||
|
|
if (createdAt.present) {
|
|||
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|||
|
|
}
|
|||
|
|
if (updatedAt.present) {
|
|||
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|||
|
|
}
|
|||
|
|
if (rowid.present) {
|
|||
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|||
|
|
}
|
|||
|
|
return map;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
String toString() {
|
|||
|
|
return (StringBuffer('UploadTasksCompanion(')
|
|||
|
|
..write('id: $id, ')
|
|||
|
|
..write('accountId: $accountId, ')
|
|||
|
|
..write('albumId: $albumId, ')
|
|||
|
|
..write('categoryId: $categoryId, ')
|
|||
|
|
..write('clientTaskId: $clientTaskId, ')
|
|||
|
|
..write('sourceFilePath: $sourceFilePath, ')
|
|||
|
|
..write('filename: $filename, ')
|
|||
|
|
..write('bytes: $bytes, ')
|
|||
|
|
..write('contentType: $contentType, ')
|
|||
|
|
..write('state: $state, ')
|
|||
|
|
..write('attempt: $attempt, ')
|
|||
|
|
..write('nextRetryAt: $nextRetryAt, ')
|
|||
|
|
..write('serverUploadId: $serverUploadId, ')
|
|||
|
|
..write('serverPhotoId: $serverPhotoId, ')
|
|||
|
|
..write('lastError: $lastError, ')
|
|||
|
|
..write('cleanedAt: $cleanedAt, ')
|
|||
|
|
..write('createdAt: $createdAt, ')
|
|||
|
|
..write('updatedAt: $updatedAt, ')
|
|||
|
|
..write('rowid: $rowid')
|
|||
|
|
..write(')'))
|
|||
|
|
.toString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
abstract class _$UploadTaskDb extends GeneratedDatabase {
|
|||
|
|
_$UploadTaskDb(QueryExecutor e) : super(e);
|
|||
|
|
$UploadTaskDbManager get managers => $UploadTaskDbManager(this);
|
|||
|
|
late final $UploadTasksTable uploadTasks = $UploadTasksTable(this);
|
|||
|
|
late final Index uploadTasksAccountIdx = Index(
|
|||
|
|
'upload_tasks_account_idx',
|
|||
|
|
'CREATE INDEX upload_tasks_account_idx ON upload_tasks (account_id)',
|
|||
|
|
);
|
|||
|
|
late final Index uploadTasksAccountStateIdx = Index(
|
|||
|
|
'upload_tasks_account_state_idx',
|
|||
|
|
'CREATE INDEX upload_tasks_account_state_idx ON upload_tasks (account_id, state)',
|
|||
|
|
);
|
|||
|
|
late final Index uploadTasksAccountAlbumStateIdx = Index(
|
|||
|
|
'upload_tasks_account_album_state_idx',
|
|||
|
|
'CREATE INDEX upload_tasks_account_album_state_idx ON upload_tasks (account_id, album_id, state)',
|
|||
|
|
);
|
|||
|
|
@override
|
|||
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|||
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|||
|
|
@override
|
|||
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|||
|
|
uploadTasks,
|
|||
|
|
uploadTasksAccountIdx,
|
|||
|
|
uploadTasksAccountStateIdx,
|
|||
|
|
uploadTasksAccountAlbumStateIdx,
|
|||
|
|
];
|
|||
|
|
@override
|
|||
|
|
DriftDatabaseOptions get options =>
|
|||
|
|
const DriftDatabaseOptions(storeDateTimeAsText: true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
typedef $$UploadTasksTableCreateCompanionBuilder =
|
|||
|
|
UploadTasksCompanion Function({
|
|||
|
|
required String id,
|
|||
|
|
required String accountId,
|
|||
|
|
required String albumId,
|
|||
|
|
Value<String?> categoryId,
|
|||
|
|
required String clientTaskId,
|
|||
|
|
required String sourceFilePath,
|
|||
|
|
required String filename,
|
|||
|
|
required int bytes,
|
|||
|
|
required String contentType,
|
|||
|
|
required UploadTaskState state,
|
|||
|
|
Value<int> attempt,
|
|||
|
|
Value<DateTime?> nextRetryAt,
|
|||
|
|
Value<String?> serverUploadId,
|
|||
|
|
Value<String?> serverPhotoId,
|
|||
|
|
Value<String?> lastError,
|
|||
|
|
Value<DateTime?> cleanedAt,
|
|||
|
|
required DateTime createdAt,
|
|||
|
|
required DateTime updatedAt,
|
|||
|
|
Value<int> rowid,
|
|||
|
|
});
|
|||
|
|
typedef $$UploadTasksTableUpdateCompanionBuilder =
|
|||
|
|
UploadTasksCompanion Function({
|
|||
|
|
Value<String> id,
|
|||
|
|
Value<String> accountId,
|
|||
|
|
Value<String> albumId,
|
|||
|
|
Value<String?> categoryId,
|
|||
|
|
Value<String> clientTaskId,
|
|||
|
|
Value<String> sourceFilePath,
|
|||
|
|
Value<String> filename,
|
|||
|
|
Value<int> bytes,
|
|||
|
|
Value<String> contentType,
|
|||
|
|
Value<UploadTaskState> state,
|
|||
|
|
Value<int> attempt,
|
|||
|
|
Value<DateTime?> nextRetryAt,
|
|||
|
|
Value<String?> serverUploadId,
|
|||
|
|
Value<String?> serverPhotoId,
|
|||
|
|
Value<String?> lastError,
|
|||
|
|
Value<DateTime?> cleanedAt,
|
|||
|
|
Value<DateTime> createdAt,
|
|||
|
|
Value<DateTime> updatedAt,
|
|||
|
|
Value<int> rowid,
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
class $$UploadTasksTableFilterComposer
|
|||
|
|
extends Composer<_$UploadTaskDb, $UploadTasksTable> {
|
|||
|
|
$$UploadTasksTableFilterComposer({
|
|||
|
|
required super.$db,
|
|||
|
|
required super.$table,
|
|||
|
|
super.joinBuilder,
|
|||
|
|
super.$addJoinBuilderToRootComposer,
|
|||
|
|
super.$removeJoinBuilderFromRootComposer,
|
|||
|
|
});
|
|||
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|||
|
|
column: $table.id,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get accountId => $composableBuilder(
|
|||
|
|
column: $table.accountId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get albumId => $composableBuilder(
|
|||
|
|
column: $table.albumId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get categoryId => $composableBuilder(
|
|||
|
|
column: $table.categoryId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get clientTaskId => $composableBuilder(
|
|||
|
|
column: $table.clientTaskId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get sourceFilePath => $composableBuilder(
|
|||
|
|
column: $table.sourceFilePath,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get filename => $composableBuilder(
|
|||
|
|
column: $table.filename,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<int> get bytes => $composableBuilder(
|
|||
|
|
column: $table.bytes,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get contentType => $composableBuilder(
|
|||
|
|
column: $table.contentType,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnWithTypeConverterFilters<UploadTaskState, UploadTaskState, String>
|
|||
|
|
get state => $composableBuilder(
|
|||
|
|
column: $table.state,
|
|||
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<int> get attempt => $composableBuilder(
|
|||
|
|
column: $table.attempt,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<DateTime> get nextRetryAt => $composableBuilder(
|
|||
|
|
column: $table.nextRetryAt,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get serverUploadId => $composableBuilder(
|
|||
|
|
column: $table.serverUploadId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get serverPhotoId => $composableBuilder(
|
|||
|
|
column: $table.serverPhotoId,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<String> get lastError => $composableBuilder(
|
|||
|
|
column: $table.lastError,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<DateTime> get cleanedAt => $composableBuilder(
|
|||
|
|
column: $table.cleanedAt,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|||
|
|
column: $table.createdAt,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|||
|
|
column: $table.updatedAt,
|
|||
|
|
builder: (column) => ColumnFilters(column),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class $$UploadTasksTableOrderingComposer
|
|||
|
|
extends Composer<_$UploadTaskDb, $UploadTasksTable> {
|
|||
|
|
$$UploadTasksTableOrderingComposer({
|
|||
|
|
required super.$db,
|
|||
|
|
required super.$table,
|
|||
|
|
super.joinBuilder,
|
|||
|
|
super.$addJoinBuilderToRootComposer,
|
|||
|
|
super.$removeJoinBuilderFromRootComposer,
|
|||
|
|
});
|
|||
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|||
|
|
column: $table.id,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get accountId => $composableBuilder(
|
|||
|
|
column: $table.accountId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get albumId => $composableBuilder(
|
|||
|
|
column: $table.albumId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get categoryId => $composableBuilder(
|
|||
|
|
column: $table.categoryId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get clientTaskId => $composableBuilder(
|
|||
|
|
column: $table.clientTaskId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get sourceFilePath => $composableBuilder(
|
|||
|
|
column: $table.sourceFilePath,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get filename => $composableBuilder(
|
|||
|
|
column: $table.filename,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<int> get bytes => $composableBuilder(
|
|||
|
|
column: $table.bytes,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get contentType => $composableBuilder(
|
|||
|
|
column: $table.contentType,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get state => $composableBuilder(
|
|||
|
|
column: $table.state,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<int> get attempt => $composableBuilder(
|
|||
|
|
column: $table.attempt,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<DateTime> get nextRetryAt => $composableBuilder(
|
|||
|
|
column: $table.nextRetryAt,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get serverUploadId => $composableBuilder(
|
|||
|
|
column: $table.serverUploadId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get serverPhotoId => $composableBuilder(
|
|||
|
|
column: $table.serverPhotoId,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<String> get lastError => $composableBuilder(
|
|||
|
|
column: $table.lastError,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<DateTime> get cleanedAt => $composableBuilder(
|
|||
|
|
column: $table.cleanedAt,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|||
|
|
column: $table.createdAt,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|||
|
|
column: $table.updatedAt,
|
|||
|
|
builder: (column) => ColumnOrderings(column),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class $$UploadTasksTableAnnotationComposer
|
|||
|
|
extends Composer<_$UploadTaskDb, $UploadTasksTable> {
|
|||
|
|
$$UploadTasksTableAnnotationComposer({
|
|||
|
|
required super.$db,
|
|||
|
|
required super.$table,
|
|||
|
|
super.joinBuilder,
|
|||
|
|
super.$addJoinBuilderToRootComposer,
|
|||
|
|
super.$removeJoinBuilderFromRootComposer,
|
|||
|
|
});
|
|||
|
|
GeneratedColumn<String> get id =>
|
|||
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get accountId =>
|
|||
|
|
$composableBuilder(column: $table.accountId, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get albumId =>
|
|||
|
|
$composableBuilder(column: $table.albumId, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get categoryId => $composableBuilder(
|
|||
|
|
column: $table.categoryId,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get clientTaskId => $composableBuilder(
|
|||
|
|
column: $table.clientTaskId,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get sourceFilePath => $composableBuilder(
|
|||
|
|
column: $table.sourceFilePath,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get filename =>
|
|||
|
|
$composableBuilder(column: $table.filename, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<int> get bytes =>
|
|||
|
|
$composableBuilder(column: $table.bytes, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get contentType => $composableBuilder(
|
|||
|
|
column: $table.contentType,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumnWithTypeConverter<UploadTaskState, String> get state =>
|
|||
|
|
$composableBuilder(column: $table.state, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<int> get attempt =>
|
|||
|
|
$composableBuilder(column: $table.attempt, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<DateTime> get nextRetryAt => $composableBuilder(
|
|||
|
|
column: $table.nextRetryAt,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get serverUploadId => $composableBuilder(
|
|||
|
|
column: $table.serverUploadId,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get serverPhotoId => $composableBuilder(
|
|||
|
|
column: $table.serverPhotoId,
|
|||
|
|
builder: (column) => column,
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
GeneratedColumn<String> get lastError =>
|
|||
|
|
$composableBuilder(column: $table.lastError, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<DateTime> get cleanedAt =>
|
|||
|
|
$composableBuilder(column: $table.cleanedAt, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|||
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|||
|
|
|
|||
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|||
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class $$UploadTasksTableTableManager
|
|||
|
|
extends
|
|||
|
|
RootTableManager<
|
|||
|
|
_$UploadTaskDb,
|
|||
|
|
$UploadTasksTable,
|
|||
|
|
UploadTask,
|
|||
|
|
$$UploadTasksTableFilterComposer,
|
|||
|
|
$$UploadTasksTableOrderingComposer,
|
|||
|
|
$$UploadTasksTableAnnotationComposer,
|
|||
|
|
$$UploadTasksTableCreateCompanionBuilder,
|
|||
|
|
$$UploadTasksTableUpdateCompanionBuilder,
|
|||
|
|
(
|
|||
|
|
UploadTask,
|
|||
|
|
BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>,
|
|||
|
|
),
|
|||
|
|
UploadTask,
|
|||
|
|
PrefetchHooks Function()
|
|||
|
|
> {
|
|||
|
|
$$UploadTasksTableTableManager(_$UploadTaskDb db, $UploadTasksTable table)
|
|||
|
|
: super(
|
|||
|
|
TableManagerState(
|
|||
|
|
db: db,
|
|||
|
|
table: table,
|
|||
|
|
createFilteringComposer: () =>
|
|||
|
|
$$UploadTasksTableFilterComposer($db: db, $table: table),
|
|||
|
|
createOrderingComposer: () =>
|
|||
|
|
$$UploadTasksTableOrderingComposer($db: db, $table: table),
|
|||
|
|
createComputedFieldComposer: () =>
|
|||
|
|
$$UploadTasksTableAnnotationComposer($db: db, $table: table),
|
|||
|
|
updateCompanionCallback:
|
|||
|
|
({
|
|||
|
|
Value<String> id = const Value.absent(),
|
|||
|
|
Value<String> accountId = const Value.absent(),
|
|||
|
|
Value<String> albumId = const Value.absent(),
|
|||
|
|
Value<String?> categoryId = const Value.absent(),
|
|||
|
|
Value<String> clientTaskId = const Value.absent(),
|
|||
|
|
Value<String> sourceFilePath = const Value.absent(),
|
|||
|
|
Value<String> filename = const Value.absent(),
|
|||
|
|
Value<int> bytes = const Value.absent(),
|
|||
|
|
Value<String> contentType = const Value.absent(),
|
|||
|
|
Value<UploadTaskState> state = const Value.absent(),
|
|||
|
|
Value<int> attempt = const Value.absent(),
|
|||
|
|
Value<DateTime?> nextRetryAt = const Value.absent(),
|
|||
|
|
Value<String?> serverUploadId = const Value.absent(),
|
|||
|
|
Value<String?> serverPhotoId = const Value.absent(),
|
|||
|
|
Value<String?> lastError = const Value.absent(),
|
|||
|
|
Value<DateTime?> cleanedAt = const Value.absent(),
|
|||
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|||
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|||
|
|
Value<int> rowid = const Value.absent(),
|
|||
|
|
}) => UploadTasksCompanion(
|
|||
|
|
id: id,
|
|||
|
|
accountId: accountId,
|
|||
|
|
albumId: albumId,
|
|||
|
|
categoryId: categoryId,
|
|||
|
|
clientTaskId: clientTaskId,
|
|||
|
|
sourceFilePath: sourceFilePath,
|
|||
|
|
filename: filename,
|
|||
|
|
bytes: bytes,
|
|||
|
|
contentType: contentType,
|
|||
|
|
state: state,
|
|||
|
|
attempt: attempt,
|
|||
|
|
nextRetryAt: nextRetryAt,
|
|||
|
|
serverUploadId: serverUploadId,
|
|||
|
|
serverPhotoId: serverPhotoId,
|
|||
|
|
lastError: lastError,
|
|||
|
|
cleanedAt: cleanedAt,
|
|||
|
|
createdAt: createdAt,
|
|||
|
|
updatedAt: updatedAt,
|
|||
|
|
rowid: rowid,
|
|||
|
|
),
|
|||
|
|
createCompanionCallback:
|
|||
|
|
({
|
|||
|
|
required String id,
|
|||
|
|
required String accountId,
|
|||
|
|
required String albumId,
|
|||
|
|
Value<String?> categoryId = const Value.absent(),
|
|||
|
|
required String clientTaskId,
|
|||
|
|
required String sourceFilePath,
|
|||
|
|
required String filename,
|
|||
|
|
required int bytes,
|
|||
|
|
required String contentType,
|
|||
|
|
required UploadTaskState state,
|
|||
|
|
Value<int> attempt = const Value.absent(),
|
|||
|
|
Value<DateTime?> nextRetryAt = const Value.absent(),
|
|||
|
|
Value<String?> serverUploadId = const Value.absent(),
|
|||
|
|
Value<String?> serverPhotoId = const Value.absent(),
|
|||
|
|
Value<String?> lastError = const Value.absent(),
|
|||
|
|
Value<DateTime?> cleanedAt = const Value.absent(),
|
|||
|
|
required DateTime createdAt,
|
|||
|
|
required DateTime updatedAt,
|
|||
|
|
Value<int> rowid = const Value.absent(),
|
|||
|
|
}) => UploadTasksCompanion.insert(
|
|||
|
|
id: id,
|
|||
|
|
accountId: accountId,
|
|||
|
|
albumId: albumId,
|
|||
|
|
categoryId: categoryId,
|
|||
|
|
clientTaskId: clientTaskId,
|
|||
|
|
sourceFilePath: sourceFilePath,
|
|||
|
|
filename: filename,
|
|||
|
|
bytes: bytes,
|
|||
|
|
contentType: contentType,
|
|||
|
|
state: state,
|
|||
|
|
attempt: attempt,
|
|||
|
|
nextRetryAt: nextRetryAt,
|
|||
|
|
serverUploadId: serverUploadId,
|
|||
|
|
serverPhotoId: serverPhotoId,
|
|||
|
|
lastError: lastError,
|
|||
|
|
cleanedAt: cleanedAt,
|
|||
|
|
createdAt: createdAt,
|
|||
|
|
updatedAt: updatedAt,
|
|||
|
|
rowid: rowid,
|
|||
|
|
),
|
|||
|
|
withReferenceMapper: (p0) => p0
|
|||
|
|
.map(
|
|||
|
|
(e) => (
|
|||
|
|
e.readTable<$UploadTasksTable, UploadTask>(table),
|
|||
|
|
BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>(
|
|||
|
|
db,
|
|||
|
|
table,
|
|||
|
|
e,
|
|||
|
|
),
|
|||
|
|
),
|
|||
|
|
)
|
|||
|
|
.toList(),
|
|||
|
|
prefetchHooksCallback: null,
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
typedef $$UploadTasksTableProcessedTableManager =
|
|||
|
|
ProcessedTableManager<
|
|||
|
|
_$UploadTaskDb,
|
|||
|
|
$UploadTasksTable,
|
|||
|
|
UploadTask,
|
|||
|
|
$$UploadTasksTableFilterComposer,
|
|||
|
|
$$UploadTasksTableOrderingComposer,
|
|||
|
|
$$UploadTasksTableAnnotationComposer,
|
|||
|
|
$$UploadTasksTableCreateCompanionBuilder,
|
|||
|
|
$$UploadTasksTableUpdateCompanionBuilder,
|
|||
|
|
(
|
|||
|
|
UploadTask,
|
|||
|
|
BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>,
|
|||
|
|
),
|
|||
|
|
UploadTask,
|
|||
|
|
PrefetchHooks Function()
|
|||
|
|
>;
|
|||
|
|
|
|||
|
|
class $UploadTaskDbManager {
|
|||
|
|
final _$UploadTaskDb _db;
|
|||
|
|
$UploadTaskDbManager(this._db);
|
|||
|
|
$$UploadTasksTableTableManager get uploadTasks =>
|
|||
|
|
$$UploadTasksTableTableManager(_db, _db.uploadTasks);
|
|||
|
|
}
|