Scale the local inventory to 10k+ varieties: - Render the list with ListView.builder over a flattened header/item model instead of building every tile upfront. - Store a small regenerable JPEG thumbnail per photo (schema v14) and use it for the 48px list avatar; full bytes stay for offer image hosting. Existing photos are backfilled lazily at startup. Thumbnail is local-only (excluded from CRDT sync and backups by the JSON codec). - Add indexes on varieties(is_deleted,is_draft), attachments(parent_type, parent_id,kind), lots(variety_id) via @TableIndex. - Debounce watchInventoryView (~250ms) so a burst of table writes triggers one reload, not seven. - cacheWidth/cacheHeight on the list avatar decode. - Scale test raised 3k -> 10k; migration test v13 -> v14.
16832 lines
551 KiB
Dart
16832 lines
551 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $VarietiesTable extends Varieties
|
|
with TableInfo<$VarietiesTable, Variety> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$VarietiesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _labelMeta = const VerificationMeta('label');
|
|
@override
|
|
late final GeneratedColumn<String> label = GeneratedColumn<String>(
|
|
'label',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _speciesIdMeta = const VerificationMeta(
|
|
'speciesId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
|
|
'species_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _cultivarNameMeta = const VerificationMeta(
|
|
'cultivarName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> cultivarName = GeneratedColumn<String>(
|
|
'cultivar_name',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _categoryMeta = const VerificationMeta(
|
|
'category',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isDraftMeta = const VerificationMeta(
|
|
'isDraft',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDraft = GeneratedColumn<bool>(
|
|
'is_draft',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_draft" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _isOrganicMeta = const VerificationMeta(
|
|
'isOrganic',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isOrganic = GeneratedColumn<bool>(
|
|
'is_organic',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_organic" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _needsReproductionMeta = const VerificationMeta(
|
|
'needsReproduction',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> needsReproduction = GeneratedColumn<bool>(
|
|
'needs_reproduction',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("needs_reproduction" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _sowMonthsMeta = const VerificationMeta(
|
|
'sowMonths',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sowMonths = GeneratedColumn<int>(
|
|
'sow_months',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _transplantMonthsMeta = const VerificationMeta(
|
|
'transplantMonths',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> transplantMonths = GeneratedColumn<int>(
|
|
'transplant_months',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _floweringMonthsMeta = const VerificationMeta(
|
|
'floweringMonths',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> floweringMonths = GeneratedColumn<int>(
|
|
'flowering_months',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _fruitingMonthsMeta = const VerificationMeta(
|
|
'fruitingMonths',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> fruitingMonths = GeneratedColumn<int>(
|
|
'fruiting_months',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _seedHarvestMonthsMeta = const VerificationMeta(
|
|
'seedHarvestMonths',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> seedHarvestMonths = GeneratedColumn<int>(
|
|
'seed_harvest_months',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
label,
|
|
speciesId,
|
|
cultivarName,
|
|
category,
|
|
notes,
|
|
isDraft,
|
|
isOrganic,
|
|
needsReproduction,
|
|
sowMonths,
|
|
transplantMonths,
|
|
floweringMonths,
|
|
fruitingMonths,
|
|
seedHarvestMonths,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'varieties';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Variety> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('label')) {
|
|
context.handle(
|
|
_labelMeta,
|
|
label.isAcceptableOrUnknown(data['label']!, _labelMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_labelMeta);
|
|
}
|
|
if (data.containsKey('species_id')) {
|
|
context.handle(
|
|
_speciesIdMeta,
|
|
speciesId.isAcceptableOrUnknown(data['species_id']!, _speciesIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('cultivar_name')) {
|
|
context.handle(
|
|
_cultivarNameMeta,
|
|
cultivarName.isAcceptableOrUnknown(
|
|
data['cultivar_name']!,
|
|
_cultivarNameMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('category')) {
|
|
context.handle(
|
|
_categoryMeta,
|
|
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('is_draft')) {
|
|
context.handle(
|
|
_isDraftMeta,
|
|
isDraft.isAcceptableOrUnknown(data['is_draft']!, _isDraftMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('is_organic')) {
|
|
context.handle(
|
|
_isOrganicMeta,
|
|
isOrganic.isAcceptableOrUnknown(data['is_organic']!, _isOrganicMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('needs_reproduction')) {
|
|
context.handle(
|
|
_needsReproductionMeta,
|
|
needsReproduction.isAcceptableOrUnknown(
|
|
data['needs_reproduction']!,
|
|
_needsReproductionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('sow_months')) {
|
|
context.handle(
|
|
_sowMonthsMeta,
|
|
sowMonths.isAcceptableOrUnknown(data['sow_months']!, _sowMonthsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('transplant_months')) {
|
|
context.handle(
|
|
_transplantMonthsMeta,
|
|
transplantMonths.isAcceptableOrUnknown(
|
|
data['transplant_months']!,
|
|
_transplantMonthsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('flowering_months')) {
|
|
context.handle(
|
|
_floweringMonthsMeta,
|
|
floweringMonths.isAcceptableOrUnknown(
|
|
data['flowering_months']!,
|
|
_floweringMonthsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('fruiting_months')) {
|
|
context.handle(
|
|
_fruitingMonthsMeta,
|
|
fruitingMonths.isAcceptableOrUnknown(
|
|
data['fruiting_months']!,
|
|
_fruitingMonthsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('seed_harvest_months')) {
|
|
context.handle(
|
|
_seedHarvestMonthsMeta,
|
|
seedHarvestMonths.isAcceptableOrUnknown(
|
|
data['seed_harvest_months']!,
|
|
_seedHarvestMonthsMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Variety map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Variety(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
label: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}label'],
|
|
)!,
|
|
speciesId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}species_id'],
|
|
),
|
|
cultivarName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}cultivar_name'],
|
|
),
|
|
category: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category'],
|
|
),
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
isDraft: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_draft'],
|
|
)!,
|
|
isOrganic: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_organic'],
|
|
)!,
|
|
needsReproduction: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}needs_reproduction'],
|
|
)!,
|
|
sowMonths: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sow_months'],
|
|
),
|
|
transplantMonths: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}transplant_months'],
|
|
),
|
|
floweringMonths: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}flowering_months'],
|
|
),
|
|
fruitingMonths: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}fruiting_months'],
|
|
),
|
|
seedHarvestMonths: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}seed_harvest_months'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$VarietiesTable createAlias(String alias) {
|
|
return $VarietiesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Variety extends DataClass implements Insertable<Variety> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String label;
|
|
final String? speciesId;
|
|
final String? cultivarName;
|
|
final String? category;
|
|
final String? notes;
|
|
|
|
/// A draft captured photo-first ("capture now, catalogue later"): it holds a
|
|
/// photo but not yet a real name, and lives in the "to catalogue" tray until
|
|
/// the user labels it. A plain LWW scalar, so it merges like any other field.
|
|
final bool isDraft;
|
|
|
|
/// Grower-declared organic ("eco") provenance. A self-declaration, not a
|
|
/// third-party certification (that would be a separate flag). Surfaced as a
|
|
/// badge and an inventory filter. A plain LWW scalar.
|
|
final bool isOrganic;
|
|
|
|
/// A stewardship intent set by the grower: "regrow this variety this season"
|
|
/// before its stock or vitality runs out. Complements the automatic viability
|
|
/// warning (which is age-derived) with an explicit human decision. Surfaced
|
|
/// as a badge and an inventory filter. A plain LWW scalar.
|
|
final bool needsReproduction;
|
|
|
|
/// Advisory crop-calendar months, typical for this variety — when to sow,
|
|
/// transplant, expect flowers/fruit, and harvest seed. Each phase usually
|
|
/// spans several months (e.g. sow in spring *and* autumn), so each is a set
|
|
/// of months packed as a 12-bit mask (see `domain/crop_calendar.dart`), an
|
|
/// optional LWW scalar; null means "not recorded". Guidance, not a per-year
|
|
/// actuals log (that path stays available via Movements).
|
|
final int? sowMonths;
|
|
final int? transplantMonths;
|
|
final int? floweringMonths;
|
|
final int? fruitingMonths;
|
|
final int? seedHarvestMonths;
|
|
const Variety({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.label,
|
|
this.speciesId,
|
|
this.cultivarName,
|
|
this.category,
|
|
this.notes,
|
|
required this.isDraft,
|
|
required this.isOrganic,
|
|
required this.needsReproduction,
|
|
this.sowMonths,
|
|
this.transplantMonths,
|
|
this.floweringMonths,
|
|
this.fruitingMonths,
|
|
this.seedHarvestMonths,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['label'] = Variable<String>(label);
|
|
if (!nullToAbsent || speciesId != null) {
|
|
map['species_id'] = Variable<String>(speciesId);
|
|
}
|
|
if (!nullToAbsent || cultivarName != null) {
|
|
map['cultivar_name'] = Variable<String>(cultivarName);
|
|
}
|
|
if (!nullToAbsent || category != null) {
|
|
map['category'] = Variable<String>(category);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
map['is_draft'] = Variable<bool>(isDraft);
|
|
map['is_organic'] = Variable<bool>(isOrganic);
|
|
map['needs_reproduction'] = Variable<bool>(needsReproduction);
|
|
if (!nullToAbsent || sowMonths != null) {
|
|
map['sow_months'] = Variable<int>(sowMonths);
|
|
}
|
|
if (!nullToAbsent || transplantMonths != null) {
|
|
map['transplant_months'] = Variable<int>(transplantMonths);
|
|
}
|
|
if (!nullToAbsent || floweringMonths != null) {
|
|
map['flowering_months'] = Variable<int>(floweringMonths);
|
|
}
|
|
if (!nullToAbsent || fruitingMonths != null) {
|
|
map['fruiting_months'] = Variable<int>(fruitingMonths);
|
|
}
|
|
if (!nullToAbsent || seedHarvestMonths != null) {
|
|
map['seed_harvest_months'] = Variable<int>(seedHarvestMonths);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
VarietiesCompanion toCompanion(bool nullToAbsent) {
|
|
return VarietiesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
label: Value(label),
|
|
speciesId: speciesId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(speciesId),
|
|
cultivarName: cultivarName == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(cultivarName),
|
|
category: category == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(category),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
isDraft: Value(isDraft),
|
|
isOrganic: Value(isOrganic),
|
|
needsReproduction: Value(needsReproduction),
|
|
sowMonths: sowMonths == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sowMonths),
|
|
transplantMonths: transplantMonths == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(transplantMonths),
|
|
floweringMonths: floweringMonths == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(floweringMonths),
|
|
fruitingMonths: fruitingMonths == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(fruitingMonths),
|
|
seedHarvestMonths: seedHarvestMonths == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(seedHarvestMonths),
|
|
);
|
|
}
|
|
|
|
factory Variety.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Variety(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
label: serializer.fromJson<String>(json['label']),
|
|
speciesId: serializer.fromJson<String?>(json['speciesId']),
|
|
cultivarName: serializer.fromJson<String?>(json['cultivarName']),
|
|
category: serializer.fromJson<String?>(json['category']),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
isDraft: serializer.fromJson<bool>(json['isDraft']),
|
|
isOrganic: serializer.fromJson<bool>(json['isOrganic']),
|
|
needsReproduction: serializer.fromJson<bool>(json['needsReproduction']),
|
|
sowMonths: serializer.fromJson<int?>(json['sowMonths']),
|
|
transplantMonths: serializer.fromJson<int?>(json['transplantMonths']),
|
|
floweringMonths: serializer.fromJson<int?>(json['floweringMonths']),
|
|
fruitingMonths: serializer.fromJson<int?>(json['fruitingMonths']),
|
|
seedHarvestMonths: serializer.fromJson<int?>(json['seedHarvestMonths']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'label': serializer.toJson<String>(label),
|
|
'speciesId': serializer.toJson<String?>(speciesId),
|
|
'cultivarName': serializer.toJson<String?>(cultivarName),
|
|
'category': serializer.toJson<String?>(category),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
'isDraft': serializer.toJson<bool>(isDraft),
|
|
'isOrganic': serializer.toJson<bool>(isOrganic),
|
|
'needsReproduction': serializer.toJson<bool>(needsReproduction),
|
|
'sowMonths': serializer.toJson<int?>(sowMonths),
|
|
'transplantMonths': serializer.toJson<int?>(transplantMonths),
|
|
'floweringMonths': serializer.toJson<int?>(floweringMonths),
|
|
'fruitingMonths': serializer.toJson<int?>(fruitingMonths),
|
|
'seedHarvestMonths': serializer.toJson<int?>(seedHarvestMonths),
|
|
};
|
|
}
|
|
|
|
Variety copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? label,
|
|
Value<String?> speciesId = const Value.absent(),
|
|
Value<String?> cultivarName = const Value.absent(),
|
|
Value<String?> category = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
bool? isDraft,
|
|
bool? isOrganic,
|
|
bool? needsReproduction,
|
|
Value<int?> sowMonths = const Value.absent(),
|
|
Value<int?> transplantMonths = const Value.absent(),
|
|
Value<int?> floweringMonths = const Value.absent(),
|
|
Value<int?> fruitingMonths = const Value.absent(),
|
|
Value<int?> seedHarvestMonths = const Value.absent(),
|
|
}) => Variety(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
label: label ?? this.label,
|
|
speciesId: speciesId.present ? speciesId.value : this.speciesId,
|
|
cultivarName: cultivarName.present ? cultivarName.value : this.cultivarName,
|
|
category: category.present ? category.value : this.category,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
isDraft: isDraft ?? this.isDraft,
|
|
isOrganic: isOrganic ?? this.isOrganic,
|
|
needsReproduction: needsReproduction ?? this.needsReproduction,
|
|
sowMonths: sowMonths.present ? sowMonths.value : this.sowMonths,
|
|
transplantMonths: transplantMonths.present
|
|
? transplantMonths.value
|
|
: this.transplantMonths,
|
|
floweringMonths: floweringMonths.present
|
|
? floweringMonths.value
|
|
: this.floweringMonths,
|
|
fruitingMonths: fruitingMonths.present
|
|
? fruitingMonths.value
|
|
: this.fruitingMonths,
|
|
seedHarvestMonths: seedHarvestMonths.present
|
|
? seedHarvestMonths.value
|
|
: this.seedHarvestMonths,
|
|
);
|
|
Variety copyWithCompanion(VarietiesCompanion data) {
|
|
return Variety(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
label: data.label.present ? data.label.value : this.label,
|
|
speciesId: data.speciesId.present ? data.speciesId.value : this.speciesId,
|
|
cultivarName: data.cultivarName.present
|
|
? data.cultivarName.value
|
|
: this.cultivarName,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
isDraft: data.isDraft.present ? data.isDraft.value : this.isDraft,
|
|
isOrganic: data.isOrganic.present ? data.isOrganic.value : this.isOrganic,
|
|
needsReproduction: data.needsReproduction.present
|
|
? data.needsReproduction.value
|
|
: this.needsReproduction,
|
|
sowMonths: data.sowMonths.present ? data.sowMonths.value : this.sowMonths,
|
|
transplantMonths: data.transplantMonths.present
|
|
? data.transplantMonths.value
|
|
: this.transplantMonths,
|
|
floweringMonths: data.floweringMonths.present
|
|
? data.floweringMonths.value
|
|
: this.floweringMonths,
|
|
fruitingMonths: data.fruitingMonths.present
|
|
? data.fruitingMonths.value
|
|
: this.fruitingMonths,
|
|
seedHarvestMonths: data.seedHarvestMonths.present
|
|
? data.seedHarvestMonths.value
|
|
: this.seedHarvestMonths,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Variety(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('label: $label, ')
|
|
..write('speciesId: $speciesId, ')
|
|
..write('cultivarName: $cultivarName, ')
|
|
..write('category: $category, ')
|
|
..write('notes: $notes, ')
|
|
..write('isDraft: $isDraft, ')
|
|
..write('isOrganic: $isOrganic, ')
|
|
..write('needsReproduction: $needsReproduction, ')
|
|
..write('sowMonths: $sowMonths, ')
|
|
..write('transplantMonths: $transplantMonths, ')
|
|
..write('floweringMonths: $floweringMonths, ')
|
|
..write('fruitingMonths: $fruitingMonths, ')
|
|
..write('seedHarvestMonths: $seedHarvestMonths')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
label,
|
|
speciesId,
|
|
cultivarName,
|
|
category,
|
|
notes,
|
|
isDraft,
|
|
isOrganic,
|
|
needsReproduction,
|
|
sowMonths,
|
|
transplantMonths,
|
|
floweringMonths,
|
|
fruitingMonths,
|
|
seedHarvestMonths,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Variety &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.label == this.label &&
|
|
other.speciesId == this.speciesId &&
|
|
other.cultivarName == this.cultivarName &&
|
|
other.category == this.category &&
|
|
other.notes == this.notes &&
|
|
other.isDraft == this.isDraft &&
|
|
other.isOrganic == this.isOrganic &&
|
|
other.needsReproduction == this.needsReproduction &&
|
|
other.sowMonths == this.sowMonths &&
|
|
other.transplantMonths == this.transplantMonths &&
|
|
other.floweringMonths == this.floweringMonths &&
|
|
other.fruitingMonths == this.fruitingMonths &&
|
|
other.seedHarvestMonths == this.seedHarvestMonths);
|
|
}
|
|
|
|
class VarietiesCompanion extends UpdateCompanion<Variety> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> label;
|
|
final Value<String?> speciesId;
|
|
final Value<String?> cultivarName;
|
|
final Value<String?> category;
|
|
final Value<String?> notes;
|
|
final Value<bool> isDraft;
|
|
final Value<bool> isOrganic;
|
|
final Value<bool> needsReproduction;
|
|
final Value<int?> sowMonths;
|
|
final Value<int?> transplantMonths;
|
|
final Value<int?> floweringMonths;
|
|
final Value<int?> fruitingMonths;
|
|
final Value<int?> seedHarvestMonths;
|
|
final Value<int> rowid;
|
|
const VarietiesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.label = const Value.absent(),
|
|
this.speciesId = const Value.absent(),
|
|
this.cultivarName = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.isDraft = const Value.absent(),
|
|
this.isOrganic = const Value.absent(),
|
|
this.needsReproduction = const Value.absent(),
|
|
this.sowMonths = const Value.absent(),
|
|
this.transplantMonths = const Value.absent(),
|
|
this.floweringMonths = const Value.absent(),
|
|
this.fruitingMonths = const Value.absent(),
|
|
this.seedHarvestMonths = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
VarietiesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String label,
|
|
this.speciesId = const Value.absent(),
|
|
this.cultivarName = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.isDraft = const Value.absent(),
|
|
this.isOrganic = const Value.absent(),
|
|
this.needsReproduction = const Value.absent(),
|
|
this.sowMonths = const Value.absent(),
|
|
this.transplantMonths = const Value.absent(),
|
|
this.floweringMonths = const Value.absent(),
|
|
this.fruitingMonths = const Value.absent(),
|
|
this.seedHarvestMonths = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
label = Value(label);
|
|
static Insertable<Variety> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? label,
|
|
Expression<String>? speciesId,
|
|
Expression<String>? cultivarName,
|
|
Expression<String>? category,
|
|
Expression<String>? notes,
|
|
Expression<bool>? isDraft,
|
|
Expression<bool>? isOrganic,
|
|
Expression<bool>? needsReproduction,
|
|
Expression<int>? sowMonths,
|
|
Expression<int>? transplantMonths,
|
|
Expression<int>? floweringMonths,
|
|
Expression<int>? fruitingMonths,
|
|
Expression<int>? seedHarvestMonths,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (label != null) 'label': label,
|
|
if (speciesId != null) 'species_id': speciesId,
|
|
if (cultivarName != null) 'cultivar_name': cultivarName,
|
|
if (category != null) 'category': category,
|
|
if (notes != null) 'notes': notes,
|
|
if (isDraft != null) 'is_draft': isDraft,
|
|
if (isOrganic != null) 'is_organic': isOrganic,
|
|
if (needsReproduction != null) 'needs_reproduction': needsReproduction,
|
|
if (sowMonths != null) 'sow_months': sowMonths,
|
|
if (transplantMonths != null) 'transplant_months': transplantMonths,
|
|
if (floweringMonths != null) 'flowering_months': floweringMonths,
|
|
if (fruitingMonths != null) 'fruiting_months': fruitingMonths,
|
|
if (seedHarvestMonths != null) 'seed_harvest_months': seedHarvestMonths,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
VarietiesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? label,
|
|
Value<String?>? speciesId,
|
|
Value<String?>? cultivarName,
|
|
Value<String?>? category,
|
|
Value<String?>? notes,
|
|
Value<bool>? isDraft,
|
|
Value<bool>? isOrganic,
|
|
Value<bool>? needsReproduction,
|
|
Value<int?>? sowMonths,
|
|
Value<int?>? transplantMonths,
|
|
Value<int?>? floweringMonths,
|
|
Value<int?>? fruitingMonths,
|
|
Value<int?>? seedHarvestMonths,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return VarietiesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
label: label ?? this.label,
|
|
speciesId: speciesId ?? this.speciesId,
|
|
cultivarName: cultivarName ?? this.cultivarName,
|
|
category: category ?? this.category,
|
|
notes: notes ?? this.notes,
|
|
isDraft: isDraft ?? this.isDraft,
|
|
isOrganic: isOrganic ?? this.isOrganic,
|
|
needsReproduction: needsReproduction ?? this.needsReproduction,
|
|
sowMonths: sowMonths ?? this.sowMonths,
|
|
transplantMonths: transplantMonths ?? this.transplantMonths,
|
|
floweringMonths: floweringMonths ?? this.floweringMonths,
|
|
fruitingMonths: fruitingMonths ?? this.fruitingMonths,
|
|
seedHarvestMonths: seedHarvestMonths ?? this.seedHarvestMonths,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (label.present) {
|
|
map['label'] = Variable<String>(label.value);
|
|
}
|
|
if (speciesId.present) {
|
|
map['species_id'] = Variable<String>(speciesId.value);
|
|
}
|
|
if (cultivarName.present) {
|
|
map['cultivar_name'] = Variable<String>(cultivarName.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (isDraft.present) {
|
|
map['is_draft'] = Variable<bool>(isDraft.value);
|
|
}
|
|
if (isOrganic.present) {
|
|
map['is_organic'] = Variable<bool>(isOrganic.value);
|
|
}
|
|
if (needsReproduction.present) {
|
|
map['needs_reproduction'] = Variable<bool>(needsReproduction.value);
|
|
}
|
|
if (sowMonths.present) {
|
|
map['sow_months'] = Variable<int>(sowMonths.value);
|
|
}
|
|
if (transplantMonths.present) {
|
|
map['transplant_months'] = Variable<int>(transplantMonths.value);
|
|
}
|
|
if (floweringMonths.present) {
|
|
map['flowering_months'] = Variable<int>(floweringMonths.value);
|
|
}
|
|
if (fruitingMonths.present) {
|
|
map['fruiting_months'] = Variable<int>(fruitingMonths.value);
|
|
}
|
|
if (seedHarvestMonths.present) {
|
|
map['seed_harvest_months'] = Variable<int>(seedHarvestMonths.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('VarietiesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('label: $label, ')
|
|
..write('speciesId: $speciesId, ')
|
|
..write('cultivarName: $cultivarName, ')
|
|
..write('category: $category, ')
|
|
..write('notes: $notes, ')
|
|
..write('isDraft: $isDraft, ')
|
|
..write('isOrganic: $isOrganic, ')
|
|
..write('needsReproduction: $needsReproduction, ')
|
|
..write('sowMonths: $sowMonths, ')
|
|
..write('transplantMonths: $transplantMonths, ')
|
|
..write('floweringMonths: $floweringMonths, ')
|
|
..write('fruitingMonths: $fruitingMonths, ')
|
|
..write('seedHarvestMonths: $seedHarvestMonths, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $VarietyVernacularNamesTable extends VarietyVernacularNames
|
|
with TableInfo<$VarietyVernacularNamesTable, VarietyVernacularName> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$VarietyVernacularNamesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
|
|
'varietyId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
|
|
'variety_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _languageMeta = const VerificationMeta(
|
|
'language',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> language = GeneratedColumn<String>(
|
|
'language',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _regionMeta = const VerificationMeta('region');
|
|
@override
|
|
late final GeneratedColumn<String> region = GeneratedColumn<String>(
|
|
'region',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
name,
|
|
language,
|
|
region,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'variety_vernacular_names';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<VarietyVernacularName> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('variety_id')) {
|
|
context.handle(
|
|
_varietyIdMeta,
|
|
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_varietyIdMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('language')) {
|
|
context.handle(
|
|
_languageMeta,
|
|
language.isAcceptableOrUnknown(data['language']!, _languageMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('region')) {
|
|
context.handle(
|
|
_regionMeta,
|
|
region.isAcceptableOrUnknown(data['region']!, _regionMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
VarietyVernacularName map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return VarietyVernacularName(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
varietyId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variety_id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
language: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}language'],
|
|
),
|
|
region: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}region'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$VarietyVernacularNamesTable createAlias(String alias) {
|
|
return $VarietyVernacularNamesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class VarietyVernacularName extends DataClass
|
|
implements Insertable<VarietyVernacularName> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String varietyId;
|
|
final String name;
|
|
final String? language;
|
|
final String? region;
|
|
const VarietyVernacularName({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.varietyId,
|
|
required this.name,
|
|
this.language,
|
|
this.region,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['variety_id'] = Variable<String>(varietyId);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || language != null) {
|
|
map['language'] = Variable<String>(language);
|
|
}
|
|
if (!nullToAbsent || region != null) {
|
|
map['region'] = Variable<String>(region);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
VarietyVernacularNamesCompanion toCompanion(bool nullToAbsent) {
|
|
return VarietyVernacularNamesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
varietyId: Value(varietyId),
|
|
name: Value(name),
|
|
language: language == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(language),
|
|
region: region == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(region),
|
|
);
|
|
}
|
|
|
|
factory VarietyVernacularName.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return VarietyVernacularName(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
varietyId: serializer.fromJson<String>(json['varietyId']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
language: serializer.fromJson<String?>(json['language']),
|
|
region: serializer.fromJson<String?>(json['region']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'varietyId': serializer.toJson<String>(varietyId),
|
|
'name': serializer.toJson<String>(name),
|
|
'language': serializer.toJson<String?>(language),
|
|
'region': serializer.toJson<String?>(region),
|
|
};
|
|
}
|
|
|
|
VarietyVernacularName copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? varietyId,
|
|
String? name,
|
|
Value<String?> language = const Value.absent(),
|
|
Value<String?> region = const Value.absent(),
|
|
}) => VarietyVernacularName(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
name: name ?? this.name,
|
|
language: language.present ? language.value : this.language,
|
|
region: region.present ? region.value : this.region,
|
|
);
|
|
VarietyVernacularName copyWithCompanion(
|
|
VarietyVernacularNamesCompanion data,
|
|
) {
|
|
return VarietyVernacularName(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
language: data.language.present ? data.language.value : this.language,
|
|
region: data.region.present ? data.region.value : this.region,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('VarietyVernacularName(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('name: $name, ')
|
|
..write('language: $language, ')
|
|
..write('region: $region')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
name,
|
|
language,
|
|
region,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is VarietyVernacularName &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.varietyId == this.varietyId &&
|
|
other.name == this.name &&
|
|
other.language == this.language &&
|
|
other.region == this.region);
|
|
}
|
|
|
|
class VarietyVernacularNamesCompanion
|
|
extends UpdateCompanion<VarietyVernacularName> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> varietyId;
|
|
final Value<String> name;
|
|
final Value<String?> language;
|
|
final Value<String?> region;
|
|
final Value<int> rowid;
|
|
const VarietyVernacularNamesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.language = const Value.absent(),
|
|
this.region = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
VarietyVernacularNamesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String varietyId,
|
|
required String name,
|
|
this.language = const Value.absent(),
|
|
this.region = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
varietyId = Value(varietyId),
|
|
name = Value(name);
|
|
static Insertable<VarietyVernacularName> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? varietyId,
|
|
Expression<String>? name,
|
|
Expression<String>? language,
|
|
Expression<String>? region,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (varietyId != null) 'variety_id': varietyId,
|
|
if (name != null) 'name': name,
|
|
if (language != null) 'language': language,
|
|
if (region != null) 'region': region,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
VarietyVernacularNamesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? varietyId,
|
|
Value<String>? name,
|
|
Value<String?>? language,
|
|
Value<String?>? region,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return VarietyVernacularNamesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
name: name ?? this.name,
|
|
language: language ?? this.language,
|
|
region: region ?? this.region,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (varietyId.present) {
|
|
map['variety_id'] = Variable<String>(varietyId.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (language.present) {
|
|
map['language'] = Variable<String>(language.value);
|
|
}
|
|
if (region.present) {
|
|
map['region'] = Variable<String>(region.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('VarietyVernacularNamesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('name: $name, ')
|
|
..write('language: $language, ')
|
|
..write('region: $region, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $SpeciesTable extends Species with TableInfo<$SpeciesTable, Specy> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$SpeciesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _scientificNameMeta = const VerificationMeta(
|
|
'scientificName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> scientificName = GeneratedColumn<String>(
|
|
'scientific_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _wikidataQidMeta = const VerificationMeta(
|
|
'wikidataQid',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> wikidataQid = GeneratedColumn<String>(
|
|
'wikidata_qid',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _gbifKeyMeta = const VerificationMeta(
|
|
'gbifKey',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> gbifKey = GeneratedColumn<int>(
|
|
'gbif_key',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _familyMeta = const VerificationMeta('family');
|
|
@override
|
|
late final GeneratedColumn<String> family = GeneratedColumn<String>(
|
|
'family',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isBundledMeta = const VerificationMeta(
|
|
'isBundled',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isBundled = GeneratedColumn<bool>(
|
|
'is_bundled',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_bundled" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _viabilityYearsMeta = const VerificationMeta(
|
|
'viabilityYears',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> viabilityYears = GeneratedColumn<int>(
|
|
'viability_years',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
scientificName,
|
|
wikidataQid,
|
|
gbifKey,
|
|
family,
|
|
isBundled,
|
|
viabilityYears,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'species';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Specy> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('scientific_name')) {
|
|
context.handle(
|
|
_scientificNameMeta,
|
|
scientificName.isAcceptableOrUnknown(
|
|
data['scientific_name']!,
|
|
_scientificNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_scientificNameMeta);
|
|
}
|
|
if (data.containsKey('wikidata_qid')) {
|
|
context.handle(
|
|
_wikidataQidMeta,
|
|
wikidataQid.isAcceptableOrUnknown(
|
|
data['wikidata_qid']!,
|
|
_wikidataQidMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('gbif_key')) {
|
|
context.handle(
|
|
_gbifKeyMeta,
|
|
gbifKey.isAcceptableOrUnknown(data['gbif_key']!, _gbifKeyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('family')) {
|
|
context.handle(
|
|
_familyMeta,
|
|
family.isAcceptableOrUnknown(data['family']!, _familyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('is_bundled')) {
|
|
context.handle(
|
|
_isBundledMeta,
|
|
isBundled.isAcceptableOrUnknown(data['is_bundled']!, _isBundledMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('viability_years')) {
|
|
context.handle(
|
|
_viabilityYearsMeta,
|
|
viabilityYears.isAcceptableOrUnknown(
|
|
data['viability_years']!,
|
|
_viabilityYearsMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Specy map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Specy(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
scientificName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}scientific_name'],
|
|
)!,
|
|
wikidataQid: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}wikidata_qid'],
|
|
),
|
|
gbifKey: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}gbif_key'],
|
|
),
|
|
family: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}family'],
|
|
),
|
|
isBundled: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_bundled'],
|
|
)!,
|
|
viabilityYears: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}viability_years'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$SpeciesTable createAlias(String alias) {
|
|
return $SpeciesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Specy extends DataClass implements Insertable<Specy> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String scientificName;
|
|
final String? wikidataQid;
|
|
final int? gbifKey;
|
|
final String? family;
|
|
final bool isBundled;
|
|
|
|
/// Typical seed longevity in years under normal home storage — public-domain
|
|
/// reference data bundled with the catalog (agricultural-extension viability
|
|
/// tables). Drives the "expiring / past viability" warning on aging lots by
|
|
/// comparing against a lot's [Lots.harvestYear]. Nullable: unknown for
|
|
/// species without a bundled figure.
|
|
final int? viabilityYears;
|
|
const Specy({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.scientificName,
|
|
this.wikidataQid,
|
|
this.gbifKey,
|
|
this.family,
|
|
required this.isBundled,
|
|
this.viabilityYears,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['scientific_name'] = Variable<String>(scientificName);
|
|
if (!nullToAbsent || wikidataQid != null) {
|
|
map['wikidata_qid'] = Variable<String>(wikidataQid);
|
|
}
|
|
if (!nullToAbsent || gbifKey != null) {
|
|
map['gbif_key'] = Variable<int>(gbifKey);
|
|
}
|
|
if (!nullToAbsent || family != null) {
|
|
map['family'] = Variable<String>(family);
|
|
}
|
|
map['is_bundled'] = Variable<bool>(isBundled);
|
|
if (!nullToAbsent || viabilityYears != null) {
|
|
map['viability_years'] = Variable<int>(viabilityYears);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
SpeciesCompanion toCompanion(bool nullToAbsent) {
|
|
return SpeciesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
scientificName: Value(scientificName),
|
|
wikidataQid: wikidataQid == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(wikidataQid),
|
|
gbifKey: gbifKey == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(gbifKey),
|
|
family: family == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(family),
|
|
isBundled: Value(isBundled),
|
|
viabilityYears: viabilityYears == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(viabilityYears),
|
|
);
|
|
}
|
|
|
|
factory Specy.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Specy(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
scientificName: serializer.fromJson<String>(json['scientificName']),
|
|
wikidataQid: serializer.fromJson<String?>(json['wikidataQid']),
|
|
gbifKey: serializer.fromJson<int?>(json['gbifKey']),
|
|
family: serializer.fromJson<String?>(json['family']),
|
|
isBundled: serializer.fromJson<bool>(json['isBundled']),
|
|
viabilityYears: serializer.fromJson<int?>(json['viabilityYears']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'scientificName': serializer.toJson<String>(scientificName),
|
|
'wikidataQid': serializer.toJson<String?>(wikidataQid),
|
|
'gbifKey': serializer.toJson<int?>(gbifKey),
|
|
'family': serializer.toJson<String?>(family),
|
|
'isBundled': serializer.toJson<bool>(isBundled),
|
|
'viabilityYears': serializer.toJson<int?>(viabilityYears),
|
|
};
|
|
}
|
|
|
|
Specy copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? scientificName,
|
|
Value<String?> wikidataQid = const Value.absent(),
|
|
Value<int?> gbifKey = const Value.absent(),
|
|
Value<String?> family = const Value.absent(),
|
|
bool? isBundled,
|
|
Value<int?> viabilityYears = const Value.absent(),
|
|
}) => Specy(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
scientificName: scientificName ?? this.scientificName,
|
|
wikidataQid: wikidataQid.present ? wikidataQid.value : this.wikidataQid,
|
|
gbifKey: gbifKey.present ? gbifKey.value : this.gbifKey,
|
|
family: family.present ? family.value : this.family,
|
|
isBundled: isBundled ?? this.isBundled,
|
|
viabilityYears: viabilityYears.present
|
|
? viabilityYears.value
|
|
: this.viabilityYears,
|
|
);
|
|
Specy copyWithCompanion(SpeciesCompanion data) {
|
|
return Specy(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
scientificName: data.scientificName.present
|
|
? data.scientificName.value
|
|
: this.scientificName,
|
|
wikidataQid: data.wikidataQid.present
|
|
? data.wikidataQid.value
|
|
: this.wikidataQid,
|
|
gbifKey: data.gbifKey.present ? data.gbifKey.value : this.gbifKey,
|
|
family: data.family.present ? data.family.value : this.family,
|
|
isBundled: data.isBundled.present ? data.isBundled.value : this.isBundled,
|
|
viabilityYears: data.viabilityYears.present
|
|
? data.viabilityYears.value
|
|
: this.viabilityYears,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Specy(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('scientificName: $scientificName, ')
|
|
..write('wikidataQid: $wikidataQid, ')
|
|
..write('gbifKey: $gbifKey, ')
|
|
..write('family: $family, ')
|
|
..write('isBundled: $isBundled, ')
|
|
..write('viabilityYears: $viabilityYears')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
scientificName,
|
|
wikidataQid,
|
|
gbifKey,
|
|
family,
|
|
isBundled,
|
|
viabilityYears,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Specy &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.scientificName == this.scientificName &&
|
|
other.wikidataQid == this.wikidataQid &&
|
|
other.gbifKey == this.gbifKey &&
|
|
other.family == this.family &&
|
|
other.isBundled == this.isBundled &&
|
|
other.viabilityYears == this.viabilityYears);
|
|
}
|
|
|
|
class SpeciesCompanion extends UpdateCompanion<Specy> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> scientificName;
|
|
final Value<String?> wikidataQid;
|
|
final Value<int?> gbifKey;
|
|
final Value<String?> family;
|
|
final Value<bool> isBundled;
|
|
final Value<int?> viabilityYears;
|
|
final Value<int> rowid;
|
|
const SpeciesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.scientificName = const Value.absent(),
|
|
this.wikidataQid = const Value.absent(),
|
|
this.gbifKey = const Value.absent(),
|
|
this.family = const Value.absent(),
|
|
this.isBundled = const Value.absent(),
|
|
this.viabilityYears = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
SpeciesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String scientificName,
|
|
this.wikidataQid = const Value.absent(),
|
|
this.gbifKey = const Value.absent(),
|
|
this.family = const Value.absent(),
|
|
this.isBundled = const Value.absent(),
|
|
this.viabilityYears = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
scientificName = Value(scientificName);
|
|
static Insertable<Specy> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? scientificName,
|
|
Expression<String>? wikidataQid,
|
|
Expression<int>? gbifKey,
|
|
Expression<String>? family,
|
|
Expression<bool>? isBundled,
|
|
Expression<int>? viabilityYears,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (scientificName != null) 'scientific_name': scientificName,
|
|
if (wikidataQid != null) 'wikidata_qid': wikidataQid,
|
|
if (gbifKey != null) 'gbif_key': gbifKey,
|
|
if (family != null) 'family': family,
|
|
if (isBundled != null) 'is_bundled': isBundled,
|
|
if (viabilityYears != null) 'viability_years': viabilityYears,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
SpeciesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? scientificName,
|
|
Value<String?>? wikidataQid,
|
|
Value<int?>? gbifKey,
|
|
Value<String?>? family,
|
|
Value<bool>? isBundled,
|
|
Value<int?>? viabilityYears,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return SpeciesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
scientificName: scientificName ?? this.scientificName,
|
|
wikidataQid: wikidataQid ?? this.wikidataQid,
|
|
gbifKey: gbifKey ?? this.gbifKey,
|
|
family: family ?? this.family,
|
|
isBundled: isBundled ?? this.isBundled,
|
|
viabilityYears: viabilityYears ?? this.viabilityYears,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (scientificName.present) {
|
|
map['scientific_name'] = Variable<String>(scientificName.value);
|
|
}
|
|
if (wikidataQid.present) {
|
|
map['wikidata_qid'] = Variable<String>(wikidataQid.value);
|
|
}
|
|
if (gbifKey.present) {
|
|
map['gbif_key'] = Variable<int>(gbifKey.value);
|
|
}
|
|
if (family.present) {
|
|
map['family'] = Variable<String>(family.value);
|
|
}
|
|
if (isBundled.present) {
|
|
map['is_bundled'] = Variable<bool>(isBundled.value);
|
|
}
|
|
if (viabilityYears.present) {
|
|
map['viability_years'] = Variable<int>(viabilityYears.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SpeciesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('scientificName: $scientificName, ')
|
|
..write('wikidataQid: $wikidataQid, ')
|
|
..write('gbifKey: $gbifKey, ')
|
|
..write('family: $family, ')
|
|
..write('isBundled: $isBundled, ')
|
|
..write('viabilityYears: $viabilityYears, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $SpeciesCommonNamesTable extends SpeciesCommonNames
|
|
with TableInfo<$SpeciesCommonNamesTable, SpeciesCommonName> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$SpeciesCommonNamesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _speciesIdMeta = const VerificationMeta(
|
|
'speciesId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
|
|
'species_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _languageMeta = const VerificationMeta(
|
|
'language',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> language = GeneratedColumn<String>(
|
|
'language',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
speciesId,
|
|
name,
|
|
language,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'species_common_names';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<SpeciesCommonName> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('species_id')) {
|
|
context.handle(
|
|
_speciesIdMeta,
|
|
speciesId.isAcceptableOrUnknown(data['species_id']!, _speciesIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_speciesIdMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('language')) {
|
|
context.handle(
|
|
_languageMeta,
|
|
language.isAcceptableOrUnknown(data['language']!, _languageMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
SpeciesCommonName map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return SpeciesCommonName(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
speciesId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}species_id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
language: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}language'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$SpeciesCommonNamesTable createAlias(String alias) {
|
|
return $SpeciesCommonNamesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class SpeciesCommonName extends DataClass
|
|
implements Insertable<SpeciesCommonName> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String speciesId;
|
|
final String name;
|
|
final String? language;
|
|
const SpeciesCommonName({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.speciesId,
|
|
required this.name,
|
|
this.language,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['species_id'] = Variable<String>(speciesId);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || language != null) {
|
|
map['language'] = Variable<String>(language);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
SpeciesCommonNamesCompanion toCompanion(bool nullToAbsent) {
|
|
return SpeciesCommonNamesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
speciesId: Value(speciesId),
|
|
name: Value(name),
|
|
language: language == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(language),
|
|
);
|
|
}
|
|
|
|
factory SpeciesCommonName.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return SpeciesCommonName(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
speciesId: serializer.fromJson<String>(json['speciesId']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
language: serializer.fromJson<String?>(json['language']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'speciesId': serializer.toJson<String>(speciesId),
|
|
'name': serializer.toJson<String>(name),
|
|
'language': serializer.toJson<String?>(language),
|
|
};
|
|
}
|
|
|
|
SpeciesCommonName copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? speciesId,
|
|
String? name,
|
|
Value<String?> language = const Value.absent(),
|
|
}) => SpeciesCommonName(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
speciesId: speciesId ?? this.speciesId,
|
|
name: name ?? this.name,
|
|
language: language.present ? language.value : this.language,
|
|
);
|
|
SpeciesCommonName copyWithCompanion(SpeciesCommonNamesCompanion data) {
|
|
return SpeciesCommonName(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
speciesId: data.speciesId.present ? data.speciesId.value : this.speciesId,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
language: data.language.present ? data.language.value : this.language,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SpeciesCommonName(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('speciesId: $speciesId, ')
|
|
..write('name: $name, ')
|
|
..write('language: $language')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
speciesId,
|
|
name,
|
|
language,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is SpeciesCommonName &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.speciesId == this.speciesId &&
|
|
other.name == this.name &&
|
|
other.language == this.language);
|
|
}
|
|
|
|
class SpeciesCommonNamesCompanion extends UpdateCompanion<SpeciesCommonName> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> speciesId;
|
|
final Value<String> name;
|
|
final Value<String?> language;
|
|
final Value<int> rowid;
|
|
const SpeciesCommonNamesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.speciesId = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.language = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
SpeciesCommonNamesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String speciesId,
|
|
required String name,
|
|
this.language = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
speciesId = Value(speciesId),
|
|
name = Value(name);
|
|
static Insertable<SpeciesCommonName> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? speciesId,
|
|
Expression<String>? name,
|
|
Expression<String>? language,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (speciesId != null) 'species_id': speciesId,
|
|
if (name != null) 'name': name,
|
|
if (language != null) 'language': language,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
SpeciesCommonNamesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? speciesId,
|
|
Value<String>? name,
|
|
Value<String?>? language,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return SpeciesCommonNamesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
speciesId: speciesId ?? this.speciesId,
|
|
name: name ?? this.name,
|
|
language: language ?? this.language,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (speciesId.present) {
|
|
map['species_id'] = Variable<String>(speciesId.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (language.present) {
|
|
map['language'] = Variable<String>(language.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SpeciesCommonNamesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('speciesId: $speciesId, ')
|
|
..write('name: $name, ')
|
|
..write('language: $language, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $LotsTable extends Lots with TableInfo<$LotsTable, Lot> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$LotsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
|
|
'varietyId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
|
|
'variety_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<LotType, String> type =
|
|
GeneratedColumn<String>(
|
|
'type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('seed'),
|
|
).withConverter<LotType>($LotsTable.$convertertype);
|
|
static const VerificationMeta _harvestYearMeta = const VerificationMeta(
|
|
'harvestYear',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> harvestYear = GeneratedColumn<int>(
|
|
'harvest_year',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _harvestMonthMeta = const VerificationMeta(
|
|
'harvestMonth',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> harvestMonth = GeneratedColumn<int>(
|
|
'harvest_month',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityKindMeta = const VerificationMeta(
|
|
'quantityKind',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
|
|
'quantity_kind',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityPreciseMeta = const VerificationMeta(
|
|
'quantityPrecise',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
|
|
'quantity_precise',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityLabelMeta = const VerificationMeta(
|
|
'quantityLabel',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
|
|
'quantity_label',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<Presentation?, String>
|
|
presentation = GeneratedColumn<String>(
|
|
'presentation',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<Presentation?>($LotsTable.$converterpresentationn);
|
|
static const VerificationMeta _storageLocationMeta = const VerificationMeta(
|
|
'storageLocation',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> storageLocation = GeneratedColumn<String>(
|
|
'storage_location',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<OfferStatus, String> offerStatus =
|
|
GeneratedColumn<String>(
|
|
'offer_status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('private'),
|
|
).withConverter<OfferStatus>($LotsTable.$converterofferStatus);
|
|
static const VerificationMeta _seedbankIdMeta = const VerificationMeta(
|
|
'seedbankId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> seedbankId = GeneratedColumn<String>(
|
|
'seedbank_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _originNameMeta = const VerificationMeta(
|
|
'originName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originName = GeneratedColumn<String>(
|
|
'origin_name',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _originPlaceMeta = const VerificationMeta(
|
|
'originPlace',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originPlace = GeneratedColumn<String>(
|
|
'origin_place',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<Abundance?, String> abundance =
|
|
GeneratedColumn<String>(
|
|
'abundance',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<Abundance?>($LotsTable.$converterabundancen);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PreservationFormat?, String>
|
|
preservationFormat =
|
|
GeneratedColumn<String>(
|
|
'preservation_format',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<PreservationFormat?>(
|
|
$LotsTable.$converterpreservationFormatn,
|
|
);
|
|
static const VerificationMeta _priceAmountMeta = const VerificationMeta(
|
|
'priceAmount',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> priceAmount = GeneratedColumn<double>(
|
|
'price_amount',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _priceCurrencyMeta = const VerificationMeta(
|
|
'priceCurrency',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> priceCurrency = GeneratedColumn<String>(
|
|
'price_currency',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
type,
|
|
harvestYear,
|
|
harvestMonth,
|
|
quantityKind,
|
|
quantityPrecise,
|
|
quantityLabel,
|
|
presentation,
|
|
storageLocation,
|
|
offerStatus,
|
|
seedbankId,
|
|
originName,
|
|
originPlace,
|
|
abundance,
|
|
preservationFormat,
|
|
priceAmount,
|
|
priceCurrency,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'lots';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Lot> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('variety_id')) {
|
|
context.handle(
|
|
_varietyIdMeta,
|
|
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_varietyIdMeta);
|
|
}
|
|
if (data.containsKey('harvest_year')) {
|
|
context.handle(
|
|
_harvestYearMeta,
|
|
harvestYear.isAcceptableOrUnknown(
|
|
data['harvest_year']!,
|
|
_harvestYearMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('harvest_month')) {
|
|
context.handle(
|
|
_harvestMonthMeta,
|
|
harvestMonth.isAcceptableOrUnknown(
|
|
data['harvest_month']!,
|
|
_harvestMonthMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_kind')) {
|
|
context.handle(
|
|
_quantityKindMeta,
|
|
quantityKind.isAcceptableOrUnknown(
|
|
data['quantity_kind']!,
|
|
_quantityKindMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_precise')) {
|
|
context.handle(
|
|
_quantityPreciseMeta,
|
|
quantityPrecise.isAcceptableOrUnknown(
|
|
data['quantity_precise']!,
|
|
_quantityPreciseMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_label')) {
|
|
context.handle(
|
|
_quantityLabelMeta,
|
|
quantityLabel.isAcceptableOrUnknown(
|
|
data['quantity_label']!,
|
|
_quantityLabelMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('storage_location')) {
|
|
context.handle(
|
|
_storageLocationMeta,
|
|
storageLocation.isAcceptableOrUnknown(
|
|
data['storage_location']!,
|
|
_storageLocationMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('seedbank_id')) {
|
|
context.handle(
|
|
_seedbankIdMeta,
|
|
seedbankId.isAcceptableOrUnknown(data['seedbank_id']!, _seedbankIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('origin_name')) {
|
|
context.handle(
|
|
_originNameMeta,
|
|
originName.isAcceptableOrUnknown(data['origin_name']!, _originNameMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('origin_place')) {
|
|
context.handle(
|
|
_originPlaceMeta,
|
|
originPlace.isAcceptableOrUnknown(
|
|
data['origin_place']!,
|
|
_originPlaceMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('price_amount')) {
|
|
context.handle(
|
|
_priceAmountMeta,
|
|
priceAmount.isAcceptableOrUnknown(
|
|
data['price_amount']!,
|
|
_priceAmountMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('price_currency')) {
|
|
context.handle(
|
|
_priceCurrencyMeta,
|
|
priceCurrency.isAcceptableOrUnknown(
|
|
data['price_currency']!,
|
|
_priceCurrencyMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Lot map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Lot(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
varietyId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variety_id'],
|
|
)!,
|
|
type: $LotsTable.$convertertype.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}type'],
|
|
)!,
|
|
),
|
|
harvestYear: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}harvest_year'],
|
|
),
|
|
harvestMonth: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}harvest_month'],
|
|
),
|
|
quantityKind: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}quantity_kind'],
|
|
),
|
|
quantityPrecise: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}quantity_precise'],
|
|
),
|
|
quantityLabel: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}quantity_label'],
|
|
),
|
|
presentation: $LotsTable.$converterpresentationn.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}presentation'],
|
|
),
|
|
),
|
|
storageLocation: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}storage_location'],
|
|
),
|
|
offerStatus: $LotsTable.$converterofferStatus.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}offer_status'],
|
|
)!,
|
|
),
|
|
seedbankId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}seedbank_id'],
|
|
),
|
|
originName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_name'],
|
|
),
|
|
originPlace: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}origin_place'],
|
|
),
|
|
abundance: $LotsTable.$converterabundancen.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}abundance'],
|
|
),
|
|
),
|
|
preservationFormat: $LotsTable.$converterpreservationFormatn.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}preservation_format'],
|
|
),
|
|
),
|
|
priceAmount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}price_amount'],
|
|
),
|
|
priceCurrency: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}price_currency'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$LotsTable createAlias(String alias) {
|
|
return $LotsTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<LotType, String, String> $convertertype =
|
|
const EnumNameConverter<LotType>(LotType.values);
|
|
static JsonTypeConverter2<Presentation, String, String>
|
|
$converterpresentation = const EnumNameConverter<Presentation>(
|
|
Presentation.values,
|
|
);
|
|
static JsonTypeConverter2<Presentation?, String?, String?>
|
|
$converterpresentationn = JsonTypeConverter2.asNullable(
|
|
$converterpresentation,
|
|
);
|
|
static JsonTypeConverter2<OfferStatus, String, String> $converterofferStatus =
|
|
const EnumNameConverter<OfferStatus>(OfferStatus.values);
|
|
static JsonTypeConverter2<Abundance, String, String> $converterabundance =
|
|
const EnumNameConverter<Abundance>(Abundance.values);
|
|
static JsonTypeConverter2<Abundance?, String?, String?> $converterabundancen =
|
|
JsonTypeConverter2.asNullable($converterabundance);
|
|
static JsonTypeConverter2<PreservationFormat, String, String>
|
|
$converterpreservationFormat = const EnumNameConverter<PreservationFormat>(
|
|
PreservationFormat.values,
|
|
);
|
|
static JsonTypeConverter2<PreservationFormat?, String?, String?>
|
|
$converterpreservationFormatn = JsonTypeConverter2.asNullable(
|
|
$converterpreservationFormat,
|
|
);
|
|
}
|
|
|
|
class Lot extends DataClass implements Insertable<Lot> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String varietyId;
|
|
final LotType type;
|
|
final int? harvestYear;
|
|
final int? harvestMonth;
|
|
final String? quantityKind;
|
|
final double? quantityPrecise;
|
|
final String? quantityLabel;
|
|
final Presentation? presentation;
|
|
final String? storageLocation;
|
|
final OfferStatus offerStatus;
|
|
final String? seedbankId;
|
|
|
|
/// Provenance of this batch, kept as lightweight free text so it needs no
|
|
/// Party/Movement to record (the rigorous exchange path stays via Movements).
|
|
/// [originName] = who grew or gave the seeds; [originPlace] = where they come
|
|
/// from (with region/province). Both optional LWW scalars.
|
|
final String? originName;
|
|
final String? originPlace;
|
|
|
|
/// Optional coarse "how much I have" for this lot — see [Abundance]. An
|
|
/// offline alternative to the precise Quantity columns; either, both, or
|
|
/// neither may be set.
|
|
final Abundance? abundance;
|
|
|
|
/// How the (seed) lot is physically conserved — see [PreservationFormat].
|
|
/// Distinct from [storageLocation]. Optional.
|
|
final PreservationFormat? preservationFormat;
|
|
|
|
/// Asking price when [offerStatus] is `sell` (data-model §2.8 puts price on
|
|
/// the Offer; with offer state collapsed onto the Lot, it lives here and is
|
|
/// published with the market offer). Informational only — money changes
|
|
/// hands off-platform, never in-app. Null amount on a sell lot means
|
|
/// "price to be agreed" (the offer publishes without a price).
|
|
final double? priceAmount;
|
|
|
|
/// Free-text currency, like [Sales.currency]: "€", "Ğ1", a local/time
|
|
/// currency. Never assumed (sharing-model §6).
|
|
final String? priceCurrency;
|
|
const Lot({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.varietyId,
|
|
required this.type,
|
|
this.harvestYear,
|
|
this.harvestMonth,
|
|
this.quantityKind,
|
|
this.quantityPrecise,
|
|
this.quantityLabel,
|
|
this.presentation,
|
|
this.storageLocation,
|
|
required this.offerStatus,
|
|
this.seedbankId,
|
|
this.originName,
|
|
this.originPlace,
|
|
this.abundance,
|
|
this.preservationFormat,
|
|
this.priceAmount,
|
|
this.priceCurrency,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['variety_id'] = Variable<String>(varietyId);
|
|
{
|
|
map['type'] = Variable<String>($LotsTable.$convertertype.toSql(type));
|
|
}
|
|
if (!nullToAbsent || harvestYear != null) {
|
|
map['harvest_year'] = Variable<int>(harvestYear);
|
|
}
|
|
if (!nullToAbsent || harvestMonth != null) {
|
|
map['harvest_month'] = Variable<int>(harvestMonth);
|
|
}
|
|
if (!nullToAbsent || quantityKind != null) {
|
|
map['quantity_kind'] = Variable<String>(quantityKind);
|
|
}
|
|
if (!nullToAbsent || quantityPrecise != null) {
|
|
map['quantity_precise'] = Variable<double>(quantityPrecise);
|
|
}
|
|
if (!nullToAbsent || quantityLabel != null) {
|
|
map['quantity_label'] = Variable<String>(quantityLabel);
|
|
}
|
|
if (!nullToAbsent || presentation != null) {
|
|
map['presentation'] = Variable<String>(
|
|
$LotsTable.$converterpresentationn.toSql(presentation),
|
|
);
|
|
}
|
|
if (!nullToAbsent || storageLocation != null) {
|
|
map['storage_location'] = Variable<String>(storageLocation);
|
|
}
|
|
{
|
|
map['offer_status'] = Variable<String>(
|
|
$LotsTable.$converterofferStatus.toSql(offerStatus),
|
|
);
|
|
}
|
|
if (!nullToAbsent || seedbankId != null) {
|
|
map['seedbank_id'] = Variable<String>(seedbankId);
|
|
}
|
|
if (!nullToAbsent || originName != null) {
|
|
map['origin_name'] = Variable<String>(originName);
|
|
}
|
|
if (!nullToAbsent || originPlace != null) {
|
|
map['origin_place'] = Variable<String>(originPlace);
|
|
}
|
|
if (!nullToAbsent || abundance != null) {
|
|
map['abundance'] = Variable<String>(
|
|
$LotsTable.$converterabundancen.toSql(abundance),
|
|
);
|
|
}
|
|
if (!nullToAbsent || preservationFormat != null) {
|
|
map['preservation_format'] = Variable<String>(
|
|
$LotsTable.$converterpreservationFormatn.toSql(preservationFormat),
|
|
);
|
|
}
|
|
if (!nullToAbsent || priceAmount != null) {
|
|
map['price_amount'] = Variable<double>(priceAmount);
|
|
}
|
|
if (!nullToAbsent || priceCurrency != null) {
|
|
map['price_currency'] = Variable<String>(priceCurrency);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
LotsCompanion toCompanion(bool nullToAbsent) {
|
|
return LotsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
varietyId: Value(varietyId),
|
|
type: Value(type),
|
|
harvestYear: harvestYear == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(harvestYear),
|
|
harvestMonth: harvestMonth == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(harvestMonth),
|
|
quantityKind: quantityKind == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityKind),
|
|
quantityPrecise: quantityPrecise == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityPrecise),
|
|
quantityLabel: quantityLabel == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityLabel),
|
|
presentation: presentation == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(presentation),
|
|
storageLocation: storageLocation == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(storageLocation),
|
|
offerStatus: Value(offerStatus),
|
|
seedbankId: seedbankId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(seedbankId),
|
|
originName: originName == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(originName),
|
|
originPlace: originPlace == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(originPlace),
|
|
abundance: abundance == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(abundance),
|
|
preservationFormat: preservationFormat == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(preservationFormat),
|
|
priceAmount: priceAmount == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(priceAmount),
|
|
priceCurrency: priceCurrency == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(priceCurrency),
|
|
);
|
|
}
|
|
|
|
factory Lot.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Lot(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
varietyId: serializer.fromJson<String>(json['varietyId']),
|
|
type: $LotsTable.$convertertype.fromJson(
|
|
serializer.fromJson<String>(json['type']),
|
|
),
|
|
harvestYear: serializer.fromJson<int?>(json['harvestYear']),
|
|
harvestMonth: serializer.fromJson<int?>(json['harvestMonth']),
|
|
quantityKind: serializer.fromJson<String?>(json['quantityKind']),
|
|
quantityPrecise: serializer.fromJson<double?>(json['quantityPrecise']),
|
|
quantityLabel: serializer.fromJson<String?>(json['quantityLabel']),
|
|
presentation: $LotsTable.$converterpresentationn.fromJson(
|
|
serializer.fromJson<String?>(json['presentation']),
|
|
),
|
|
storageLocation: serializer.fromJson<String?>(json['storageLocation']),
|
|
offerStatus: $LotsTable.$converterofferStatus.fromJson(
|
|
serializer.fromJson<String>(json['offerStatus']),
|
|
),
|
|
seedbankId: serializer.fromJson<String?>(json['seedbankId']),
|
|
originName: serializer.fromJson<String?>(json['originName']),
|
|
originPlace: serializer.fromJson<String?>(json['originPlace']),
|
|
abundance: $LotsTable.$converterabundancen.fromJson(
|
|
serializer.fromJson<String?>(json['abundance']),
|
|
),
|
|
preservationFormat: $LotsTable.$converterpreservationFormatn.fromJson(
|
|
serializer.fromJson<String?>(json['preservationFormat']),
|
|
),
|
|
priceAmount: serializer.fromJson<double?>(json['priceAmount']),
|
|
priceCurrency: serializer.fromJson<String?>(json['priceCurrency']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'varietyId': serializer.toJson<String>(varietyId),
|
|
'type': serializer.toJson<String>($LotsTable.$convertertype.toJson(type)),
|
|
'harvestYear': serializer.toJson<int?>(harvestYear),
|
|
'harvestMonth': serializer.toJson<int?>(harvestMonth),
|
|
'quantityKind': serializer.toJson<String?>(quantityKind),
|
|
'quantityPrecise': serializer.toJson<double?>(quantityPrecise),
|
|
'quantityLabel': serializer.toJson<String?>(quantityLabel),
|
|
'presentation': serializer.toJson<String?>(
|
|
$LotsTable.$converterpresentationn.toJson(presentation),
|
|
),
|
|
'storageLocation': serializer.toJson<String?>(storageLocation),
|
|
'offerStatus': serializer.toJson<String>(
|
|
$LotsTable.$converterofferStatus.toJson(offerStatus),
|
|
),
|
|
'seedbankId': serializer.toJson<String?>(seedbankId),
|
|
'originName': serializer.toJson<String?>(originName),
|
|
'originPlace': serializer.toJson<String?>(originPlace),
|
|
'abundance': serializer.toJson<String?>(
|
|
$LotsTable.$converterabundancen.toJson(abundance),
|
|
),
|
|
'preservationFormat': serializer.toJson<String?>(
|
|
$LotsTable.$converterpreservationFormatn.toJson(preservationFormat),
|
|
),
|
|
'priceAmount': serializer.toJson<double?>(priceAmount),
|
|
'priceCurrency': serializer.toJson<String?>(priceCurrency),
|
|
};
|
|
}
|
|
|
|
Lot copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? varietyId,
|
|
LotType? type,
|
|
Value<int?> harvestYear = const Value.absent(),
|
|
Value<int?> harvestMonth = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<Presentation?> presentation = const Value.absent(),
|
|
Value<String?> storageLocation = const Value.absent(),
|
|
OfferStatus? offerStatus,
|
|
Value<String?> seedbankId = const Value.absent(),
|
|
Value<String?> originName = const Value.absent(),
|
|
Value<String?> originPlace = const Value.absent(),
|
|
Value<Abundance?> abundance = const Value.absent(),
|
|
Value<PreservationFormat?> preservationFormat = const Value.absent(),
|
|
Value<double?> priceAmount = const Value.absent(),
|
|
Value<String?> priceCurrency = const Value.absent(),
|
|
}) => Lot(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
type: type ?? this.type,
|
|
harvestYear: harvestYear.present ? harvestYear.value : this.harvestYear,
|
|
harvestMonth: harvestMonth.present ? harvestMonth.value : this.harvestMonth,
|
|
quantityKind: quantityKind.present ? quantityKind.value : this.quantityKind,
|
|
quantityPrecise: quantityPrecise.present
|
|
? quantityPrecise.value
|
|
: this.quantityPrecise,
|
|
quantityLabel: quantityLabel.present
|
|
? quantityLabel.value
|
|
: this.quantityLabel,
|
|
presentation: presentation.present ? presentation.value : this.presentation,
|
|
storageLocation: storageLocation.present
|
|
? storageLocation.value
|
|
: this.storageLocation,
|
|
offerStatus: offerStatus ?? this.offerStatus,
|
|
seedbankId: seedbankId.present ? seedbankId.value : this.seedbankId,
|
|
originName: originName.present ? originName.value : this.originName,
|
|
originPlace: originPlace.present ? originPlace.value : this.originPlace,
|
|
abundance: abundance.present ? abundance.value : this.abundance,
|
|
preservationFormat: preservationFormat.present
|
|
? preservationFormat.value
|
|
: this.preservationFormat,
|
|
priceAmount: priceAmount.present ? priceAmount.value : this.priceAmount,
|
|
priceCurrency: priceCurrency.present
|
|
? priceCurrency.value
|
|
: this.priceCurrency,
|
|
);
|
|
Lot copyWithCompanion(LotsCompanion data) {
|
|
return Lot(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
harvestYear: data.harvestYear.present
|
|
? data.harvestYear.value
|
|
: this.harvestYear,
|
|
harvestMonth: data.harvestMonth.present
|
|
? data.harvestMonth.value
|
|
: this.harvestMonth,
|
|
quantityKind: data.quantityKind.present
|
|
? data.quantityKind.value
|
|
: this.quantityKind,
|
|
quantityPrecise: data.quantityPrecise.present
|
|
? data.quantityPrecise.value
|
|
: this.quantityPrecise,
|
|
quantityLabel: data.quantityLabel.present
|
|
? data.quantityLabel.value
|
|
: this.quantityLabel,
|
|
presentation: data.presentation.present
|
|
? data.presentation.value
|
|
: this.presentation,
|
|
storageLocation: data.storageLocation.present
|
|
? data.storageLocation.value
|
|
: this.storageLocation,
|
|
offerStatus: data.offerStatus.present
|
|
? data.offerStatus.value
|
|
: this.offerStatus,
|
|
seedbankId: data.seedbankId.present
|
|
? data.seedbankId.value
|
|
: this.seedbankId,
|
|
originName: data.originName.present
|
|
? data.originName.value
|
|
: this.originName,
|
|
originPlace: data.originPlace.present
|
|
? data.originPlace.value
|
|
: this.originPlace,
|
|
abundance: data.abundance.present ? data.abundance.value : this.abundance,
|
|
preservationFormat: data.preservationFormat.present
|
|
? data.preservationFormat.value
|
|
: this.preservationFormat,
|
|
priceAmount: data.priceAmount.present
|
|
? data.priceAmount.value
|
|
: this.priceAmount,
|
|
priceCurrency: data.priceCurrency.present
|
|
? data.priceCurrency.value
|
|
: this.priceCurrency,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Lot(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('type: $type, ')
|
|
..write('harvestYear: $harvestYear, ')
|
|
..write('harvestMonth: $harvestMonth, ')
|
|
..write('quantityKind: $quantityKind, ')
|
|
..write('quantityPrecise: $quantityPrecise, ')
|
|
..write('quantityLabel: $quantityLabel, ')
|
|
..write('presentation: $presentation, ')
|
|
..write('storageLocation: $storageLocation, ')
|
|
..write('offerStatus: $offerStatus, ')
|
|
..write('seedbankId: $seedbankId, ')
|
|
..write('originName: $originName, ')
|
|
..write('originPlace: $originPlace, ')
|
|
..write('abundance: $abundance, ')
|
|
..write('preservationFormat: $preservationFormat, ')
|
|
..write('priceAmount: $priceAmount, ')
|
|
..write('priceCurrency: $priceCurrency')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
type,
|
|
harvestYear,
|
|
harvestMonth,
|
|
quantityKind,
|
|
quantityPrecise,
|
|
quantityLabel,
|
|
presentation,
|
|
storageLocation,
|
|
offerStatus,
|
|
seedbankId,
|
|
originName,
|
|
originPlace,
|
|
abundance,
|
|
preservationFormat,
|
|
priceAmount,
|
|
priceCurrency,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Lot &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.varietyId == this.varietyId &&
|
|
other.type == this.type &&
|
|
other.harvestYear == this.harvestYear &&
|
|
other.harvestMonth == this.harvestMonth &&
|
|
other.quantityKind == this.quantityKind &&
|
|
other.quantityPrecise == this.quantityPrecise &&
|
|
other.quantityLabel == this.quantityLabel &&
|
|
other.presentation == this.presentation &&
|
|
other.storageLocation == this.storageLocation &&
|
|
other.offerStatus == this.offerStatus &&
|
|
other.seedbankId == this.seedbankId &&
|
|
other.originName == this.originName &&
|
|
other.originPlace == this.originPlace &&
|
|
other.abundance == this.abundance &&
|
|
other.preservationFormat == this.preservationFormat &&
|
|
other.priceAmount == this.priceAmount &&
|
|
other.priceCurrency == this.priceCurrency);
|
|
}
|
|
|
|
class LotsCompanion extends UpdateCompanion<Lot> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> varietyId;
|
|
final Value<LotType> type;
|
|
final Value<int?> harvestYear;
|
|
final Value<int?> harvestMonth;
|
|
final Value<String?> quantityKind;
|
|
final Value<double?> quantityPrecise;
|
|
final Value<String?> quantityLabel;
|
|
final Value<Presentation?> presentation;
|
|
final Value<String?> storageLocation;
|
|
final Value<OfferStatus> offerStatus;
|
|
final Value<String?> seedbankId;
|
|
final Value<String?> originName;
|
|
final Value<String?> originPlace;
|
|
final Value<Abundance?> abundance;
|
|
final Value<PreservationFormat?> preservationFormat;
|
|
final Value<double?> priceAmount;
|
|
final Value<String?> priceCurrency;
|
|
final Value<int> rowid;
|
|
const LotsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.harvestYear = const Value.absent(),
|
|
this.harvestMonth = const Value.absent(),
|
|
this.quantityKind = const Value.absent(),
|
|
this.quantityPrecise = const Value.absent(),
|
|
this.quantityLabel = const Value.absent(),
|
|
this.presentation = const Value.absent(),
|
|
this.storageLocation = const Value.absent(),
|
|
this.offerStatus = const Value.absent(),
|
|
this.seedbankId = const Value.absent(),
|
|
this.originName = const Value.absent(),
|
|
this.originPlace = const Value.absent(),
|
|
this.abundance = const Value.absent(),
|
|
this.preservationFormat = const Value.absent(),
|
|
this.priceAmount = const Value.absent(),
|
|
this.priceCurrency = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
LotsCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String varietyId,
|
|
this.type = const Value.absent(),
|
|
this.harvestYear = const Value.absent(),
|
|
this.harvestMonth = const Value.absent(),
|
|
this.quantityKind = const Value.absent(),
|
|
this.quantityPrecise = const Value.absent(),
|
|
this.quantityLabel = const Value.absent(),
|
|
this.presentation = const Value.absent(),
|
|
this.storageLocation = const Value.absent(),
|
|
this.offerStatus = const Value.absent(),
|
|
this.seedbankId = const Value.absent(),
|
|
this.originName = const Value.absent(),
|
|
this.originPlace = const Value.absent(),
|
|
this.abundance = const Value.absent(),
|
|
this.preservationFormat = const Value.absent(),
|
|
this.priceAmount = const Value.absent(),
|
|
this.priceCurrency = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
varietyId = Value(varietyId);
|
|
static Insertable<Lot> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? varietyId,
|
|
Expression<String>? type,
|
|
Expression<int>? harvestYear,
|
|
Expression<int>? harvestMonth,
|
|
Expression<String>? quantityKind,
|
|
Expression<double>? quantityPrecise,
|
|
Expression<String>? quantityLabel,
|
|
Expression<String>? presentation,
|
|
Expression<String>? storageLocation,
|
|
Expression<String>? offerStatus,
|
|
Expression<String>? seedbankId,
|
|
Expression<String>? originName,
|
|
Expression<String>? originPlace,
|
|
Expression<String>? abundance,
|
|
Expression<String>? preservationFormat,
|
|
Expression<double>? priceAmount,
|
|
Expression<String>? priceCurrency,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (varietyId != null) 'variety_id': varietyId,
|
|
if (type != null) 'type': type,
|
|
if (harvestYear != null) 'harvest_year': harvestYear,
|
|
if (harvestMonth != null) 'harvest_month': harvestMonth,
|
|
if (quantityKind != null) 'quantity_kind': quantityKind,
|
|
if (quantityPrecise != null) 'quantity_precise': quantityPrecise,
|
|
if (quantityLabel != null) 'quantity_label': quantityLabel,
|
|
if (presentation != null) 'presentation': presentation,
|
|
if (storageLocation != null) 'storage_location': storageLocation,
|
|
if (offerStatus != null) 'offer_status': offerStatus,
|
|
if (seedbankId != null) 'seedbank_id': seedbankId,
|
|
if (originName != null) 'origin_name': originName,
|
|
if (originPlace != null) 'origin_place': originPlace,
|
|
if (abundance != null) 'abundance': abundance,
|
|
if (preservationFormat != null) 'preservation_format': preservationFormat,
|
|
if (priceAmount != null) 'price_amount': priceAmount,
|
|
if (priceCurrency != null) 'price_currency': priceCurrency,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
LotsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? varietyId,
|
|
Value<LotType>? type,
|
|
Value<int?>? harvestYear,
|
|
Value<int?>? harvestMonth,
|
|
Value<String?>? quantityKind,
|
|
Value<double?>? quantityPrecise,
|
|
Value<String?>? quantityLabel,
|
|
Value<Presentation?>? presentation,
|
|
Value<String?>? storageLocation,
|
|
Value<OfferStatus>? offerStatus,
|
|
Value<String?>? seedbankId,
|
|
Value<String?>? originName,
|
|
Value<String?>? originPlace,
|
|
Value<Abundance?>? abundance,
|
|
Value<PreservationFormat?>? preservationFormat,
|
|
Value<double?>? priceAmount,
|
|
Value<String?>? priceCurrency,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return LotsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
type: type ?? this.type,
|
|
harvestYear: harvestYear ?? this.harvestYear,
|
|
harvestMonth: harvestMonth ?? this.harvestMonth,
|
|
quantityKind: quantityKind ?? this.quantityKind,
|
|
quantityPrecise: quantityPrecise ?? this.quantityPrecise,
|
|
quantityLabel: quantityLabel ?? this.quantityLabel,
|
|
presentation: presentation ?? this.presentation,
|
|
storageLocation: storageLocation ?? this.storageLocation,
|
|
offerStatus: offerStatus ?? this.offerStatus,
|
|
seedbankId: seedbankId ?? this.seedbankId,
|
|
originName: originName ?? this.originName,
|
|
originPlace: originPlace ?? this.originPlace,
|
|
abundance: abundance ?? this.abundance,
|
|
preservationFormat: preservationFormat ?? this.preservationFormat,
|
|
priceAmount: priceAmount ?? this.priceAmount,
|
|
priceCurrency: priceCurrency ?? this.priceCurrency,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (varietyId.present) {
|
|
map['variety_id'] = Variable<String>(varietyId.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(
|
|
$LotsTable.$convertertype.toSql(type.value),
|
|
);
|
|
}
|
|
if (harvestYear.present) {
|
|
map['harvest_year'] = Variable<int>(harvestYear.value);
|
|
}
|
|
if (harvestMonth.present) {
|
|
map['harvest_month'] = Variable<int>(harvestMonth.value);
|
|
}
|
|
if (quantityKind.present) {
|
|
map['quantity_kind'] = Variable<String>(quantityKind.value);
|
|
}
|
|
if (quantityPrecise.present) {
|
|
map['quantity_precise'] = Variable<double>(quantityPrecise.value);
|
|
}
|
|
if (quantityLabel.present) {
|
|
map['quantity_label'] = Variable<String>(quantityLabel.value);
|
|
}
|
|
if (presentation.present) {
|
|
map['presentation'] = Variable<String>(
|
|
$LotsTable.$converterpresentationn.toSql(presentation.value),
|
|
);
|
|
}
|
|
if (storageLocation.present) {
|
|
map['storage_location'] = Variable<String>(storageLocation.value);
|
|
}
|
|
if (offerStatus.present) {
|
|
map['offer_status'] = Variable<String>(
|
|
$LotsTable.$converterofferStatus.toSql(offerStatus.value),
|
|
);
|
|
}
|
|
if (seedbankId.present) {
|
|
map['seedbank_id'] = Variable<String>(seedbankId.value);
|
|
}
|
|
if (originName.present) {
|
|
map['origin_name'] = Variable<String>(originName.value);
|
|
}
|
|
if (originPlace.present) {
|
|
map['origin_place'] = Variable<String>(originPlace.value);
|
|
}
|
|
if (abundance.present) {
|
|
map['abundance'] = Variable<String>(
|
|
$LotsTable.$converterabundancen.toSql(abundance.value),
|
|
);
|
|
}
|
|
if (preservationFormat.present) {
|
|
map['preservation_format'] = Variable<String>(
|
|
$LotsTable.$converterpreservationFormatn.toSql(
|
|
preservationFormat.value,
|
|
),
|
|
);
|
|
}
|
|
if (priceAmount.present) {
|
|
map['price_amount'] = Variable<double>(priceAmount.value);
|
|
}
|
|
if (priceCurrency.present) {
|
|
map['price_currency'] = Variable<String>(priceCurrency.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('LotsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('type: $type, ')
|
|
..write('harvestYear: $harvestYear, ')
|
|
..write('harvestMonth: $harvestMonth, ')
|
|
..write('quantityKind: $quantityKind, ')
|
|
..write('quantityPrecise: $quantityPrecise, ')
|
|
..write('quantityLabel: $quantityLabel, ')
|
|
..write('presentation: $presentation, ')
|
|
..write('storageLocation: $storageLocation, ')
|
|
..write('offerStatus: $offerStatus, ')
|
|
..write('seedbankId: $seedbankId, ')
|
|
..write('originName: $originName, ')
|
|
..write('originPlace: $originPlace, ')
|
|
..write('abundance: $abundance, ')
|
|
..write('preservationFormat: $preservationFormat, ')
|
|
..write('priceAmount: $priceAmount, ')
|
|
..write('priceCurrency: $priceCurrency, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $GerminationTestsTable extends GerminationTests
|
|
with TableInfo<$GerminationTestsTable, GerminationTest> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$GerminationTestsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
|
|
@override
|
|
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
|
|
'lot_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _testedOnMeta = const VerificationMeta(
|
|
'testedOn',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> testedOn = GeneratedColumn<int>(
|
|
'tested_on',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sampleSizeMeta = const VerificationMeta(
|
|
'sampleSize',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sampleSize = GeneratedColumn<int>(
|
|
'sample_size',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _germinatedCountMeta = const VerificationMeta(
|
|
'germinatedCount',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> germinatedCount = GeneratedColumn<int>(
|
|
'germinated_count',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
testedOn,
|
|
sampleSize,
|
|
germinatedCount,
|
|
notes,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'germination_tests';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<GerminationTest> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('lot_id')) {
|
|
context.handle(
|
|
_lotIdMeta,
|
|
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lotIdMeta);
|
|
}
|
|
if (data.containsKey('tested_on')) {
|
|
context.handle(
|
|
_testedOnMeta,
|
|
testedOn.isAcceptableOrUnknown(data['tested_on']!, _testedOnMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('sample_size')) {
|
|
context.handle(
|
|
_sampleSizeMeta,
|
|
sampleSize.isAcceptableOrUnknown(data['sample_size']!, _sampleSizeMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('germinated_count')) {
|
|
context.handle(
|
|
_germinatedCountMeta,
|
|
germinatedCount.isAcceptableOrUnknown(
|
|
data['germinated_count']!,
|
|
_germinatedCountMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
GerminationTest map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return GerminationTest(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
lotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}lot_id'],
|
|
)!,
|
|
testedOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}tested_on'],
|
|
),
|
|
sampleSize: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sample_size'],
|
|
),
|
|
germinatedCount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}germinated_count'],
|
|
),
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$GerminationTestsTable createAlias(String alias) {
|
|
return $GerminationTestsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class GerminationTest extends DataClass implements Insertable<GerminationTest> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String lotId;
|
|
final int? testedOn;
|
|
final int? sampleSize;
|
|
final int? germinatedCount;
|
|
final String? notes;
|
|
const GerminationTest({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.lotId,
|
|
this.testedOn,
|
|
this.sampleSize,
|
|
this.germinatedCount,
|
|
this.notes,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['lot_id'] = Variable<String>(lotId);
|
|
if (!nullToAbsent || testedOn != null) {
|
|
map['tested_on'] = Variable<int>(testedOn);
|
|
}
|
|
if (!nullToAbsent || sampleSize != null) {
|
|
map['sample_size'] = Variable<int>(sampleSize);
|
|
}
|
|
if (!nullToAbsent || germinatedCount != null) {
|
|
map['germinated_count'] = Variable<int>(germinatedCount);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
GerminationTestsCompanion toCompanion(bool nullToAbsent) {
|
|
return GerminationTestsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
lotId: Value(lotId),
|
|
testedOn: testedOn == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(testedOn),
|
|
sampleSize: sampleSize == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sampleSize),
|
|
germinatedCount: germinatedCount == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(germinatedCount),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
);
|
|
}
|
|
|
|
factory GerminationTest.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return GerminationTest(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
lotId: serializer.fromJson<String>(json['lotId']),
|
|
testedOn: serializer.fromJson<int?>(json['testedOn']),
|
|
sampleSize: serializer.fromJson<int?>(json['sampleSize']),
|
|
germinatedCount: serializer.fromJson<int?>(json['germinatedCount']),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'lotId': serializer.toJson<String>(lotId),
|
|
'testedOn': serializer.toJson<int?>(testedOn),
|
|
'sampleSize': serializer.toJson<int?>(sampleSize),
|
|
'germinatedCount': serializer.toJson<int?>(germinatedCount),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
GerminationTest copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? lotId,
|
|
Value<int?> testedOn = const Value.absent(),
|
|
Value<int?> sampleSize = const Value.absent(),
|
|
Value<int?> germinatedCount = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
}) => GerminationTest(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
testedOn: testedOn.present ? testedOn.value : this.testedOn,
|
|
sampleSize: sampleSize.present ? sampleSize.value : this.sampleSize,
|
|
germinatedCount: germinatedCount.present
|
|
? germinatedCount.value
|
|
: this.germinatedCount,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
);
|
|
GerminationTest copyWithCompanion(GerminationTestsCompanion data) {
|
|
return GerminationTest(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
lotId: data.lotId.present ? data.lotId.value : this.lotId,
|
|
testedOn: data.testedOn.present ? data.testedOn.value : this.testedOn,
|
|
sampleSize: data.sampleSize.present
|
|
? data.sampleSize.value
|
|
: this.sampleSize,
|
|
germinatedCount: data.germinatedCount.present
|
|
? data.germinatedCount.value
|
|
: this.germinatedCount,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('GerminationTest(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('testedOn: $testedOn, ')
|
|
..write('sampleSize: $sampleSize, ')
|
|
..write('germinatedCount: $germinatedCount, ')
|
|
..write('notes: $notes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
testedOn,
|
|
sampleSize,
|
|
germinatedCount,
|
|
notes,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is GerminationTest &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.lotId == this.lotId &&
|
|
other.testedOn == this.testedOn &&
|
|
other.sampleSize == this.sampleSize &&
|
|
other.germinatedCount == this.germinatedCount &&
|
|
other.notes == this.notes);
|
|
}
|
|
|
|
class GerminationTestsCompanion extends UpdateCompanion<GerminationTest> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> lotId;
|
|
final Value<int?> testedOn;
|
|
final Value<int?> sampleSize;
|
|
final Value<int?> germinatedCount;
|
|
final Value<String?> notes;
|
|
final Value<int> rowid;
|
|
const GerminationTestsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.lotId = const Value.absent(),
|
|
this.testedOn = const Value.absent(),
|
|
this.sampleSize = const Value.absent(),
|
|
this.germinatedCount = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
GerminationTestsCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
this.testedOn = const Value.absent(),
|
|
this.sampleSize = const Value.absent(),
|
|
this.germinatedCount = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
lotId = Value(lotId);
|
|
static Insertable<GerminationTest> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? lotId,
|
|
Expression<int>? testedOn,
|
|
Expression<int>? sampleSize,
|
|
Expression<int>? germinatedCount,
|
|
Expression<String>? notes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (lotId != null) 'lot_id': lotId,
|
|
if (testedOn != null) 'tested_on': testedOn,
|
|
if (sampleSize != null) 'sample_size': sampleSize,
|
|
if (germinatedCount != null) 'germinated_count': germinatedCount,
|
|
if (notes != null) 'notes': notes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
GerminationTestsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? lotId,
|
|
Value<int?>? testedOn,
|
|
Value<int?>? sampleSize,
|
|
Value<int?>? germinatedCount,
|
|
Value<String?>? notes,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return GerminationTestsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
testedOn: testedOn ?? this.testedOn,
|
|
sampleSize: sampleSize ?? this.sampleSize,
|
|
germinatedCount: germinatedCount ?? this.germinatedCount,
|
|
notes: notes ?? this.notes,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (lotId.present) {
|
|
map['lot_id'] = Variable<String>(lotId.value);
|
|
}
|
|
if (testedOn.present) {
|
|
map['tested_on'] = Variable<int>(testedOn.value);
|
|
}
|
|
if (sampleSize.present) {
|
|
map['sample_size'] = Variable<int>(sampleSize.value);
|
|
}
|
|
if (germinatedCount.present) {
|
|
map['germinated_count'] = Variable<int>(germinatedCount.value);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('GerminationTestsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('testedOn: $testedOn, ')
|
|
..write('sampleSize: $sampleSize, ')
|
|
..write('germinatedCount: $germinatedCount, ')
|
|
..write('notes: $notes, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ConditionChecksTable extends ConditionChecks
|
|
with TableInfo<$ConditionChecksTable, ConditionCheck> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ConditionChecksTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
|
|
@override
|
|
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
|
|
'lot_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _checkedOnMeta = const VerificationMeta(
|
|
'checkedOn',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> checkedOn = GeneratedColumn<int>(
|
|
'checked_on',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _containerCountMeta = const VerificationMeta(
|
|
'containerCount',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> containerCount = GeneratedColumn<int>(
|
|
'container_count',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<DesiccantState?, String>
|
|
desiccantState =
|
|
GeneratedColumn<String>(
|
|
'desiccant_state',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<DesiccantState?>(
|
|
$ConditionChecksTable.$converterdesiccantStaten,
|
|
);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
checkedOn,
|
|
containerCount,
|
|
desiccantState,
|
|
notes,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'condition_checks';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ConditionCheck> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('lot_id')) {
|
|
context.handle(
|
|
_lotIdMeta,
|
|
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lotIdMeta);
|
|
}
|
|
if (data.containsKey('checked_on')) {
|
|
context.handle(
|
|
_checkedOnMeta,
|
|
checkedOn.isAcceptableOrUnknown(data['checked_on']!, _checkedOnMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('container_count')) {
|
|
context.handle(
|
|
_containerCountMeta,
|
|
containerCount.isAcceptableOrUnknown(
|
|
data['container_count']!,
|
|
_containerCountMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ConditionCheck map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ConditionCheck(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
lotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}lot_id'],
|
|
)!,
|
|
checkedOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}checked_on'],
|
|
),
|
|
containerCount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}container_count'],
|
|
),
|
|
desiccantState: $ConditionChecksTable.$converterdesiccantStaten.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}desiccant_state'],
|
|
),
|
|
),
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ConditionChecksTable createAlias(String alias) {
|
|
return $ConditionChecksTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<DesiccantState, String, String>
|
|
$converterdesiccantState = const EnumNameConverter<DesiccantState>(
|
|
DesiccantState.values,
|
|
);
|
|
static JsonTypeConverter2<DesiccantState?, String?, String?>
|
|
$converterdesiccantStaten = JsonTypeConverter2.asNullable(
|
|
$converterdesiccantState,
|
|
);
|
|
}
|
|
|
|
class ConditionCheck extends DataClass implements Insertable<ConditionCheck> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String lotId;
|
|
final int? checkedOn;
|
|
final int? containerCount;
|
|
final DesiccantState? desiccantState;
|
|
final String? notes;
|
|
const ConditionCheck({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.lotId,
|
|
this.checkedOn,
|
|
this.containerCount,
|
|
this.desiccantState,
|
|
this.notes,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['lot_id'] = Variable<String>(lotId);
|
|
if (!nullToAbsent || checkedOn != null) {
|
|
map['checked_on'] = Variable<int>(checkedOn);
|
|
}
|
|
if (!nullToAbsent || containerCount != null) {
|
|
map['container_count'] = Variable<int>(containerCount);
|
|
}
|
|
if (!nullToAbsent || desiccantState != null) {
|
|
map['desiccant_state'] = Variable<String>(
|
|
$ConditionChecksTable.$converterdesiccantStaten.toSql(desiccantState),
|
|
);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ConditionChecksCompanion toCompanion(bool nullToAbsent) {
|
|
return ConditionChecksCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
lotId: Value(lotId),
|
|
checkedOn: checkedOn == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(checkedOn),
|
|
containerCount: containerCount == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(containerCount),
|
|
desiccantState: desiccantState == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(desiccantState),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
);
|
|
}
|
|
|
|
factory ConditionCheck.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ConditionCheck(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
lotId: serializer.fromJson<String>(json['lotId']),
|
|
checkedOn: serializer.fromJson<int?>(json['checkedOn']),
|
|
containerCount: serializer.fromJson<int?>(json['containerCount']),
|
|
desiccantState: $ConditionChecksTable.$converterdesiccantStaten.fromJson(
|
|
serializer.fromJson<String?>(json['desiccantState']),
|
|
),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'lotId': serializer.toJson<String>(lotId),
|
|
'checkedOn': serializer.toJson<int?>(checkedOn),
|
|
'containerCount': serializer.toJson<int?>(containerCount),
|
|
'desiccantState': serializer.toJson<String?>(
|
|
$ConditionChecksTable.$converterdesiccantStaten.toJson(desiccantState),
|
|
),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
ConditionCheck copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? lotId,
|
|
Value<int?> checkedOn = const Value.absent(),
|
|
Value<int?> containerCount = const Value.absent(),
|
|
Value<DesiccantState?> desiccantState = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
}) => ConditionCheck(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
checkedOn: checkedOn.present ? checkedOn.value : this.checkedOn,
|
|
containerCount: containerCount.present
|
|
? containerCount.value
|
|
: this.containerCount,
|
|
desiccantState: desiccantState.present
|
|
? desiccantState.value
|
|
: this.desiccantState,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
);
|
|
ConditionCheck copyWithCompanion(ConditionChecksCompanion data) {
|
|
return ConditionCheck(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
lotId: data.lotId.present ? data.lotId.value : this.lotId,
|
|
checkedOn: data.checkedOn.present ? data.checkedOn.value : this.checkedOn,
|
|
containerCount: data.containerCount.present
|
|
? data.containerCount.value
|
|
: this.containerCount,
|
|
desiccantState: data.desiccantState.present
|
|
? data.desiccantState.value
|
|
: this.desiccantState,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ConditionCheck(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('checkedOn: $checkedOn, ')
|
|
..write('containerCount: $containerCount, ')
|
|
..write('desiccantState: $desiccantState, ')
|
|
..write('notes: $notes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
checkedOn,
|
|
containerCount,
|
|
desiccantState,
|
|
notes,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ConditionCheck &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.lotId == this.lotId &&
|
|
other.checkedOn == this.checkedOn &&
|
|
other.containerCount == this.containerCount &&
|
|
other.desiccantState == this.desiccantState &&
|
|
other.notes == this.notes);
|
|
}
|
|
|
|
class ConditionChecksCompanion extends UpdateCompanion<ConditionCheck> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> lotId;
|
|
final Value<int?> checkedOn;
|
|
final Value<int?> containerCount;
|
|
final Value<DesiccantState?> desiccantState;
|
|
final Value<String?> notes;
|
|
final Value<int> rowid;
|
|
const ConditionChecksCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.lotId = const Value.absent(),
|
|
this.checkedOn = const Value.absent(),
|
|
this.containerCount = const Value.absent(),
|
|
this.desiccantState = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ConditionChecksCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
this.checkedOn = const Value.absent(),
|
|
this.containerCount = const Value.absent(),
|
|
this.desiccantState = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
lotId = Value(lotId);
|
|
static Insertable<ConditionCheck> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? lotId,
|
|
Expression<int>? checkedOn,
|
|
Expression<int>? containerCount,
|
|
Expression<String>? desiccantState,
|
|
Expression<String>? notes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (lotId != null) 'lot_id': lotId,
|
|
if (checkedOn != null) 'checked_on': checkedOn,
|
|
if (containerCount != null) 'container_count': containerCount,
|
|
if (desiccantState != null) 'desiccant_state': desiccantState,
|
|
if (notes != null) 'notes': notes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ConditionChecksCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? lotId,
|
|
Value<int?>? checkedOn,
|
|
Value<int?>? containerCount,
|
|
Value<DesiccantState?>? desiccantState,
|
|
Value<String?>? notes,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ConditionChecksCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
checkedOn: checkedOn ?? this.checkedOn,
|
|
containerCount: containerCount ?? this.containerCount,
|
|
desiccantState: desiccantState ?? this.desiccantState,
|
|
notes: notes ?? this.notes,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (lotId.present) {
|
|
map['lot_id'] = Variable<String>(lotId.value);
|
|
}
|
|
if (checkedOn.present) {
|
|
map['checked_on'] = Variable<int>(checkedOn.value);
|
|
}
|
|
if (containerCount.present) {
|
|
map['container_count'] = Variable<int>(containerCount.value);
|
|
}
|
|
if (desiccantState.present) {
|
|
map['desiccant_state'] = Variable<String>(
|
|
$ConditionChecksTable.$converterdesiccantStaten.toSql(
|
|
desiccantState.value,
|
|
),
|
|
);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ConditionChecksCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('checkedOn: $checkedOn, ')
|
|
..write('containerCount: $containerCount, ')
|
|
..write('desiccantState: $desiccantState, ')
|
|
..write('notes: $notes, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $GardenOutcomesTable extends GardenOutcomes
|
|
with TableInfo<$GardenOutcomesTable, GardenOutcome> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$GardenOutcomesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
|
|
@override
|
|
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
|
|
'lot_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _yearMeta = const VerificationMeta('year');
|
|
@override
|
|
late final GeneratedColumn<int> year = GeneratedColumn<int>(
|
|
'year',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<GardenOutcomeRating?, String>
|
|
rating = GeneratedColumn<String>(
|
|
'rating',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<GardenOutcomeRating?>($GardenOutcomesTable.$converterratingn);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
year,
|
|
rating,
|
|
notes,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'garden_outcomes';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<GardenOutcome> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('lot_id')) {
|
|
context.handle(
|
|
_lotIdMeta,
|
|
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lotIdMeta);
|
|
}
|
|
if (data.containsKey('year')) {
|
|
context.handle(
|
|
_yearMeta,
|
|
year.isAcceptableOrUnknown(data['year']!, _yearMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
GardenOutcome map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return GardenOutcome(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
lotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}lot_id'],
|
|
)!,
|
|
year: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}year'],
|
|
),
|
|
rating: $GardenOutcomesTable.$converterratingn.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}rating'],
|
|
),
|
|
),
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$GardenOutcomesTable createAlias(String alias) {
|
|
return $GardenOutcomesTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<GardenOutcomeRating, String, String>
|
|
$converterrating = const EnumNameConverter<GardenOutcomeRating>(
|
|
GardenOutcomeRating.values,
|
|
);
|
|
static JsonTypeConverter2<GardenOutcomeRating?, String?, String?>
|
|
$converterratingn = JsonTypeConverter2.asNullable($converterrating);
|
|
}
|
|
|
|
class GardenOutcome extends DataClass implements Insertable<GardenOutcome> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String lotId;
|
|
final int? year;
|
|
final GardenOutcomeRating? rating;
|
|
final String? notes;
|
|
const GardenOutcome({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.lotId,
|
|
this.year,
|
|
this.rating,
|
|
this.notes,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['lot_id'] = Variable<String>(lotId);
|
|
if (!nullToAbsent || year != null) {
|
|
map['year'] = Variable<int>(year);
|
|
}
|
|
if (!nullToAbsent || rating != null) {
|
|
map['rating'] = Variable<String>(
|
|
$GardenOutcomesTable.$converterratingn.toSql(rating),
|
|
);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
GardenOutcomesCompanion toCompanion(bool nullToAbsent) {
|
|
return GardenOutcomesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
lotId: Value(lotId),
|
|
year: year == null && nullToAbsent ? const Value.absent() : Value(year),
|
|
rating: rating == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(rating),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
);
|
|
}
|
|
|
|
factory GardenOutcome.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return GardenOutcome(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
lotId: serializer.fromJson<String>(json['lotId']),
|
|
year: serializer.fromJson<int?>(json['year']),
|
|
rating: $GardenOutcomesTable.$converterratingn.fromJson(
|
|
serializer.fromJson<String?>(json['rating']),
|
|
),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'lotId': serializer.toJson<String>(lotId),
|
|
'year': serializer.toJson<int?>(year),
|
|
'rating': serializer.toJson<String?>(
|
|
$GardenOutcomesTable.$converterratingn.toJson(rating),
|
|
),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
GardenOutcome copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? lotId,
|
|
Value<int?> year = const Value.absent(),
|
|
Value<GardenOutcomeRating?> rating = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
}) => GardenOutcome(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
year: year.present ? year.value : this.year,
|
|
rating: rating.present ? rating.value : this.rating,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
);
|
|
GardenOutcome copyWithCompanion(GardenOutcomesCompanion data) {
|
|
return GardenOutcome(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
lotId: data.lotId.present ? data.lotId.value : this.lotId,
|
|
year: data.year.present ? data.year.value : this.year,
|
|
rating: data.rating.present ? data.rating.value : this.rating,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('GardenOutcome(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('year: $year, ')
|
|
..write('rating: $rating, ')
|
|
..write('notes: $notes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
lotId,
|
|
year,
|
|
rating,
|
|
notes,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is GardenOutcome &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.lotId == this.lotId &&
|
|
other.year == this.year &&
|
|
other.rating == this.rating &&
|
|
other.notes == this.notes);
|
|
}
|
|
|
|
class GardenOutcomesCompanion extends UpdateCompanion<GardenOutcome> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> lotId;
|
|
final Value<int?> year;
|
|
final Value<GardenOutcomeRating?> rating;
|
|
final Value<String?> notes;
|
|
final Value<int> rowid;
|
|
const GardenOutcomesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.lotId = const Value.absent(),
|
|
this.year = const Value.absent(),
|
|
this.rating = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
GardenOutcomesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
this.year = const Value.absent(),
|
|
this.rating = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
lotId = Value(lotId);
|
|
static Insertable<GardenOutcome> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? lotId,
|
|
Expression<int>? year,
|
|
Expression<String>? rating,
|
|
Expression<String>? notes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (lotId != null) 'lot_id': lotId,
|
|
if (year != null) 'year': year,
|
|
if (rating != null) 'rating': rating,
|
|
if (notes != null) 'notes': notes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
GardenOutcomesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? lotId,
|
|
Value<int?>? year,
|
|
Value<GardenOutcomeRating?>? rating,
|
|
Value<String?>? notes,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return GardenOutcomesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
year: year ?? this.year,
|
|
rating: rating ?? this.rating,
|
|
notes: notes ?? this.notes,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (lotId.present) {
|
|
map['lot_id'] = Variable<String>(lotId.value);
|
|
}
|
|
if (year.present) {
|
|
map['year'] = Variable<int>(year.value);
|
|
}
|
|
if (rating.present) {
|
|
map['rating'] = Variable<String>(
|
|
$GardenOutcomesTable.$converterratingn.toSql(rating.value),
|
|
);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('GardenOutcomesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('year: $year, ')
|
|
..write('rating: $rating, ')
|
|
..write('notes: $notes, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $MovementsTable extends Movements
|
|
with TableInfo<$MovementsTable, Movement> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MovementsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
|
|
@override
|
|
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
|
|
'lot_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<MovementType, String> type =
|
|
GeneratedColumn<String>(
|
|
'type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<MovementType>($MovementsTable.$convertertype);
|
|
static const VerificationMeta _occurredOnMeta = const VerificationMeta(
|
|
'occurredOn',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> occurredOn = GeneratedColumn<int>(
|
|
'occurred_on',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _counterpartyIdMeta = const VerificationMeta(
|
|
'counterpartyId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> counterpartyId = GeneratedColumn<String>(
|
|
'counterparty_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityKindMeta = const VerificationMeta(
|
|
'quantityKind',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
|
|
'quantity_kind',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityPreciseMeta = const VerificationMeta(
|
|
'quantityPrecise',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
|
|
'quantity_precise',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _quantityLabelMeta = const VerificationMeta(
|
|
'quantityLabel',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
|
|
'quantity_label',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _parentMovementIdMeta = const VerificationMeta(
|
|
'parentMovementId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> parentMovementId = GeneratedColumn<String>(
|
|
'parent_movement_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _plantareIdMeta = const VerificationMeta(
|
|
'plantareId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> plantareId = GeneratedColumn<String>(
|
|
'plantare_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
lastAuthor,
|
|
schemaRowVersion,
|
|
lotId,
|
|
type,
|
|
occurredOn,
|
|
counterpartyId,
|
|
quantityKind,
|
|
quantityPrecise,
|
|
quantityLabel,
|
|
parentMovementId,
|
|
plantareId,
|
|
notes,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'movements';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Movement> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('lot_id')) {
|
|
context.handle(
|
|
_lotIdMeta,
|
|
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lotIdMeta);
|
|
}
|
|
if (data.containsKey('occurred_on')) {
|
|
context.handle(
|
|
_occurredOnMeta,
|
|
occurredOn.isAcceptableOrUnknown(data['occurred_on']!, _occurredOnMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('counterparty_id')) {
|
|
context.handle(
|
|
_counterpartyIdMeta,
|
|
counterpartyId.isAcceptableOrUnknown(
|
|
data['counterparty_id']!,
|
|
_counterpartyIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_kind')) {
|
|
context.handle(
|
|
_quantityKindMeta,
|
|
quantityKind.isAcceptableOrUnknown(
|
|
data['quantity_kind']!,
|
|
_quantityKindMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_precise')) {
|
|
context.handle(
|
|
_quantityPreciseMeta,
|
|
quantityPrecise.isAcceptableOrUnknown(
|
|
data['quantity_precise']!,
|
|
_quantityPreciseMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('quantity_label')) {
|
|
context.handle(
|
|
_quantityLabelMeta,
|
|
quantityLabel.isAcceptableOrUnknown(
|
|
data['quantity_label']!,
|
|
_quantityLabelMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('parent_movement_id')) {
|
|
context.handle(
|
|
_parentMovementIdMeta,
|
|
parentMovementId.isAcceptableOrUnknown(
|
|
data['parent_movement_id']!,
|
|
_parentMovementIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('plantare_id')) {
|
|
context.handle(
|
|
_plantareIdMeta,
|
|
plantareId.isAcceptableOrUnknown(data['plantare_id']!, _plantareIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Movement map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Movement(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
lotId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}lot_id'],
|
|
)!,
|
|
type: $MovementsTable.$convertertype.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}type'],
|
|
)!,
|
|
),
|
|
occurredOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}occurred_on'],
|
|
),
|
|
counterpartyId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}counterparty_id'],
|
|
),
|
|
quantityKind: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}quantity_kind'],
|
|
),
|
|
quantityPrecise: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}quantity_precise'],
|
|
),
|
|
quantityLabel: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}quantity_label'],
|
|
),
|
|
parentMovementId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}parent_movement_id'],
|
|
),
|
|
plantareId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}plantare_id'],
|
|
),
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MovementsTable createAlias(String alias) {
|
|
return $MovementsTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<MovementType, String, String> $convertertype =
|
|
const EnumNameConverter<MovementType>(MovementType.values);
|
|
}
|
|
|
|
class Movement extends DataClass implements Insertable<Movement> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String lastAuthor;
|
|
final int schemaRowVersion;
|
|
final String lotId;
|
|
final MovementType type;
|
|
final int? occurredOn;
|
|
final String? counterpartyId;
|
|
final String? quantityKind;
|
|
final double? quantityPrecise;
|
|
final String? quantityLabel;
|
|
final String? parentMovementId;
|
|
final String? plantareId;
|
|
final String? notes;
|
|
const Movement({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.lastAuthor,
|
|
required this.schemaRowVersion,
|
|
required this.lotId,
|
|
required this.type,
|
|
this.occurredOn,
|
|
this.counterpartyId,
|
|
this.quantityKind,
|
|
this.quantityPrecise,
|
|
this.quantityLabel,
|
|
this.parentMovementId,
|
|
this.plantareId,
|
|
this.notes,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['lot_id'] = Variable<String>(lotId);
|
|
{
|
|
map['type'] = Variable<String>(
|
|
$MovementsTable.$convertertype.toSql(type),
|
|
);
|
|
}
|
|
if (!nullToAbsent || occurredOn != null) {
|
|
map['occurred_on'] = Variable<int>(occurredOn);
|
|
}
|
|
if (!nullToAbsent || counterpartyId != null) {
|
|
map['counterparty_id'] = Variable<String>(counterpartyId);
|
|
}
|
|
if (!nullToAbsent || quantityKind != null) {
|
|
map['quantity_kind'] = Variable<String>(quantityKind);
|
|
}
|
|
if (!nullToAbsent || quantityPrecise != null) {
|
|
map['quantity_precise'] = Variable<double>(quantityPrecise);
|
|
}
|
|
if (!nullToAbsent || quantityLabel != null) {
|
|
map['quantity_label'] = Variable<String>(quantityLabel);
|
|
}
|
|
if (!nullToAbsent || parentMovementId != null) {
|
|
map['parent_movement_id'] = Variable<String>(parentMovementId);
|
|
}
|
|
if (!nullToAbsent || plantareId != null) {
|
|
map['plantare_id'] = Variable<String>(plantareId);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
MovementsCompanion toCompanion(bool nullToAbsent) {
|
|
return MovementsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
lotId: Value(lotId),
|
|
type: Value(type),
|
|
occurredOn: occurredOn == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(occurredOn),
|
|
counterpartyId: counterpartyId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(counterpartyId),
|
|
quantityKind: quantityKind == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityKind),
|
|
quantityPrecise: quantityPrecise == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityPrecise),
|
|
quantityLabel: quantityLabel == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(quantityLabel),
|
|
parentMovementId: parentMovementId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(parentMovementId),
|
|
plantareId: plantareId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(plantareId),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
);
|
|
}
|
|
|
|
factory Movement.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Movement(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
lotId: serializer.fromJson<String>(json['lotId']),
|
|
type: $MovementsTable.$convertertype.fromJson(
|
|
serializer.fromJson<String>(json['type']),
|
|
),
|
|
occurredOn: serializer.fromJson<int?>(json['occurredOn']),
|
|
counterpartyId: serializer.fromJson<String?>(json['counterpartyId']),
|
|
quantityKind: serializer.fromJson<String?>(json['quantityKind']),
|
|
quantityPrecise: serializer.fromJson<double?>(json['quantityPrecise']),
|
|
quantityLabel: serializer.fromJson<String?>(json['quantityLabel']),
|
|
parentMovementId: serializer.fromJson<String?>(json['parentMovementId']),
|
|
plantareId: serializer.fromJson<String?>(json['plantareId']),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'lotId': serializer.toJson<String>(lotId),
|
|
'type': serializer.toJson<String>(
|
|
$MovementsTable.$convertertype.toJson(type),
|
|
),
|
|
'occurredOn': serializer.toJson<int?>(occurredOn),
|
|
'counterpartyId': serializer.toJson<String?>(counterpartyId),
|
|
'quantityKind': serializer.toJson<String?>(quantityKind),
|
|
'quantityPrecise': serializer.toJson<double?>(quantityPrecise),
|
|
'quantityLabel': serializer.toJson<String?>(quantityLabel),
|
|
'parentMovementId': serializer.toJson<String?>(parentMovementId),
|
|
'plantareId': serializer.toJson<String?>(plantareId),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
Movement copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? lastAuthor,
|
|
int? schemaRowVersion,
|
|
String? lotId,
|
|
MovementType? type,
|
|
Value<int?> occurredOn = const Value.absent(),
|
|
Value<String?> counterpartyId = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<String?> parentMovementId = const Value.absent(),
|
|
Value<String?> plantareId = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
}) => Movement(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
type: type ?? this.type,
|
|
occurredOn: occurredOn.present ? occurredOn.value : this.occurredOn,
|
|
counterpartyId: counterpartyId.present
|
|
? counterpartyId.value
|
|
: this.counterpartyId,
|
|
quantityKind: quantityKind.present ? quantityKind.value : this.quantityKind,
|
|
quantityPrecise: quantityPrecise.present
|
|
? quantityPrecise.value
|
|
: this.quantityPrecise,
|
|
quantityLabel: quantityLabel.present
|
|
? quantityLabel.value
|
|
: this.quantityLabel,
|
|
parentMovementId: parentMovementId.present
|
|
? parentMovementId.value
|
|
: this.parentMovementId,
|
|
plantareId: plantareId.present ? plantareId.value : this.plantareId,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
);
|
|
Movement copyWithCompanion(MovementsCompanion data) {
|
|
return Movement(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
lotId: data.lotId.present ? data.lotId.value : this.lotId,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
occurredOn: data.occurredOn.present
|
|
? data.occurredOn.value
|
|
: this.occurredOn,
|
|
counterpartyId: data.counterpartyId.present
|
|
? data.counterpartyId.value
|
|
: this.counterpartyId,
|
|
quantityKind: data.quantityKind.present
|
|
? data.quantityKind.value
|
|
: this.quantityKind,
|
|
quantityPrecise: data.quantityPrecise.present
|
|
? data.quantityPrecise.value
|
|
: this.quantityPrecise,
|
|
quantityLabel: data.quantityLabel.present
|
|
? data.quantityLabel.value
|
|
: this.quantityLabel,
|
|
parentMovementId: data.parentMovementId.present
|
|
? data.parentMovementId.value
|
|
: this.parentMovementId,
|
|
plantareId: data.plantareId.present
|
|
? data.plantareId.value
|
|
: this.plantareId,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Movement(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('type: $type, ')
|
|
..write('occurredOn: $occurredOn, ')
|
|
..write('counterpartyId: $counterpartyId, ')
|
|
..write('quantityKind: $quantityKind, ')
|
|
..write('quantityPrecise: $quantityPrecise, ')
|
|
..write('quantityLabel: $quantityLabel, ')
|
|
..write('parentMovementId: $parentMovementId, ')
|
|
..write('plantareId: $plantareId, ')
|
|
..write('notes: $notes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
lastAuthor,
|
|
schemaRowVersion,
|
|
lotId,
|
|
type,
|
|
occurredOn,
|
|
counterpartyId,
|
|
quantityKind,
|
|
quantityPrecise,
|
|
quantityLabel,
|
|
parentMovementId,
|
|
plantareId,
|
|
notes,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Movement &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.lotId == this.lotId &&
|
|
other.type == this.type &&
|
|
other.occurredOn == this.occurredOn &&
|
|
other.counterpartyId == this.counterpartyId &&
|
|
other.quantityKind == this.quantityKind &&
|
|
other.quantityPrecise == this.quantityPrecise &&
|
|
other.quantityLabel == this.quantityLabel &&
|
|
other.parentMovementId == this.parentMovementId &&
|
|
other.plantareId == this.plantareId &&
|
|
other.notes == this.notes);
|
|
}
|
|
|
|
class MovementsCompanion extends UpdateCompanion<Movement> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> lotId;
|
|
final Value<MovementType> type;
|
|
final Value<int?> occurredOn;
|
|
final Value<String?> counterpartyId;
|
|
final Value<String?> quantityKind;
|
|
final Value<double?> quantityPrecise;
|
|
final Value<String?> quantityLabel;
|
|
final Value<String?> parentMovementId;
|
|
final Value<String?> plantareId;
|
|
final Value<String?> notes;
|
|
final Value<int> rowid;
|
|
const MovementsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.lotId = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.occurredOn = const Value.absent(),
|
|
this.counterpartyId = const Value.absent(),
|
|
this.quantityKind = const Value.absent(),
|
|
this.quantityPrecise = const Value.absent(),
|
|
this.quantityLabel = const Value.absent(),
|
|
this.parentMovementId = const Value.absent(),
|
|
this.plantareId = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
MovementsCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String lastAuthor,
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
required MovementType type,
|
|
this.occurredOn = const Value.absent(),
|
|
this.counterpartyId = const Value.absent(),
|
|
this.quantityKind = const Value.absent(),
|
|
this.quantityPrecise = const Value.absent(),
|
|
this.quantityLabel = const Value.absent(),
|
|
this.parentMovementId = const Value.absent(),
|
|
this.plantareId = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
lotId = Value(lotId),
|
|
type = Value(type);
|
|
static Insertable<Movement> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? lotId,
|
|
Expression<String>? type,
|
|
Expression<int>? occurredOn,
|
|
Expression<String>? counterpartyId,
|
|
Expression<String>? quantityKind,
|
|
Expression<double>? quantityPrecise,
|
|
Expression<String>? quantityLabel,
|
|
Expression<String>? parentMovementId,
|
|
Expression<String>? plantareId,
|
|
Expression<String>? notes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (lotId != null) 'lot_id': lotId,
|
|
if (type != null) 'type': type,
|
|
if (occurredOn != null) 'occurred_on': occurredOn,
|
|
if (counterpartyId != null) 'counterparty_id': counterpartyId,
|
|
if (quantityKind != null) 'quantity_kind': quantityKind,
|
|
if (quantityPrecise != null) 'quantity_precise': quantityPrecise,
|
|
if (quantityLabel != null) 'quantity_label': quantityLabel,
|
|
if (parentMovementId != null) 'parent_movement_id': parentMovementId,
|
|
if (plantareId != null) 'plantare_id': plantareId,
|
|
if (notes != null) 'notes': notes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
MovementsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? lastAuthor,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? lotId,
|
|
Value<MovementType>? type,
|
|
Value<int?>? occurredOn,
|
|
Value<String?>? counterpartyId,
|
|
Value<String?>? quantityKind,
|
|
Value<double?>? quantityPrecise,
|
|
Value<String?>? quantityLabel,
|
|
Value<String?>? parentMovementId,
|
|
Value<String?>? plantareId,
|
|
Value<String?>? notes,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return MovementsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
lotId: lotId ?? this.lotId,
|
|
type: type ?? this.type,
|
|
occurredOn: occurredOn ?? this.occurredOn,
|
|
counterpartyId: counterpartyId ?? this.counterpartyId,
|
|
quantityKind: quantityKind ?? this.quantityKind,
|
|
quantityPrecise: quantityPrecise ?? this.quantityPrecise,
|
|
quantityLabel: quantityLabel ?? this.quantityLabel,
|
|
parentMovementId: parentMovementId ?? this.parentMovementId,
|
|
plantareId: plantareId ?? this.plantareId,
|
|
notes: notes ?? this.notes,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (lotId.present) {
|
|
map['lot_id'] = Variable<String>(lotId.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(
|
|
$MovementsTable.$convertertype.toSql(type.value),
|
|
);
|
|
}
|
|
if (occurredOn.present) {
|
|
map['occurred_on'] = Variable<int>(occurredOn.value);
|
|
}
|
|
if (counterpartyId.present) {
|
|
map['counterparty_id'] = Variable<String>(counterpartyId.value);
|
|
}
|
|
if (quantityKind.present) {
|
|
map['quantity_kind'] = Variable<String>(quantityKind.value);
|
|
}
|
|
if (quantityPrecise.present) {
|
|
map['quantity_precise'] = Variable<double>(quantityPrecise.value);
|
|
}
|
|
if (quantityLabel.present) {
|
|
map['quantity_label'] = Variable<String>(quantityLabel.value);
|
|
}
|
|
if (parentMovementId.present) {
|
|
map['parent_movement_id'] = Variable<String>(parentMovementId.value);
|
|
}
|
|
if (plantareId.present) {
|
|
map['plantare_id'] = Variable<String>(plantareId.value);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MovementsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('lotId: $lotId, ')
|
|
..write('type: $type, ')
|
|
..write('occurredOn: $occurredOn, ')
|
|
..write('counterpartyId: $counterpartyId, ')
|
|
..write('quantityKind: $quantityKind, ')
|
|
..write('quantityPrecise: $quantityPrecise, ')
|
|
..write('quantityLabel: $quantityLabel, ')
|
|
..write('parentMovementId: $parentMovementId, ')
|
|
..write('plantareId: $plantareId, ')
|
|
..write('notes: $notes, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PartiesTable extends Parties with TableInfo<$PartiesTable, Party> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PartiesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _displayNameMeta = const VerificationMeta(
|
|
'displayName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> displayName = GeneratedColumn<String>(
|
|
'display_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _publicKeyMeta = const VerificationMeta(
|
|
'publicKey',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> publicKey = GeneratedColumn<String>(
|
|
'public_key',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PartyKind, String> kind =
|
|
GeneratedColumn<String>(
|
|
'kind',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('person'),
|
|
).withConverter<PartyKind>($PartiesTable.$converterkind);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
displayName,
|
|
publicKey,
|
|
kind,
|
|
note,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'parties';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Party> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('display_name')) {
|
|
context.handle(
|
|
_displayNameMeta,
|
|
displayName.isAcceptableOrUnknown(
|
|
data['display_name']!,
|
|
_displayNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_displayNameMeta);
|
|
}
|
|
if (data.containsKey('public_key')) {
|
|
context.handle(
|
|
_publicKeyMeta,
|
|
publicKey.isAcceptableOrUnknown(data['public_key']!, _publicKeyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Party map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Party(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
displayName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}display_name'],
|
|
)!,
|
|
publicKey: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}public_key'],
|
|
),
|
|
kind: $PartiesTable.$converterkind.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kind'],
|
|
)!,
|
|
),
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PartiesTable createAlias(String alias) {
|
|
return $PartiesTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<PartyKind, String, String> $converterkind =
|
|
const EnumNameConverter<PartyKind>(PartyKind.values);
|
|
}
|
|
|
|
class Party extends DataClass implements Insertable<Party> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final String displayName;
|
|
final String? publicKey;
|
|
final PartyKind kind;
|
|
final String? note;
|
|
const Party({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.displayName,
|
|
this.publicKey,
|
|
required this.kind,
|
|
this.note,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
map['display_name'] = Variable<String>(displayName);
|
|
if (!nullToAbsent || publicKey != null) {
|
|
map['public_key'] = Variable<String>(publicKey);
|
|
}
|
|
{
|
|
map['kind'] = Variable<String>($PartiesTable.$converterkind.toSql(kind));
|
|
}
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
PartiesCompanion toCompanion(bool nullToAbsent) {
|
|
return PartiesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
displayName: Value(displayName),
|
|
publicKey: publicKey == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(publicKey),
|
|
kind: Value(kind),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
);
|
|
}
|
|
|
|
factory Party.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Party(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
displayName: serializer.fromJson<String>(json['displayName']),
|
|
publicKey: serializer.fromJson<String?>(json['publicKey']),
|
|
kind: $PartiesTable.$converterkind.fromJson(
|
|
serializer.fromJson<String>(json['kind']),
|
|
),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'displayName': serializer.toJson<String>(displayName),
|
|
'publicKey': serializer.toJson<String?>(publicKey),
|
|
'kind': serializer.toJson<String>(
|
|
$PartiesTable.$converterkind.toJson(kind),
|
|
),
|
|
'note': serializer.toJson<String?>(note),
|
|
};
|
|
}
|
|
|
|
Party copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
String? displayName,
|
|
Value<String?> publicKey = const Value.absent(),
|
|
PartyKind? kind,
|
|
Value<String?> note = const Value.absent(),
|
|
}) => Party(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
displayName: displayName ?? this.displayName,
|
|
publicKey: publicKey.present ? publicKey.value : this.publicKey,
|
|
kind: kind ?? this.kind,
|
|
note: note.present ? note.value : this.note,
|
|
);
|
|
Party copyWithCompanion(PartiesCompanion data) {
|
|
return Party(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
displayName: data.displayName.present
|
|
? data.displayName.value
|
|
: this.displayName,
|
|
publicKey: data.publicKey.present ? data.publicKey.value : this.publicKey,
|
|
kind: data.kind.present ? data.kind.value : this.kind,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Party(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('displayName: $displayName, ')
|
|
..write('publicKey: $publicKey, ')
|
|
..write('kind: $kind, ')
|
|
..write('note: $note')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
displayName,
|
|
publicKey,
|
|
kind,
|
|
note,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Party &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.displayName == this.displayName &&
|
|
other.publicKey == this.publicKey &&
|
|
other.kind == this.kind &&
|
|
other.note == this.note);
|
|
}
|
|
|
|
class PartiesCompanion extends UpdateCompanion<Party> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String> displayName;
|
|
final Value<String?> publicKey;
|
|
final Value<PartyKind> kind;
|
|
final Value<String?> note;
|
|
final Value<int> rowid;
|
|
const PartiesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.displayName = const Value.absent(),
|
|
this.publicKey = const Value.absent(),
|
|
this.kind = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PartiesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required String displayName,
|
|
this.publicKey = const Value.absent(),
|
|
this.kind = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
displayName = Value(displayName);
|
|
static Insertable<Party> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? displayName,
|
|
Expression<String>? publicKey,
|
|
Expression<String>? kind,
|
|
Expression<String>? note,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (displayName != null) 'display_name': displayName,
|
|
if (publicKey != null) 'public_key': publicKey,
|
|
if (kind != null) 'kind': kind,
|
|
if (note != null) 'note': note,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PartiesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String>? displayName,
|
|
Value<String?>? publicKey,
|
|
Value<PartyKind>? kind,
|
|
Value<String?>? note,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PartiesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
displayName: displayName ?? this.displayName,
|
|
publicKey: publicKey ?? this.publicKey,
|
|
kind: kind ?? this.kind,
|
|
note: note ?? this.note,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (displayName.present) {
|
|
map['display_name'] = Variable<String>(displayName.value);
|
|
}
|
|
if (publicKey.present) {
|
|
map['public_key'] = Variable<String>(publicKey.value);
|
|
}
|
|
if (kind.present) {
|
|
map['kind'] = Variable<String>(
|
|
$PartiesTable.$converterkind.toSql(kind.value),
|
|
);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PartiesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('displayName: $displayName, ')
|
|
..write('publicKey: $publicKey, ')
|
|
..write('kind: $kind, ')
|
|
..write('note: $note, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $AttachmentsTable extends Attachments
|
|
with TableInfo<$AttachmentsTable, Attachment> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$AttachmentsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<ParentType, String> parentType =
|
|
GeneratedColumn<String>(
|
|
'parent_type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<ParentType>($AttachmentsTable.$converterparentType);
|
|
static const VerificationMeta _parentIdMeta = const VerificationMeta(
|
|
'parentId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
|
|
'parent_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<AttachmentKind, String> kind =
|
|
GeneratedColumn<String>(
|
|
'kind',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<AttachmentKind>($AttachmentsTable.$converterkind);
|
|
static const VerificationMeta _uriMeta = const VerificationMeta('uri');
|
|
@override
|
|
late final GeneratedColumn<String> uri = GeneratedColumn<String>(
|
|
'uri',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _bytesMeta = const VerificationMeta('bytes');
|
|
@override
|
|
late final GeneratedColumn<Uint8List> bytes = GeneratedColumn<Uint8List>(
|
|
'bytes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.blob,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _thumbnailMeta = const VerificationMeta(
|
|
'thumbnail',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<Uint8List> thumbnail = GeneratedColumn<Uint8List>(
|
|
'thumbnail',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.blob,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _mimeTypeMeta = const VerificationMeta(
|
|
'mimeType',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> mimeType = GeneratedColumn<String>(
|
|
'mime_type',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sortOrderMeta = const VerificationMeta(
|
|
'sortOrder',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sortOrder = GeneratedColumn<int>(
|
|
'sort_order',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
parentType,
|
|
parentId,
|
|
kind,
|
|
uri,
|
|
bytes,
|
|
thumbnail,
|
|
mimeType,
|
|
sortOrder,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'attachments';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Attachment> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('parent_id')) {
|
|
context.handle(
|
|
_parentIdMeta,
|
|
parentId.isAcceptableOrUnknown(data['parent_id']!, _parentIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_parentIdMeta);
|
|
}
|
|
if (data.containsKey('uri')) {
|
|
context.handle(
|
|
_uriMeta,
|
|
uri.isAcceptableOrUnknown(data['uri']!, _uriMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('bytes')) {
|
|
context.handle(
|
|
_bytesMeta,
|
|
bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('thumbnail')) {
|
|
context.handle(
|
|
_thumbnailMeta,
|
|
thumbnail.isAcceptableOrUnknown(data['thumbnail']!, _thumbnailMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('mime_type')) {
|
|
context.handle(
|
|
_mimeTypeMeta,
|
|
mimeType.isAcceptableOrUnknown(data['mime_type']!, _mimeTypeMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('sort_order')) {
|
|
context.handle(
|
|
_sortOrderMeta,
|
|
sortOrder.isAcceptableOrUnknown(data['sort_order']!, _sortOrderMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Attachment map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Attachment(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
parentType: $AttachmentsTable.$converterparentType.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}parent_type'],
|
|
)!,
|
|
),
|
|
parentId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}parent_id'],
|
|
)!,
|
|
kind: $AttachmentsTable.$converterkind.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kind'],
|
|
)!,
|
|
),
|
|
uri: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}uri'],
|
|
),
|
|
bytes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.blob,
|
|
data['${effectivePrefix}bytes'],
|
|
),
|
|
thumbnail: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.blob,
|
|
data['${effectivePrefix}thumbnail'],
|
|
),
|
|
mimeType: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}mime_type'],
|
|
),
|
|
sortOrder: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sort_order'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$AttachmentsTable createAlias(String alias) {
|
|
return $AttachmentsTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<ParentType, String, String> $converterparentType =
|
|
const EnumNameConverter<ParentType>(ParentType.values);
|
|
static JsonTypeConverter2<AttachmentKind, String, String> $converterkind =
|
|
const EnumNameConverter<AttachmentKind>(AttachmentKind.values);
|
|
}
|
|
|
|
class Attachment extends DataClass implements Insertable<Attachment> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final ParentType parentType;
|
|
final String parentId;
|
|
final AttachmentKind kind;
|
|
final String? uri;
|
|
final Uint8List? bytes;
|
|
|
|
/// A small JPEG thumbnail of [bytes] (photos only), decoded once on save so
|
|
/// the inventory list never has to decode the full-resolution photo for a
|
|
/// 48px avatar. Purely derived, local and regenerable — it is EXCLUDED from
|
|
/// CRDT sync payloads and backups (see [SyncColumns] usage); a peer or a
|
|
/// restored backup regenerates it lazily via `backfillThumbnails`.
|
|
final Uint8List? thumbnail;
|
|
final String? mimeType;
|
|
|
|
/// Display order among sibling attachments (lower first). The lowest-ordered
|
|
/// photo is the "preferred"/cover — used as the variety avatar and shown
|
|
/// first. New photos append at the end; "set as cover" moves one to the
|
|
/// front. A plain int (not a bool flag) so it generalizes to full reordering.
|
|
final int sortOrder;
|
|
const Attachment({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.parentType,
|
|
required this.parentId,
|
|
required this.kind,
|
|
this.uri,
|
|
this.bytes,
|
|
this.thumbnail,
|
|
this.mimeType,
|
|
required this.sortOrder,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
{
|
|
map['parent_type'] = Variable<String>(
|
|
$AttachmentsTable.$converterparentType.toSql(parentType),
|
|
);
|
|
}
|
|
map['parent_id'] = Variable<String>(parentId);
|
|
{
|
|
map['kind'] = Variable<String>(
|
|
$AttachmentsTable.$converterkind.toSql(kind),
|
|
);
|
|
}
|
|
if (!nullToAbsent || uri != null) {
|
|
map['uri'] = Variable<String>(uri);
|
|
}
|
|
if (!nullToAbsent || bytes != null) {
|
|
map['bytes'] = Variable<Uint8List>(bytes);
|
|
}
|
|
if (!nullToAbsent || thumbnail != null) {
|
|
map['thumbnail'] = Variable<Uint8List>(thumbnail);
|
|
}
|
|
if (!nullToAbsent || mimeType != null) {
|
|
map['mime_type'] = Variable<String>(mimeType);
|
|
}
|
|
map['sort_order'] = Variable<int>(sortOrder);
|
|
return map;
|
|
}
|
|
|
|
AttachmentsCompanion toCompanion(bool nullToAbsent) {
|
|
return AttachmentsCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
parentType: Value(parentType),
|
|
parentId: Value(parentId),
|
|
kind: Value(kind),
|
|
uri: uri == null && nullToAbsent ? const Value.absent() : Value(uri),
|
|
bytes: bytes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(bytes),
|
|
thumbnail: thumbnail == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(thumbnail),
|
|
mimeType: mimeType == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(mimeType),
|
|
sortOrder: Value(sortOrder),
|
|
);
|
|
}
|
|
|
|
factory Attachment.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Attachment(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
parentType: $AttachmentsTable.$converterparentType.fromJson(
|
|
serializer.fromJson<String>(json['parentType']),
|
|
),
|
|
parentId: serializer.fromJson<String>(json['parentId']),
|
|
kind: $AttachmentsTable.$converterkind.fromJson(
|
|
serializer.fromJson<String>(json['kind']),
|
|
),
|
|
uri: serializer.fromJson<String?>(json['uri']),
|
|
bytes: serializer.fromJson<Uint8List?>(json['bytes']),
|
|
thumbnail: serializer.fromJson<Uint8List?>(json['thumbnail']),
|
|
mimeType: serializer.fromJson<String?>(json['mimeType']),
|
|
sortOrder: serializer.fromJson<int>(json['sortOrder']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'parentType': serializer.toJson<String>(
|
|
$AttachmentsTable.$converterparentType.toJson(parentType),
|
|
),
|
|
'parentId': serializer.toJson<String>(parentId),
|
|
'kind': serializer.toJson<String>(
|
|
$AttachmentsTable.$converterkind.toJson(kind),
|
|
),
|
|
'uri': serializer.toJson<String?>(uri),
|
|
'bytes': serializer.toJson<Uint8List?>(bytes),
|
|
'thumbnail': serializer.toJson<Uint8List?>(thumbnail),
|
|
'mimeType': serializer.toJson<String?>(mimeType),
|
|
'sortOrder': serializer.toJson<int>(sortOrder),
|
|
};
|
|
}
|
|
|
|
Attachment copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
ParentType? parentType,
|
|
String? parentId,
|
|
AttachmentKind? kind,
|
|
Value<String?> uri = const Value.absent(),
|
|
Value<Uint8List?> bytes = const Value.absent(),
|
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
|
Value<String?> mimeType = const Value.absent(),
|
|
int? sortOrder,
|
|
}) => Attachment(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
parentType: parentType ?? this.parentType,
|
|
parentId: parentId ?? this.parentId,
|
|
kind: kind ?? this.kind,
|
|
uri: uri.present ? uri.value : this.uri,
|
|
bytes: bytes.present ? bytes.value : this.bytes,
|
|
thumbnail: thumbnail.present ? thumbnail.value : this.thumbnail,
|
|
mimeType: mimeType.present ? mimeType.value : this.mimeType,
|
|
sortOrder: sortOrder ?? this.sortOrder,
|
|
);
|
|
Attachment copyWithCompanion(AttachmentsCompanion data) {
|
|
return Attachment(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
parentType: data.parentType.present
|
|
? data.parentType.value
|
|
: this.parentType,
|
|
parentId: data.parentId.present ? data.parentId.value : this.parentId,
|
|
kind: data.kind.present ? data.kind.value : this.kind,
|
|
uri: data.uri.present ? data.uri.value : this.uri,
|
|
bytes: data.bytes.present ? data.bytes.value : this.bytes,
|
|
thumbnail: data.thumbnail.present ? data.thumbnail.value : this.thumbnail,
|
|
mimeType: data.mimeType.present ? data.mimeType.value : this.mimeType,
|
|
sortOrder: data.sortOrder.present ? data.sortOrder.value : this.sortOrder,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Attachment(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('parentType: $parentType, ')
|
|
..write('parentId: $parentId, ')
|
|
..write('kind: $kind, ')
|
|
..write('uri: $uri, ')
|
|
..write('bytes: $bytes, ')
|
|
..write('thumbnail: $thumbnail, ')
|
|
..write('mimeType: $mimeType, ')
|
|
..write('sortOrder: $sortOrder')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
parentType,
|
|
parentId,
|
|
kind,
|
|
uri,
|
|
$driftBlobEquality.hash(bytes),
|
|
$driftBlobEquality.hash(thumbnail),
|
|
mimeType,
|
|
sortOrder,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Attachment &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.parentType == this.parentType &&
|
|
other.parentId == this.parentId &&
|
|
other.kind == this.kind &&
|
|
other.uri == this.uri &&
|
|
$driftBlobEquality.equals(other.bytes, this.bytes) &&
|
|
$driftBlobEquality.equals(other.thumbnail, this.thumbnail) &&
|
|
other.mimeType == this.mimeType &&
|
|
other.sortOrder == this.sortOrder);
|
|
}
|
|
|
|
class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<ParentType> parentType;
|
|
final Value<String> parentId;
|
|
final Value<AttachmentKind> kind;
|
|
final Value<String?> uri;
|
|
final Value<Uint8List?> bytes;
|
|
final Value<Uint8List?> thumbnail;
|
|
final Value<String?> mimeType;
|
|
final Value<int> sortOrder;
|
|
final Value<int> rowid;
|
|
const AttachmentsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.parentType = const Value.absent(),
|
|
this.parentId = const Value.absent(),
|
|
this.kind = const Value.absent(),
|
|
this.uri = const Value.absent(),
|
|
this.bytes = const Value.absent(),
|
|
this.thumbnail = const Value.absent(),
|
|
this.mimeType = const Value.absent(),
|
|
this.sortOrder = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
AttachmentsCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required AttachmentKind kind,
|
|
this.uri = const Value.absent(),
|
|
this.bytes = const Value.absent(),
|
|
this.thumbnail = const Value.absent(),
|
|
this.mimeType = const Value.absent(),
|
|
this.sortOrder = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
parentType = Value(parentType),
|
|
parentId = Value(parentId),
|
|
kind = Value(kind);
|
|
static Insertable<Attachment> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? parentType,
|
|
Expression<String>? parentId,
|
|
Expression<String>? kind,
|
|
Expression<String>? uri,
|
|
Expression<Uint8List>? bytes,
|
|
Expression<Uint8List>? thumbnail,
|
|
Expression<String>? mimeType,
|
|
Expression<int>? sortOrder,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (parentType != null) 'parent_type': parentType,
|
|
if (parentId != null) 'parent_id': parentId,
|
|
if (kind != null) 'kind': kind,
|
|
if (uri != null) 'uri': uri,
|
|
if (bytes != null) 'bytes': bytes,
|
|
if (thumbnail != null) 'thumbnail': thumbnail,
|
|
if (mimeType != null) 'mime_type': mimeType,
|
|
if (sortOrder != null) 'sort_order': sortOrder,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
AttachmentsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<ParentType>? parentType,
|
|
Value<String>? parentId,
|
|
Value<AttachmentKind>? kind,
|
|
Value<String?>? uri,
|
|
Value<Uint8List?>? bytes,
|
|
Value<Uint8List?>? thumbnail,
|
|
Value<String?>? mimeType,
|
|
Value<int>? sortOrder,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return AttachmentsCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
parentType: parentType ?? this.parentType,
|
|
parentId: parentId ?? this.parentId,
|
|
kind: kind ?? this.kind,
|
|
uri: uri ?? this.uri,
|
|
bytes: bytes ?? this.bytes,
|
|
thumbnail: thumbnail ?? this.thumbnail,
|
|
mimeType: mimeType ?? this.mimeType,
|
|
sortOrder: sortOrder ?? this.sortOrder,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (parentType.present) {
|
|
map['parent_type'] = Variable<String>(
|
|
$AttachmentsTable.$converterparentType.toSql(parentType.value),
|
|
);
|
|
}
|
|
if (parentId.present) {
|
|
map['parent_id'] = Variable<String>(parentId.value);
|
|
}
|
|
if (kind.present) {
|
|
map['kind'] = Variable<String>(
|
|
$AttachmentsTable.$converterkind.toSql(kind.value),
|
|
);
|
|
}
|
|
if (uri.present) {
|
|
map['uri'] = Variable<String>(uri.value);
|
|
}
|
|
if (bytes.present) {
|
|
map['bytes'] = Variable<Uint8List>(bytes.value);
|
|
}
|
|
if (thumbnail.present) {
|
|
map['thumbnail'] = Variable<Uint8List>(thumbnail.value);
|
|
}
|
|
if (mimeType.present) {
|
|
map['mime_type'] = Variable<String>(mimeType.value);
|
|
}
|
|
if (sortOrder.present) {
|
|
map['sort_order'] = Variable<int>(sortOrder.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AttachmentsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('parentType: $parentType, ')
|
|
..write('parentId: $parentId, ')
|
|
..write('kind: $kind, ')
|
|
..write('uri: $uri, ')
|
|
..write('bytes: $bytes, ')
|
|
..write('thumbnail: $thumbnail, ')
|
|
..write('mimeType: $mimeType, ')
|
|
..write('sortOrder: $sortOrder, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ExternalLinksTable extends ExternalLinks
|
|
with TableInfo<$ExternalLinksTable, ExternalLink> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ExternalLinksTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<ParentType, String> parentType =
|
|
GeneratedColumn<String>(
|
|
'parent_type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<ParentType>($ExternalLinksTable.$converterparentType);
|
|
static const VerificationMeta _parentIdMeta = const VerificationMeta(
|
|
'parentId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
|
|
'parent_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _urlMeta = const VerificationMeta('url');
|
|
@override
|
|
late final GeneratedColumn<String> url = GeneratedColumn<String>(
|
|
'url',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
parentType,
|
|
parentId,
|
|
url,
|
|
title,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'external_links';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ExternalLink> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('parent_id')) {
|
|
context.handle(
|
|
_parentIdMeta,
|
|
parentId.isAcceptableOrUnknown(data['parent_id']!, _parentIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_parentIdMeta);
|
|
}
|
|
if (data.containsKey('url')) {
|
|
context.handle(
|
|
_urlMeta,
|
|
url.isAcceptableOrUnknown(data['url']!, _urlMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_urlMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ExternalLink map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ExternalLink(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
parentType: $ExternalLinksTable.$converterparentType.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}parent_type'],
|
|
)!,
|
|
),
|
|
parentId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}parent_id'],
|
|
)!,
|
|
url: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}url'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ExternalLinksTable createAlias(String alias) {
|
|
return $ExternalLinksTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<ParentType, String, String> $converterparentType =
|
|
const EnumNameConverter<ParentType>(ParentType.values);
|
|
}
|
|
|
|
class ExternalLink extends DataClass implements Insertable<ExternalLink> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
final ParentType parentType;
|
|
final String parentId;
|
|
final String url;
|
|
final String? title;
|
|
const ExternalLink({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
required this.parentType,
|
|
required this.parentId,
|
|
required this.url,
|
|
this.title,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
{
|
|
map['parent_type'] = Variable<String>(
|
|
$ExternalLinksTable.$converterparentType.toSql(parentType),
|
|
);
|
|
}
|
|
map['parent_id'] = Variable<String>(parentId);
|
|
map['url'] = Variable<String>(url);
|
|
if (!nullToAbsent || title != null) {
|
|
map['title'] = Variable<String>(title);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ExternalLinksCompanion toCompanion(bool nullToAbsent) {
|
|
return ExternalLinksCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
parentType: Value(parentType),
|
|
parentId: Value(parentId),
|
|
url: Value(url),
|
|
title: title == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(title),
|
|
);
|
|
}
|
|
|
|
factory ExternalLink.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ExternalLink(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
parentType: $ExternalLinksTable.$converterparentType.fromJson(
|
|
serializer.fromJson<String>(json['parentType']),
|
|
),
|
|
parentId: serializer.fromJson<String>(json['parentId']),
|
|
url: serializer.fromJson<String>(json['url']),
|
|
title: serializer.fromJson<String?>(json['title']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'parentType': serializer.toJson<String>(
|
|
$ExternalLinksTable.$converterparentType.toJson(parentType),
|
|
),
|
|
'parentId': serializer.toJson<String>(parentId),
|
|
'url': serializer.toJson<String>(url),
|
|
'title': serializer.toJson<String?>(title),
|
|
};
|
|
}
|
|
|
|
ExternalLink copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
ParentType? parentType,
|
|
String? parentId,
|
|
String? url,
|
|
Value<String?> title = const Value.absent(),
|
|
}) => ExternalLink(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
parentType: parentType ?? this.parentType,
|
|
parentId: parentId ?? this.parentId,
|
|
url: url ?? this.url,
|
|
title: title.present ? title.value : this.title,
|
|
);
|
|
ExternalLink copyWithCompanion(ExternalLinksCompanion data) {
|
|
return ExternalLink(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
parentType: data.parentType.present
|
|
? data.parentType.value
|
|
: this.parentType,
|
|
parentId: data.parentId.present ? data.parentId.value : this.parentId,
|
|
url: data.url.present ? data.url.value : this.url,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ExternalLink(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('parentType: $parentType, ')
|
|
..write('parentId: $parentId, ')
|
|
..write('url: $url, ')
|
|
..write('title: $title')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
parentType,
|
|
parentId,
|
|
url,
|
|
title,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ExternalLink &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.parentType == this.parentType &&
|
|
other.parentId == this.parentId &&
|
|
other.url == this.url &&
|
|
other.title == this.title);
|
|
}
|
|
|
|
class ExternalLinksCompanion extends UpdateCompanion<ExternalLink> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<ParentType> parentType;
|
|
final Value<String> parentId;
|
|
final Value<String> url;
|
|
final Value<String?> title;
|
|
final Value<int> rowid;
|
|
const ExternalLinksCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.parentType = const Value.absent(),
|
|
this.parentId = const Value.absent(),
|
|
this.url = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ExternalLinksCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required String url,
|
|
this.title = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
parentType = Value(parentType),
|
|
parentId = Value(parentId),
|
|
url = Value(url);
|
|
static Insertable<ExternalLink> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? parentType,
|
|
Expression<String>? parentId,
|
|
Expression<String>? url,
|
|
Expression<String>? title,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (parentType != null) 'parent_type': parentType,
|
|
if (parentId != null) 'parent_id': parentId,
|
|
if (url != null) 'url': url,
|
|
if (title != null) 'title': title,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ExternalLinksCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<ParentType>? parentType,
|
|
Value<String>? parentId,
|
|
Value<String>? url,
|
|
Value<String?>? title,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ExternalLinksCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
parentType: parentType ?? this.parentType,
|
|
parentId: parentId ?? this.parentId,
|
|
url: url ?? this.url,
|
|
title: title ?? this.title,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (parentType.present) {
|
|
map['parent_type'] = Variable<String>(
|
|
$ExternalLinksTable.$converterparentType.toSql(parentType.value),
|
|
);
|
|
}
|
|
if (parentId.present) {
|
|
map['parent_id'] = Variable<String>(parentId.value);
|
|
}
|
|
if (url.present) {
|
|
map['url'] = Variable<String>(url.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ExternalLinksCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('parentType: $parentType, ')
|
|
..write('parentId: $parentId, ')
|
|
..write('url: $url, ')
|
|
..write('title: $title, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PlantaresTable extends Plantares
|
|
with TableInfo<$PlantaresTable, Plantare> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PlantaresTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
|
|
'varietyId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
|
|
'variety_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PlantareDirection, String>
|
|
direction = GeneratedColumn<String>(
|
|
'direction',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<PlantareDirection>($PlantaresTable.$converterdirection);
|
|
static const VerificationMeta _counterpartyMeta = const VerificationMeta(
|
|
'counterparty',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> counterparty = GeneratedColumn<String>(
|
|
'counterparty',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _owedDescriptionMeta = const VerificationMeta(
|
|
'owedDescription',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> owedDescription = GeneratedColumn<String>(
|
|
'owed_description',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _madeOnMeta = const VerificationMeta('madeOn');
|
|
@override
|
|
late final GeneratedColumn<int> madeOn = GeneratedColumn<int>(
|
|
'made_on',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _dueByMeta = const VerificationMeta('dueBy');
|
|
@override
|
|
late final GeneratedColumn<int> dueBy = GeneratedColumn<int>(
|
|
'due_by',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PlantareStatus, String> status =
|
|
GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('open'),
|
|
).withConverter<PlantareStatus>($PlantaresTable.$converterstatus);
|
|
static const VerificationMeta _settledOnMeta = const VerificationMeta(
|
|
'settledOn',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> settledOn = GeneratedColumn<int>(
|
|
'settled_on',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _pledgeIdMeta = const VerificationMeta(
|
|
'pledgeId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> pledgeId = GeneratedColumn<String>(
|
|
'pledge_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _debtorKeyMeta = const VerificationMeta(
|
|
'debtorKey',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> debtorKey = GeneratedColumn<String>(
|
|
'debtor_key',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _creditorKeyMeta = const VerificationMeta(
|
|
'creditorKey',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> creditorKey = GeneratedColumn<String>(
|
|
'creditor_key',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _debtorSignatureMeta = const VerificationMeta(
|
|
'debtorSignature',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> debtorSignature = GeneratedColumn<String>(
|
|
'debtor_signature',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _creditorSignatureMeta = const VerificationMeta(
|
|
'creditorSignature',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> creditorSignature =
|
|
GeneratedColumn<String>(
|
|
'creditor_signature',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _movementIdMeta = const VerificationMeta(
|
|
'movementId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> movementId = GeneratedColumn<String>(
|
|
'movement_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PlantareRemoteState?, String>
|
|
remoteState = GeneratedColumn<String>(
|
|
'remote_state',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
).withConverter<PlantareRemoteState?>($PlantaresTable.$converterremoteStaten);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<PlantareReturnKind, String>
|
|
returnKind = GeneratedColumn<String>(
|
|
'return_kind',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('similar'),
|
|
).withConverter<PlantareReturnKind>($PlantaresTable.$converterreturnKind);
|
|
static const VerificationMeta _workHoursMeta = const VerificationMeta(
|
|
'workHours',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> workHours = GeneratedColumn<double>(
|
|
'work_hours',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
direction,
|
|
counterparty,
|
|
owedDescription,
|
|
madeOn,
|
|
dueBy,
|
|
status,
|
|
settledOn,
|
|
note,
|
|
pledgeId,
|
|
debtorKey,
|
|
creditorKey,
|
|
debtorSignature,
|
|
creditorSignature,
|
|
movementId,
|
|
remoteState,
|
|
returnKind,
|
|
workHours,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'plantares';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Plantare> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('variety_id')) {
|
|
context.handle(
|
|
_varietyIdMeta,
|
|
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('counterparty')) {
|
|
context.handle(
|
|
_counterpartyMeta,
|
|
counterparty.isAcceptableOrUnknown(
|
|
data['counterparty']!,
|
|
_counterpartyMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('owed_description')) {
|
|
context.handle(
|
|
_owedDescriptionMeta,
|
|
owedDescription.isAcceptableOrUnknown(
|
|
data['owed_description']!,
|
|
_owedDescriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('made_on')) {
|
|
context.handle(
|
|
_madeOnMeta,
|
|
madeOn.isAcceptableOrUnknown(data['made_on']!, _madeOnMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_madeOnMeta);
|
|
}
|
|
if (data.containsKey('due_by')) {
|
|
context.handle(
|
|
_dueByMeta,
|
|
dueBy.isAcceptableOrUnknown(data['due_by']!, _dueByMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('settled_on')) {
|
|
context.handle(
|
|
_settledOnMeta,
|
|
settledOn.isAcceptableOrUnknown(data['settled_on']!, _settledOnMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('pledge_id')) {
|
|
context.handle(
|
|
_pledgeIdMeta,
|
|
pledgeId.isAcceptableOrUnknown(data['pledge_id']!, _pledgeIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('debtor_key')) {
|
|
context.handle(
|
|
_debtorKeyMeta,
|
|
debtorKey.isAcceptableOrUnknown(data['debtor_key']!, _debtorKeyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('creditor_key')) {
|
|
context.handle(
|
|
_creditorKeyMeta,
|
|
creditorKey.isAcceptableOrUnknown(
|
|
data['creditor_key']!,
|
|
_creditorKeyMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('debtor_signature')) {
|
|
context.handle(
|
|
_debtorSignatureMeta,
|
|
debtorSignature.isAcceptableOrUnknown(
|
|
data['debtor_signature']!,
|
|
_debtorSignatureMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('creditor_signature')) {
|
|
context.handle(
|
|
_creditorSignatureMeta,
|
|
creditorSignature.isAcceptableOrUnknown(
|
|
data['creditor_signature']!,
|
|
_creditorSignatureMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('movement_id')) {
|
|
context.handle(
|
|
_movementIdMeta,
|
|
movementId.isAcceptableOrUnknown(data['movement_id']!, _movementIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('work_hours')) {
|
|
context.handle(
|
|
_workHoursMeta,
|
|
workHours.isAcceptableOrUnknown(data['work_hours']!, _workHoursMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Plantare map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Plantare(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
varietyId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variety_id'],
|
|
),
|
|
direction: $PlantaresTable.$converterdirection.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}direction'],
|
|
)!,
|
|
),
|
|
counterparty: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}counterparty'],
|
|
),
|
|
owedDescription: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}owed_description'],
|
|
),
|
|
madeOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}made_on'],
|
|
)!,
|
|
dueBy: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}due_by'],
|
|
),
|
|
status: $PlantaresTable.$converterstatus.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
),
|
|
settledOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}settled_on'],
|
|
),
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
pledgeId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}pledge_id'],
|
|
),
|
|
debtorKey: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}debtor_key'],
|
|
),
|
|
creditorKey: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}creditor_key'],
|
|
),
|
|
debtorSignature: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}debtor_signature'],
|
|
),
|
|
creditorSignature: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}creditor_signature'],
|
|
),
|
|
movementId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}movement_id'],
|
|
),
|
|
remoteState: $PlantaresTable.$converterremoteStaten.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}remote_state'],
|
|
),
|
|
),
|
|
returnKind: $PlantaresTable.$converterreturnKind.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}return_kind'],
|
|
)!,
|
|
),
|
|
workHours: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}work_hours'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PlantaresTable createAlias(String alias) {
|
|
return $PlantaresTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<PlantareDirection, String, String>
|
|
$converterdirection = const EnumNameConverter<PlantareDirection>(
|
|
PlantareDirection.values,
|
|
);
|
|
static JsonTypeConverter2<PlantareStatus, String, String> $converterstatus =
|
|
const EnumNameConverter<PlantareStatus>(PlantareStatus.values);
|
|
static JsonTypeConverter2<PlantareRemoteState, String, String>
|
|
$converterremoteState = const EnumNameConverter<PlantareRemoteState>(
|
|
PlantareRemoteState.values,
|
|
);
|
|
static JsonTypeConverter2<PlantareRemoteState?, String?, String?>
|
|
$converterremoteStaten = JsonTypeConverter2.asNullable($converterremoteState);
|
|
static JsonTypeConverter2<PlantareReturnKind, String, String>
|
|
$converterreturnKind = const EnumNameConverter<PlantareReturnKind>(
|
|
PlantareReturnKind.values,
|
|
);
|
|
}
|
|
|
|
class Plantare extends DataClass implements Insertable<Plantare> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
|
|
/// The seed the commitment is about — what gets reproduced. Nullable so a
|
|
/// commitment can be jotted before it's linked to a catalogued variety.
|
|
final String? varietyId;
|
|
|
|
/// Whose promise it is (I return / owed to me).
|
|
final PlantareDirection direction;
|
|
|
|
/// The other party as a human name (v1). A key/Party link arrives with the
|
|
/// signed cross-party form.
|
|
final String? counterparty;
|
|
|
|
/// What's promised back, in the grower's own words
|
|
/// ("un puñado la próxima temporada").
|
|
final String? owedDescription;
|
|
|
|
/// When the promise was made (ms since epoch).
|
|
final int madeOn;
|
|
|
|
/// Optional return-by date (ms since epoch) — a gentle reminder, not a deadline.
|
|
final int? dueBy;
|
|
final PlantareStatus status;
|
|
|
|
/// When it was returned or forgiven (ms since epoch).
|
|
final int? settledOn;
|
|
final String? note;
|
|
|
|
/// The shared pledge id both parties agree on (the proposer's id). Distinct
|
|
/// from [id] (each side keeps its own local row). Null for a v1 local note.
|
|
final String? pledgeId;
|
|
|
|
/// Pubkey (hex) of who received the seed and owes a return.
|
|
final String? debtorKey;
|
|
|
|
/// Pubkey (hex) of who gave the seed.
|
|
final String? creditorKey;
|
|
|
|
/// The debtor's Schnorr stub over the canonical pledge core.
|
|
final String? debtorSignature;
|
|
|
|
/// The creditor's Schnorr stub over the canonical pledge core.
|
|
final String? creditorSignature;
|
|
|
|
/// The shared hand-over `Movement` this Plantare accompanies (provenance DAG).
|
|
final String? movementId;
|
|
|
|
/// The handshake state (proposed/accepted/declined), null for a v1 local row.
|
|
final PlantareRemoteState? remoteState;
|
|
|
|
/// How it's promised back (default `similar`: open-pollinated · non-GMO ·
|
|
/// organically grown), mirroring the paper form's checkboxes.
|
|
final PlantareReturnKind returnKind;
|
|
|
|
/// Hours for the `workHours` return option (time-as-currency). Null otherwise.
|
|
final double? workHours;
|
|
const Plantare({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
this.varietyId,
|
|
required this.direction,
|
|
this.counterparty,
|
|
this.owedDescription,
|
|
required this.madeOn,
|
|
this.dueBy,
|
|
required this.status,
|
|
this.settledOn,
|
|
this.note,
|
|
this.pledgeId,
|
|
this.debtorKey,
|
|
this.creditorKey,
|
|
this.debtorSignature,
|
|
this.creditorSignature,
|
|
this.movementId,
|
|
this.remoteState,
|
|
required this.returnKind,
|
|
this.workHours,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
if (!nullToAbsent || varietyId != null) {
|
|
map['variety_id'] = Variable<String>(varietyId);
|
|
}
|
|
{
|
|
map['direction'] = Variable<String>(
|
|
$PlantaresTable.$converterdirection.toSql(direction),
|
|
);
|
|
}
|
|
if (!nullToAbsent || counterparty != null) {
|
|
map['counterparty'] = Variable<String>(counterparty);
|
|
}
|
|
if (!nullToAbsent || owedDescription != null) {
|
|
map['owed_description'] = Variable<String>(owedDescription);
|
|
}
|
|
map['made_on'] = Variable<int>(madeOn);
|
|
if (!nullToAbsent || dueBy != null) {
|
|
map['due_by'] = Variable<int>(dueBy);
|
|
}
|
|
{
|
|
map['status'] = Variable<String>(
|
|
$PlantaresTable.$converterstatus.toSql(status),
|
|
);
|
|
}
|
|
if (!nullToAbsent || settledOn != null) {
|
|
map['settled_on'] = Variable<int>(settledOn);
|
|
}
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
if (!nullToAbsent || pledgeId != null) {
|
|
map['pledge_id'] = Variable<String>(pledgeId);
|
|
}
|
|
if (!nullToAbsent || debtorKey != null) {
|
|
map['debtor_key'] = Variable<String>(debtorKey);
|
|
}
|
|
if (!nullToAbsent || creditorKey != null) {
|
|
map['creditor_key'] = Variable<String>(creditorKey);
|
|
}
|
|
if (!nullToAbsent || debtorSignature != null) {
|
|
map['debtor_signature'] = Variable<String>(debtorSignature);
|
|
}
|
|
if (!nullToAbsent || creditorSignature != null) {
|
|
map['creditor_signature'] = Variable<String>(creditorSignature);
|
|
}
|
|
if (!nullToAbsent || movementId != null) {
|
|
map['movement_id'] = Variable<String>(movementId);
|
|
}
|
|
if (!nullToAbsent || remoteState != null) {
|
|
map['remote_state'] = Variable<String>(
|
|
$PlantaresTable.$converterremoteStaten.toSql(remoteState),
|
|
);
|
|
}
|
|
{
|
|
map['return_kind'] = Variable<String>(
|
|
$PlantaresTable.$converterreturnKind.toSql(returnKind),
|
|
);
|
|
}
|
|
if (!nullToAbsent || workHours != null) {
|
|
map['work_hours'] = Variable<double>(workHours);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
PlantaresCompanion toCompanion(bool nullToAbsent) {
|
|
return PlantaresCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
varietyId: varietyId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(varietyId),
|
|
direction: Value(direction),
|
|
counterparty: counterparty == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(counterparty),
|
|
owedDescription: owedDescription == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(owedDescription),
|
|
madeOn: Value(madeOn),
|
|
dueBy: dueBy == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(dueBy),
|
|
status: Value(status),
|
|
settledOn: settledOn == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(settledOn),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
pledgeId: pledgeId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(pledgeId),
|
|
debtorKey: debtorKey == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(debtorKey),
|
|
creditorKey: creditorKey == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(creditorKey),
|
|
debtorSignature: debtorSignature == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(debtorSignature),
|
|
creditorSignature: creditorSignature == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(creditorSignature),
|
|
movementId: movementId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(movementId),
|
|
remoteState: remoteState == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(remoteState),
|
|
returnKind: Value(returnKind),
|
|
workHours: workHours == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(workHours),
|
|
);
|
|
}
|
|
|
|
factory Plantare.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Plantare(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
varietyId: serializer.fromJson<String?>(json['varietyId']),
|
|
direction: $PlantaresTable.$converterdirection.fromJson(
|
|
serializer.fromJson<String>(json['direction']),
|
|
),
|
|
counterparty: serializer.fromJson<String?>(json['counterparty']),
|
|
owedDescription: serializer.fromJson<String?>(json['owedDescription']),
|
|
madeOn: serializer.fromJson<int>(json['madeOn']),
|
|
dueBy: serializer.fromJson<int?>(json['dueBy']),
|
|
status: $PlantaresTable.$converterstatus.fromJson(
|
|
serializer.fromJson<String>(json['status']),
|
|
),
|
|
settledOn: serializer.fromJson<int?>(json['settledOn']),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
pledgeId: serializer.fromJson<String?>(json['pledgeId']),
|
|
debtorKey: serializer.fromJson<String?>(json['debtorKey']),
|
|
creditorKey: serializer.fromJson<String?>(json['creditorKey']),
|
|
debtorSignature: serializer.fromJson<String?>(json['debtorSignature']),
|
|
creditorSignature: serializer.fromJson<String?>(
|
|
json['creditorSignature'],
|
|
),
|
|
movementId: serializer.fromJson<String?>(json['movementId']),
|
|
remoteState: $PlantaresTable.$converterremoteStaten.fromJson(
|
|
serializer.fromJson<String?>(json['remoteState']),
|
|
),
|
|
returnKind: $PlantaresTable.$converterreturnKind.fromJson(
|
|
serializer.fromJson<String>(json['returnKind']),
|
|
),
|
|
workHours: serializer.fromJson<double?>(json['workHours']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'varietyId': serializer.toJson<String?>(varietyId),
|
|
'direction': serializer.toJson<String>(
|
|
$PlantaresTable.$converterdirection.toJson(direction),
|
|
),
|
|
'counterparty': serializer.toJson<String?>(counterparty),
|
|
'owedDescription': serializer.toJson<String?>(owedDescription),
|
|
'madeOn': serializer.toJson<int>(madeOn),
|
|
'dueBy': serializer.toJson<int?>(dueBy),
|
|
'status': serializer.toJson<String>(
|
|
$PlantaresTable.$converterstatus.toJson(status),
|
|
),
|
|
'settledOn': serializer.toJson<int?>(settledOn),
|
|
'note': serializer.toJson<String?>(note),
|
|
'pledgeId': serializer.toJson<String?>(pledgeId),
|
|
'debtorKey': serializer.toJson<String?>(debtorKey),
|
|
'creditorKey': serializer.toJson<String?>(creditorKey),
|
|
'debtorSignature': serializer.toJson<String?>(debtorSignature),
|
|
'creditorSignature': serializer.toJson<String?>(creditorSignature),
|
|
'movementId': serializer.toJson<String?>(movementId),
|
|
'remoteState': serializer.toJson<String?>(
|
|
$PlantaresTable.$converterremoteStaten.toJson(remoteState),
|
|
),
|
|
'returnKind': serializer.toJson<String>(
|
|
$PlantaresTable.$converterreturnKind.toJson(returnKind),
|
|
),
|
|
'workHours': serializer.toJson<double?>(workHours),
|
|
};
|
|
}
|
|
|
|
Plantare copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
Value<String?> varietyId = const Value.absent(),
|
|
PlantareDirection? direction,
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<String?> owedDescription = const Value.absent(),
|
|
int? madeOn,
|
|
Value<int?> dueBy = const Value.absent(),
|
|
PlantareStatus? status,
|
|
Value<int?> settledOn = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> pledgeId = const Value.absent(),
|
|
Value<String?> debtorKey = const Value.absent(),
|
|
Value<String?> creditorKey = const Value.absent(),
|
|
Value<String?> debtorSignature = const Value.absent(),
|
|
Value<String?> creditorSignature = const Value.absent(),
|
|
Value<String?> movementId = const Value.absent(),
|
|
Value<PlantareRemoteState?> remoteState = const Value.absent(),
|
|
PlantareReturnKind? returnKind,
|
|
Value<double?> workHours = const Value.absent(),
|
|
}) => Plantare(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId.present ? varietyId.value : this.varietyId,
|
|
direction: direction ?? this.direction,
|
|
counterparty: counterparty.present ? counterparty.value : this.counterparty,
|
|
owedDescription: owedDescription.present
|
|
? owedDescription.value
|
|
: this.owedDescription,
|
|
madeOn: madeOn ?? this.madeOn,
|
|
dueBy: dueBy.present ? dueBy.value : this.dueBy,
|
|
status: status ?? this.status,
|
|
settledOn: settledOn.present ? settledOn.value : this.settledOn,
|
|
note: note.present ? note.value : this.note,
|
|
pledgeId: pledgeId.present ? pledgeId.value : this.pledgeId,
|
|
debtorKey: debtorKey.present ? debtorKey.value : this.debtorKey,
|
|
creditorKey: creditorKey.present ? creditorKey.value : this.creditorKey,
|
|
debtorSignature: debtorSignature.present
|
|
? debtorSignature.value
|
|
: this.debtorSignature,
|
|
creditorSignature: creditorSignature.present
|
|
? creditorSignature.value
|
|
: this.creditorSignature,
|
|
movementId: movementId.present ? movementId.value : this.movementId,
|
|
remoteState: remoteState.present ? remoteState.value : this.remoteState,
|
|
returnKind: returnKind ?? this.returnKind,
|
|
workHours: workHours.present ? workHours.value : this.workHours,
|
|
);
|
|
Plantare copyWithCompanion(PlantaresCompanion data) {
|
|
return Plantare(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
|
|
direction: data.direction.present ? data.direction.value : this.direction,
|
|
counterparty: data.counterparty.present
|
|
? data.counterparty.value
|
|
: this.counterparty,
|
|
owedDescription: data.owedDescription.present
|
|
? data.owedDescription.value
|
|
: this.owedDescription,
|
|
madeOn: data.madeOn.present ? data.madeOn.value : this.madeOn,
|
|
dueBy: data.dueBy.present ? data.dueBy.value : this.dueBy,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
settledOn: data.settledOn.present ? data.settledOn.value : this.settledOn,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
pledgeId: data.pledgeId.present ? data.pledgeId.value : this.pledgeId,
|
|
debtorKey: data.debtorKey.present ? data.debtorKey.value : this.debtorKey,
|
|
creditorKey: data.creditorKey.present
|
|
? data.creditorKey.value
|
|
: this.creditorKey,
|
|
debtorSignature: data.debtorSignature.present
|
|
? data.debtorSignature.value
|
|
: this.debtorSignature,
|
|
creditorSignature: data.creditorSignature.present
|
|
? data.creditorSignature.value
|
|
: this.creditorSignature,
|
|
movementId: data.movementId.present
|
|
? data.movementId.value
|
|
: this.movementId,
|
|
remoteState: data.remoteState.present
|
|
? data.remoteState.value
|
|
: this.remoteState,
|
|
returnKind: data.returnKind.present
|
|
? data.returnKind.value
|
|
: this.returnKind,
|
|
workHours: data.workHours.present ? data.workHours.value : this.workHours,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Plantare(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('direction: $direction, ')
|
|
..write('counterparty: $counterparty, ')
|
|
..write('owedDescription: $owedDescription, ')
|
|
..write('madeOn: $madeOn, ')
|
|
..write('dueBy: $dueBy, ')
|
|
..write('status: $status, ')
|
|
..write('settledOn: $settledOn, ')
|
|
..write('note: $note, ')
|
|
..write('pledgeId: $pledgeId, ')
|
|
..write('debtorKey: $debtorKey, ')
|
|
..write('creditorKey: $creditorKey, ')
|
|
..write('debtorSignature: $debtorSignature, ')
|
|
..write('creditorSignature: $creditorSignature, ')
|
|
..write('movementId: $movementId, ')
|
|
..write('remoteState: $remoteState, ')
|
|
..write('returnKind: $returnKind, ')
|
|
..write('workHours: $workHours')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
direction,
|
|
counterparty,
|
|
owedDescription,
|
|
madeOn,
|
|
dueBy,
|
|
status,
|
|
settledOn,
|
|
note,
|
|
pledgeId,
|
|
debtorKey,
|
|
creditorKey,
|
|
debtorSignature,
|
|
creditorSignature,
|
|
movementId,
|
|
remoteState,
|
|
returnKind,
|
|
workHours,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Plantare &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.varietyId == this.varietyId &&
|
|
other.direction == this.direction &&
|
|
other.counterparty == this.counterparty &&
|
|
other.owedDescription == this.owedDescription &&
|
|
other.madeOn == this.madeOn &&
|
|
other.dueBy == this.dueBy &&
|
|
other.status == this.status &&
|
|
other.settledOn == this.settledOn &&
|
|
other.note == this.note &&
|
|
other.pledgeId == this.pledgeId &&
|
|
other.debtorKey == this.debtorKey &&
|
|
other.creditorKey == this.creditorKey &&
|
|
other.debtorSignature == this.debtorSignature &&
|
|
other.creditorSignature == this.creditorSignature &&
|
|
other.movementId == this.movementId &&
|
|
other.remoteState == this.remoteState &&
|
|
other.returnKind == this.returnKind &&
|
|
other.workHours == this.workHours);
|
|
}
|
|
|
|
class PlantaresCompanion extends UpdateCompanion<Plantare> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String?> varietyId;
|
|
final Value<PlantareDirection> direction;
|
|
final Value<String?> counterparty;
|
|
final Value<String?> owedDescription;
|
|
final Value<int> madeOn;
|
|
final Value<int?> dueBy;
|
|
final Value<PlantareStatus> status;
|
|
final Value<int?> settledOn;
|
|
final Value<String?> note;
|
|
final Value<String?> pledgeId;
|
|
final Value<String?> debtorKey;
|
|
final Value<String?> creditorKey;
|
|
final Value<String?> debtorSignature;
|
|
final Value<String?> creditorSignature;
|
|
final Value<String?> movementId;
|
|
final Value<PlantareRemoteState?> remoteState;
|
|
final Value<PlantareReturnKind> returnKind;
|
|
final Value<double?> workHours;
|
|
final Value<int> rowid;
|
|
const PlantaresCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
this.direction = const Value.absent(),
|
|
this.counterparty = const Value.absent(),
|
|
this.owedDescription = const Value.absent(),
|
|
this.madeOn = const Value.absent(),
|
|
this.dueBy = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.settledOn = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.pledgeId = const Value.absent(),
|
|
this.debtorKey = const Value.absent(),
|
|
this.creditorKey = const Value.absent(),
|
|
this.debtorSignature = const Value.absent(),
|
|
this.creditorSignature = const Value.absent(),
|
|
this.movementId = const Value.absent(),
|
|
this.remoteState = const Value.absent(),
|
|
this.returnKind = const Value.absent(),
|
|
this.workHours = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PlantaresCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
required PlantareDirection direction,
|
|
this.counterparty = const Value.absent(),
|
|
this.owedDescription = const Value.absent(),
|
|
required int madeOn,
|
|
this.dueBy = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.settledOn = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.pledgeId = const Value.absent(),
|
|
this.debtorKey = const Value.absent(),
|
|
this.creditorKey = const Value.absent(),
|
|
this.debtorSignature = const Value.absent(),
|
|
this.creditorSignature = const Value.absent(),
|
|
this.movementId = const Value.absent(),
|
|
this.remoteState = const Value.absent(),
|
|
this.returnKind = const Value.absent(),
|
|
this.workHours = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
direction = Value(direction),
|
|
madeOn = Value(madeOn);
|
|
static Insertable<Plantare> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? varietyId,
|
|
Expression<String>? direction,
|
|
Expression<String>? counterparty,
|
|
Expression<String>? owedDescription,
|
|
Expression<int>? madeOn,
|
|
Expression<int>? dueBy,
|
|
Expression<String>? status,
|
|
Expression<int>? settledOn,
|
|
Expression<String>? note,
|
|
Expression<String>? pledgeId,
|
|
Expression<String>? debtorKey,
|
|
Expression<String>? creditorKey,
|
|
Expression<String>? debtorSignature,
|
|
Expression<String>? creditorSignature,
|
|
Expression<String>? movementId,
|
|
Expression<String>? remoteState,
|
|
Expression<String>? returnKind,
|
|
Expression<double>? workHours,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (varietyId != null) 'variety_id': varietyId,
|
|
if (direction != null) 'direction': direction,
|
|
if (counterparty != null) 'counterparty': counterparty,
|
|
if (owedDescription != null) 'owed_description': owedDescription,
|
|
if (madeOn != null) 'made_on': madeOn,
|
|
if (dueBy != null) 'due_by': dueBy,
|
|
if (status != null) 'status': status,
|
|
if (settledOn != null) 'settled_on': settledOn,
|
|
if (note != null) 'note': note,
|
|
if (pledgeId != null) 'pledge_id': pledgeId,
|
|
if (debtorKey != null) 'debtor_key': debtorKey,
|
|
if (creditorKey != null) 'creditor_key': creditorKey,
|
|
if (debtorSignature != null) 'debtor_signature': debtorSignature,
|
|
if (creditorSignature != null) 'creditor_signature': creditorSignature,
|
|
if (movementId != null) 'movement_id': movementId,
|
|
if (remoteState != null) 'remote_state': remoteState,
|
|
if (returnKind != null) 'return_kind': returnKind,
|
|
if (workHours != null) 'work_hours': workHours,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PlantaresCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String?>? varietyId,
|
|
Value<PlantareDirection>? direction,
|
|
Value<String?>? counterparty,
|
|
Value<String?>? owedDescription,
|
|
Value<int>? madeOn,
|
|
Value<int?>? dueBy,
|
|
Value<PlantareStatus>? status,
|
|
Value<int?>? settledOn,
|
|
Value<String?>? note,
|
|
Value<String?>? pledgeId,
|
|
Value<String?>? debtorKey,
|
|
Value<String?>? creditorKey,
|
|
Value<String?>? debtorSignature,
|
|
Value<String?>? creditorSignature,
|
|
Value<String?>? movementId,
|
|
Value<PlantareRemoteState?>? remoteState,
|
|
Value<PlantareReturnKind>? returnKind,
|
|
Value<double?>? workHours,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PlantaresCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
direction: direction ?? this.direction,
|
|
counterparty: counterparty ?? this.counterparty,
|
|
owedDescription: owedDescription ?? this.owedDescription,
|
|
madeOn: madeOn ?? this.madeOn,
|
|
dueBy: dueBy ?? this.dueBy,
|
|
status: status ?? this.status,
|
|
settledOn: settledOn ?? this.settledOn,
|
|
note: note ?? this.note,
|
|
pledgeId: pledgeId ?? this.pledgeId,
|
|
debtorKey: debtorKey ?? this.debtorKey,
|
|
creditorKey: creditorKey ?? this.creditorKey,
|
|
debtorSignature: debtorSignature ?? this.debtorSignature,
|
|
creditorSignature: creditorSignature ?? this.creditorSignature,
|
|
movementId: movementId ?? this.movementId,
|
|
remoteState: remoteState ?? this.remoteState,
|
|
returnKind: returnKind ?? this.returnKind,
|
|
workHours: workHours ?? this.workHours,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (varietyId.present) {
|
|
map['variety_id'] = Variable<String>(varietyId.value);
|
|
}
|
|
if (direction.present) {
|
|
map['direction'] = Variable<String>(
|
|
$PlantaresTable.$converterdirection.toSql(direction.value),
|
|
);
|
|
}
|
|
if (counterparty.present) {
|
|
map['counterparty'] = Variable<String>(counterparty.value);
|
|
}
|
|
if (owedDescription.present) {
|
|
map['owed_description'] = Variable<String>(owedDescription.value);
|
|
}
|
|
if (madeOn.present) {
|
|
map['made_on'] = Variable<int>(madeOn.value);
|
|
}
|
|
if (dueBy.present) {
|
|
map['due_by'] = Variable<int>(dueBy.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(
|
|
$PlantaresTable.$converterstatus.toSql(status.value),
|
|
);
|
|
}
|
|
if (settledOn.present) {
|
|
map['settled_on'] = Variable<int>(settledOn.value);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (pledgeId.present) {
|
|
map['pledge_id'] = Variable<String>(pledgeId.value);
|
|
}
|
|
if (debtorKey.present) {
|
|
map['debtor_key'] = Variable<String>(debtorKey.value);
|
|
}
|
|
if (creditorKey.present) {
|
|
map['creditor_key'] = Variable<String>(creditorKey.value);
|
|
}
|
|
if (debtorSignature.present) {
|
|
map['debtor_signature'] = Variable<String>(debtorSignature.value);
|
|
}
|
|
if (creditorSignature.present) {
|
|
map['creditor_signature'] = Variable<String>(creditorSignature.value);
|
|
}
|
|
if (movementId.present) {
|
|
map['movement_id'] = Variable<String>(movementId.value);
|
|
}
|
|
if (remoteState.present) {
|
|
map['remote_state'] = Variable<String>(
|
|
$PlantaresTable.$converterremoteStaten.toSql(remoteState.value),
|
|
);
|
|
}
|
|
if (returnKind.present) {
|
|
map['return_kind'] = Variable<String>(
|
|
$PlantaresTable.$converterreturnKind.toSql(returnKind.value),
|
|
);
|
|
}
|
|
if (workHours.present) {
|
|
map['work_hours'] = Variable<double>(workHours.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlantaresCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('direction: $direction, ')
|
|
..write('counterparty: $counterparty, ')
|
|
..write('owedDescription: $owedDescription, ')
|
|
..write('madeOn: $madeOn, ')
|
|
..write('dueBy: $dueBy, ')
|
|
..write('status: $status, ')
|
|
..write('settledOn: $settledOn, ')
|
|
..write('note: $note, ')
|
|
..write('pledgeId: $pledgeId, ')
|
|
..write('debtorKey: $debtorKey, ')
|
|
..write('creditorKey: $creditorKey, ')
|
|
..write('debtorSignature: $debtorSignature, ')
|
|
..write('creditorSignature: $creditorSignature, ')
|
|
..write('movementId: $movementId, ')
|
|
..write('remoteState: $remoteState, ')
|
|
..write('returnKind: $returnKind, ')
|
|
..write('workHours: $workHours, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $SalesTable extends Sales with TableInfo<$SalesTable, Sale> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$SalesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
|
|
'lastAuthor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
|
|
'last_author',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
|
|
'schemaRowVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
|
|
'schema_row_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
|
|
'varietyId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
|
|
'variety_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
late final GeneratedColumnWithTypeConverter<SaleDirection, String> direction =
|
|
GeneratedColumn<String>(
|
|
'direction',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
).withConverter<SaleDirection>($SalesTable.$converterdirection);
|
|
static const VerificationMeta _counterpartyMeta = const VerificationMeta(
|
|
'counterparty',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> counterparty = GeneratedColumn<String>(
|
|
'counterparty',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _amountMeta = const VerificationMeta('amount');
|
|
@override
|
|
late final GeneratedColumn<double> amount = GeneratedColumn<double>(
|
|
'amount',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _currencyMeta = const VerificationMeta(
|
|
'currency',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> currency = GeneratedColumn<String>(
|
|
'currency',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _soldOnMeta = const VerificationMeta('soldOn');
|
|
@override
|
|
late final GeneratedColumn<int> soldOn = GeneratedColumn<int>(
|
|
'sold_on',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
direction,
|
|
counterparty,
|
|
amount,
|
|
currency,
|
|
soldOn,
|
|
note,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'sales';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Sale> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('last_author')) {
|
|
context.handle(
|
|
_lastAuthorMeta,
|
|
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lastAuthorMeta);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('schema_row_version')) {
|
|
context.handle(
|
|
_schemaRowVersionMeta,
|
|
schemaRowVersion.isAcceptableOrUnknown(
|
|
data['schema_row_version']!,
|
|
_schemaRowVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('variety_id')) {
|
|
context.handle(
|
|
_varietyIdMeta,
|
|
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('counterparty')) {
|
|
context.handle(
|
|
_counterpartyMeta,
|
|
counterparty.isAcceptableOrUnknown(
|
|
data['counterparty']!,
|
|
_counterpartyMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('amount')) {
|
|
context.handle(
|
|
_amountMeta,
|
|
amount.isAcceptableOrUnknown(data['amount']!, _amountMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('currency')) {
|
|
context.handle(
|
|
_currencyMeta,
|
|
currency.isAcceptableOrUnknown(data['currency']!, _currencyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('sold_on')) {
|
|
context.handle(
|
|
_soldOnMeta,
|
|
soldOn.isAcceptableOrUnknown(data['sold_on']!, _soldOnMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_soldOnMeta);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Sale map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Sale(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
lastAuthor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}last_author'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
schemaRowVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}schema_row_version'],
|
|
)!,
|
|
varietyId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variety_id'],
|
|
),
|
|
direction: $SalesTable.$converterdirection.fromSql(
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}direction'],
|
|
)!,
|
|
),
|
|
counterparty: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}counterparty'],
|
|
),
|
|
amount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}amount'],
|
|
),
|
|
currency: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}currency'],
|
|
),
|
|
soldOn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sold_on'],
|
|
)!,
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$SalesTable createAlias(String alias) {
|
|
return $SalesTable(attachedDatabase, alias);
|
|
}
|
|
|
|
static JsonTypeConverter2<SaleDirection, String, String> $converterdirection =
|
|
const EnumNameConverter<SaleDirection>(SaleDirection.values);
|
|
}
|
|
|
|
class Sale extends DataClass implements Insertable<Sale> {
|
|
final String id;
|
|
final int createdAt;
|
|
final String updatedAt;
|
|
final String lastAuthor;
|
|
final bool isDeleted;
|
|
final int schemaRowVersion;
|
|
|
|
/// The seed sold/bought. Nullable so a sale can be jotted before it's linked
|
|
/// to a catalogued variety.
|
|
final String? varietyId;
|
|
|
|
/// Whether I sold or I bought.
|
|
final SaleDirection direction;
|
|
|
|
/// The other party as a human name (v1).
|
|
final String? counterparty;
|
|
|
|
/// Price paid. Nullable — a barter-ish "sale" recorded before a figure is set.
|
|
final double? amount;
|
|
|
|
/// The currency, free text: "€", "Ğ1", "horas", a local currency name. Never
|
|
/// assumed — the seed world uses many (sharing-model §6).
|
|
final String? currency;
|
|
|
|
/// When the sale happened (ms since epoch).
|
|
final int soldOn;
|
|
final String? note;
|
|
const Sale({
|
|
required this.id,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.lastAuthor,
|
|
required this.isDeleted,
|
|
required this.schemaRowVersion,
|
|
this.varietyId,
|
|
required this.direction,
|
|
this.counterparty,
|
|
this.amount,
|
|
this.currency,
|
|
required this.soldOn,
|
|
this.note,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['created_at'] = Variable<int>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
map['last_author'] = Variable<String>(lastAuthor);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion);
|
|
if (!nullToAbsent || varietyId != null) {
|
|
map['variety_id'] = Variable<String>(varietyId);
|
|
}
|
|
{
|
|
map['direction'] = Variable<String>(
|
|
$SalesTable.$converterdirection.toSql(direction),
|
|
);
|
|
}
|
|
if (!nullToAbsent || counterparty != null) {
|
|
map['counterparty'] = Variable<String>(counterparty);
|
|
}
|
|
if (!nullToAbsent || amount != null) {
|
|
map['amount'] = Variable<double>(amount);
|
|
}
|
|
if (!nullToAbsent || currency != null) {
|
|
map['currency'] = Variable<String>(currency);
|
|
}
|
|
map['sold_on'] = Variable<int>(soldOn);
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
SalesCompanion toCompanion(bool nullToAbsent) {
|
|
return SalesCompanion(
|
|
id: Value(id),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
lastAuthor: Value(lastAuthor),
|
|
isDeleted: Value(isDeleted),
|
|
schemaRowVersion: Value(schemaRowVersion),
|
|
varietyId: varietyId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(varietyId),
|
|
direction: Value(direction),
|
|
counterparty: counterparty == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(counterparty),
|
|
amount: amount == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(amount),
|
|
currency: currency == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(currency),
|
|
soldOn: Value(soldOn),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
);
|
|
}
|
|
|
|
factory Sale.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Sale(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
createdAt: serializer.fromJson<int>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
|
|
varietyId: serializer.fromJson<String?>(json['varietyId']),
|
|
direction: $SalesTable.$converterdirection.fromJson(
|
|
serializer.fromJson<String>(json['direction']),
|
|
),
|
|
counterparty: serializer.fromJson<String?>(json['counterparty']),
|
|
amount: serializer.fromJson<double?>(json['amount']),
|
|
currency: serializer.fromJson<String?>(json['currency']),
|
|
soldOn: serializer.fromJson<int>(json['soldOn']),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'createdAt': serializer.toJson<int>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
'lastAuthor': serializer.toJson<String>(lastAuthor),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
|
|
'varietyId': serializer.toJson<String?>(varietyId),
|
|
'direction': serializer.toJson<String>(
|
|
$SalesTable.$converterdirection.toJson(direction),
|
|
),
|
|
'counterparty': serializer.toJson<String?>(counterparty),
|
|
'amount': serializer.toJson<double?>(amount),
|
|
'currency': serializer.toJson<String?>(currency),
|
|
'soldOn': serializer.toJson<int>(soldOn),
|
|
'note': serializer.toJson<String?>(note),
|
|
};
|
|
}
|
|
|
|
Sale copyWith({
|
|
String? id,
|
|
int? createdAt,
|
|
String? updatedAt,
|
|
String? lastAuthor,
|
|
bool? isDeleted,
|
|
int? schemaRowVersion,
|
|
Value<String?> varietyId = const Value.absent(),
|
|
SaleDirection? direction,
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<double?> amount = const Value.absent(),
|
|
Value<String?> currency = const Value.absent(),
|
|
int? soldOn,
|
|
Value<String?> note = const Value.absent(),
|
|
}) => Sale(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId.present ? varietyId.value : this.varietyId,
|
|
direction: direction ?? this.direction,
|
|
counterparty: counterparty.present ? counterparty.value : this.counterparty,
|
|
amount: amount.present ? amount.value : this.amount,
|
|
currency: currency.present ? currency.value : this.currency,
|
|
soldOn: soldOn ?? this.soldOn,
|
|
note: note.present ? note.value : this.note,
|
|
);
|
|
Sale copyWithCompanion(SalesCompanion data) {
|
|
return Sale(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
lastAuthor: data.lastAuthor.present
|
|
? data.lastAuthor.value
|
|
: this.lastAuthor,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
schemaRowVersion: data.schemaRowVersion.present
|
|
? data.schemaRowVersion.value
|
|
: this.schemaRowVersion,
|
|
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
|
|
direction: data.direction.present ? data.direction.value : this.direction,
|
|
counterparty: data.counterparty.present
|
|
? data.counterparty.value
|
|
: this.counterparty,
|
|
amount: data.amount.present ? data.amount.value : this.amount,
|
|
currency: data.currency.present ? data.currency.value : this.currency,
|
|
soldOn: data.soldOn.present ? data.soldOn.value : this.soldOn,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Sale(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('direction: $direction, ')
|
|
..write('counterparty: $counterparty, ')
|
|
..write('amount: $amount, ')
|
|
..write('currency: $currency, ')
|
|
..write('soldOn: $soldOn, ')
|
|
..write('note: $note')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
createdAt,
|
|
updatedAt,
|
|
lastAuthor,
|
|
isDeleted,
|
|
schemaRowVersion,
|
|
varietyId,
|
|
direction,
|
|
counterparty,
|
|
amount,
|
|
currency,
|
|
soldOn,
|
|
note,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Sale &&
|
|
other.id == this.id &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.lastAuthor == this.lastAuthor &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.schemaRowVersion == this.schemaRowVersion &&
|
|
other.varietyId == this.varietyId &&
|
|
other.direction == this.direction &&
|
|
other.counterparty == this.counterparty &&
|
|
other.amount == this.amount &&
|
|
other.currency == this.currency &&
|
|
other.soldOn == this.soldOn &&
|
|
other.note == this.note);
|
|
}
|
|
|
|
class SalesCompanion extends UpdateCompanion<Sale> {
|
|
final Value<String> id;
|
|
final Value<int> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<String> lastAuthor;
|
|
final Value<bool> isDeleted;
|
|
final Value<int> schemaRowVersion;
|
|
final Value<String?> varietyId;
|
|
final Value<SaleDirection> direction;
|
|
final Value<String?> counterparty;
|
|
final Value<double?> amount;
|
|
final Value<String?> currency;
|
|
final Value<int> soldOn;
|
|
final Value<String?> note;
|
|
final Value<int> rowid;
|
|
const SalesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.lastAuthor = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
this.direction = const Value.absent(),
|
|
this.counterparty = const Value.absent(),
|
|
this.amount = const Value.absent(),
|
|
this.currency = const Value.absent(),
|
|
this.soldOn = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
SalesCompanion.insert({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
this.isDeleted = const Value.absent(),
|
|
this.schemaRowVersion = const Value.absent(),
|
|
this.varietyId = const Value.absent(),
|
|
required SaleDirection direction,
|
|
this.counterparty = const Value.absent(),
|
|
this.amount = const Value.absent(),
|
|
this.currency = const Value.absent(),
|
|
required int soldOn,
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
lastAuthor = Value(lastAuthor),
|
|
direction = Value(direction),
|
|
soldOn = Value(soldOn);
|
|
static Insertable<Sale> custom({
|
|
Expression<String>? id,
|
|
Expression<int>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<String>? lastAuthor,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? schemaRowVersion,
|
|
Expression<String>? varietyId,
|
|
Expression<String>? direction,
|
|
Expression<String>? counterparty,
|
|
Expression<double>? amount,
|
|
Expression<String>? currency,
|
|
Expression<int>? soldOn,
|
|
Expression<String>? note,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (lastAuthor != null) 'last_author': lastAuthor,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
|
|
if (varietyId != null) 'variety_id': varietyId,
|
|
if (direction != null) 'direction': direction,
|
|
if (counterparty != null) 'counterparty': counterparty,
|
|
if (amount != null) 'amount': amount,
|
|
if (currency != null) 'currency': currency,
|
|
if (soldOn != null) 'sold_on': soldOn,
|
|
if (note != null) 'note': note,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
SalesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<int>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<String>? lastAuthor,
|
|
Value<bool>? isDeleted,
|
|
Value<int>? schemaRowVersion,
|
|
Value<String?>? varietyId,
|
|
Value<SaleDirection>? direction,
|
|
Value<String?>? counterparty,
|
|
Value<double?>? amount,
|
|
Value<String?>? currency,
|
|
Value<int>? soldOn,
|
|
Value<String?>? note,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return SalesCompanion(
|
|
id: id ?? this.id,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
lastAuthor: lastAuthor ?? this.lastAuthor,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
|
|
varietyId: varietyId ?? this.varietyId,
|
|
direction: direction ?? this.direction,
|
|
counterparty: counterparty ?? this.counterparty,
|
|
amount: amount ?? this.amount,
|
|
currency: currency ?? this.currency,
|
|
soldOn: soldOn ?? this.soldOn,
|
|
note: note ?? this.note,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<int>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (lastAuthor.present) {
|
|
map['last_author'] = Variable<String>(lastAuthor.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (schemaRowVersion.present) {
|
|
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
|
|
}
|
|
if (varietyId.present) {
|
|
map['variety_id'] = Variable<String>(varietyId.value);
|
|
}
|
|
if (direction.present) {
|
|
map['direction'] = Variable<String>(
|
|
$SalesTable.$converterdirection.toSql(direction.value),
|
|
);
|
|
}
|
|
if (counterparty.present) {
|
|
map['counterparty'] = Variable<String>(counterparty.value);
|
|
}
|
|
if (amount.present) {
|
|
map['amount'] = Variable<double>(amount.value);
|
|
}
|
|
if (currency.present) {
|
|
map['currency'] = Variable<String>(currency.value);
|
|
}
|
|
if (soldOn.present) {
|
|
map['sold_on'] = Variable<int>(soldOn.value);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SalesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('lastAuthor: $lastAuthor, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('schemaRowVersion: $schemaRowVersion, ')
|
|
..write('varietyId: $varietyId, ')
|
|
..write('direction: $direction, ')
|
|
..write('counterparty: $counterparty, ')
|
|
..write('amount: $amount, ')
|
|
..write('currency: $currency, ')
|
|
..write('soldOn: $soldOn, ')
|
|
..write('note: $note, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $VarietiesTable varieties = $VarietiesTable(this);
|
|
late final $VarietyVernacularNamesTable varietyVernacularNames =
|
|
$VarietyVernacularNamesTable(this);
|
|
late final $SpeciesTable species = $SpeciesTable(this);
|
|
late final $SpeciesCommonNamesTable speciesCommonNames =
|
|
$SpeciesCommonNamesTable(this);
|
|
late final $LotsTable lots = $LotsTable(this);
|
|
late final $GerminationTestsTable germinationTests = $GerminationTestsTable(
|
|
this,
|
|
);
|
|
late final $ConditionChecksTable conditionChecks = $ConditionChecksTable(
|
|
this,
|
|
);
|
|
late final $GardenOutcomesTable gardenOutcomes = $GardenOutcomesTable(this);
|
|
late final $MovementsTable movements = $MovementsTable(this);
|
|
late final $PartiesTable parties = $PartiesTable(this);
|
|
late final $AttachmentsTable attachments = $AttachmentsTable(this);
|
|
late final $ExternalLinksTable externalLinks = $ExternalLinksTable(this);
|
|
late final $PlantaresTable plantares = $PlantaresTable(this);
|
|
late final $SalesTable sales = $SalesTable(this);
|
|
late final Index idxVarietiesDeletedDraft = Index(
|
|
'idx_varieties_deleted_draft',
|
|
'CREATE INDEX idx_varieties_deleted_draft ON varieties (is_deleted, is_draft)',
|
|
);
|
|
late final Index idxLotsVariety = Index(
|
|
'idx_lots_variety',
|
|
'CREATE INDEX idx_lots_variety ON lots (variety_id)',
|
|
);
|
|
late final Index idxAttachmentsParent = Index(
|
|
'idx_attachments_parent',
|
|
'CREATE INDEX idx_attachments_parent ON attachments (parent_type, parent_id, kind)',
|
|
);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
varieties,
|
|
varietyVernacularNames,
|
|
species,
|
|
speciesCommonNames,
|
|
lots,
|
|
germinationTests,
|
|
conditionChecks,
|
|
gardenOutcomes,
|
|
movements,
|
|
parties,
|
|
attachments,
|
|
externalLinks,
|
|
plantares,
|
|
sales,
|
|
idxVarietiesDeletedDraft,
|
|
idxLotsVariety,
|
|
idxAttachmentsParent,
|
|
];
|
|
}
|
|
|
|
typedef $$VarietiesTableCreateCompanionBuilder =
|
|
VarietiesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String label,
|
|
Value<String?> speciesId,
|
|
Value<String?> cultivarName,
|
|
Value<String?> category,
|
|
Value<String?> notes,
|
|
Value<bool> isDraft,
|
|
Value<bool> isOrganic,
|
|
Value<bool> needsReproduction,
|
|
Value<int?> sowMonths,
|
|
Value<int?> transplantMonths,
|
|
Value<int?> floweringMonths,
|
|
Value<int?> fruitingMonths,
|
|
Value<int?> seedHarvestMonths,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$VarietiesTableUpdateCompanionBuilder =
|
|
VarietiesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> label,
|
|
Value<String?> speciesId,
|
|
Value<String?> cultivarName,
|
|
Value<String?> category,
|
|
Value<String?> notes,
|
|
Value<bool> isDraft,
|
|
Value<bool> isOrganic,
|
|
Value<bool> needsReproduction,
|
|
Value<int?> sowMonths,
|
|
Value<int?> transplantMonths,
|
|
Value<int?> floweringMonths,
|
|
Value<int?> fruitingMonths,
|
|
Value<int?> seedHarvestMonths,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$VarietiesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $VarietiesTable> {
|
|
$$VarietiesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get label => $composableBuilder(
|
|
column: $table.label,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get speciesId => $composableBuilder(
|
|
column: $table.speciesId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get cultivarName => $composableBuilder(
|
|
column: $table.cultivarName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDraft => $composableBuilder(
|
|
column: $table.isDraft,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isOrganic => $composableBuilder(
|
|
column: $table.isOrganic,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get needsReproduction => $composableBuilder(
|
|
column: $table.needsReproduction,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sowMonths => $composableBuilder(
|
|
column: $table.sowMonths,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get transplantMonths => $composableBuilder(
|
|
column: $table.transplantMonths,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get floweringMonths => $composableBuilder(
|
|
column: $table.floweringMonths,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get fruitingMonths => $composableBuilder(
|
|
column: $table.fruitingMonths,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get seedHarvestMonths => $composableBuilder(
|
|
column: $table.seedHarvestMonths,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$VarietiesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $VarietiesTable> {
|
|
$$VarietiesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get label => $composableBuilder(
|
|
column: $table.label,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get speciesId => $composableBuilder(
|
|
column: $table.speciesId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get cultivarName => $composableBuilder(
|
|
column: $table.cultivarName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDraft => $composableBuilder(
|
|
column: $table.isDraft,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isOrganic => $composableBuilder(
|
|
column: $table.isOrganic,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get needsReproduction => $composableBuilder(
|
|
column: $table.needsReproduction,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sowMonths => $composableBuilder(
|
|
column: $table.sowMonths,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get transplantMonths => $composableBuilder(
|
|
column: $table.transplantMonths,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get floweringMonths => $composableBuilder(
|
|
column: $table.floweringMonths,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get fruitingMonths => $composableBuilder(
|
|
column: $table.fruitingMonths,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get seedHarvestMonths => $composableBuilder(
|
|
column: $table.seedHarvestMonths,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$VarietiesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $VarietiesTable> {
|
|
$$VarietiesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get label =>
|
|
$composableBuilder(column: $table.label, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get speciesId =>
|
|
$composableBuilder(column: $table.speciesId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get cultivarName => $composableBuilder(
|
|
column: $table.cultivarName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get category =>
|
|
$composableBuilder(column: $table.category, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isDraft =>
|
|
$composableBuilder(column: $table.isDraft, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isOrganic =>
|
|
$composableBuilder(column: $table.isOrganic, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get needsReproduction => $composableBuilder(
|
|
column: $table.needsReproduction,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get sowMonths =>
|
|
$composableBuilder(column: $table.sowMonths, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get transplantMonths => $composableBuilder(
|
|
column: $table.transplantMonths,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get floweringMonths => $composableBuilder(
|
|
column: $table.floweringMonths,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get fruitingMonths => $composableBuilder(
|
|
column: $table.fruitingMonths,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get seedHarvestMonths => $composableBuilder(
|
|
column: $table.seedHarvestMonths,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$VarietiesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$VarietiesTable,
|
|
Variety,
|
|
$$VarietiesTableFilterComposer,
|
|
$$VarietiesTableOrderingComposer,
|
|
$$VarietiesTableAnnotationComposer,
|
|
$$VarietiesTableCreateCompanionBuilder,
|
|
$$VarietiesTableUpdateCompanionBuilder,
|
|
(Variety, BaseReferences<_$AppDatabase, $VarietiesTable, Variety>),
|
|
Variety,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$VarietiesTableTableManager(_$AppDatabase db, $VarietiesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$VarietiesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$VarietiesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$VarietiesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> label = const Value.absent(),
|
|
Value<String?> speciesId = const Value.absent(),
|
|
Value<String?> cultivarName = const Value.absent(),
|
|
Value<String?> category = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<bool> isDraft = const Value.absent(),
|
|
Value<bool> isOrganic = const Value.absent(),
|
|
Value<bool> needsReproduction = const Value.absent(),
|
|
Value<int?> sowMonths = const Value.absent(),
|
|
Value<int?> transplantMonths = const Value.absent(),
|
|
Value<int?> floweringMonths = const Value.absent(),
|
|
Value<int?> fruitingMonths = const Value.absent(),
|
|
Value<int?> seedHarvestMonths = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => VarietiesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
label: label,
|
|
speciesId: speciesId,
|
|
cultivarName: cultivarName,
|
|
category: category,
|
|
notes: notes,
|
|
isDraft: isDraft,
|
|
isOrganic: isOrganic,
|
|
needsReproduction: needsReproduction,
|
|
sowMonths: sowMonths,
|
|
transplantMonths: transplantMonths,
|
|
floweringMonths: floweringMonths,
|
|
fruitingMonths: fruitingMonths,
|
|
seedHarvestMonths: seedHarvestMonths,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String label,
|
|
Value<String?> speciesId = const Value.absent(),
|
|
Value<String?> cultivarName = const Value.absent(),
|
|
Value<String?> category = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<bool> isDraft = const Value.absent(),
|
|
Value<bool> isOrganic = const Value.absent(),
|
|
Value<bool> needsReproduction = const Value.absent(),
|
|
Value<int?> sowMonths = const Value.absent(),
|
|
Value<int?> transplantMonths = const Value.absent(),
|
|
Value<int?> floweringMonths = const Value.absent(),
|
|
Value<int?> fruitingMonths = const Value.absent(),
|
|
Value<int?> seedHarvestMonths = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => VarietiesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
label: label,
|
|
speciesId: speciesId,
|
|
cultivarName: cultivarName,
|
|
category: category,
|
|
notes: notes,
|
|
isDraft: isDraft,
|
|
isOrganic: isOrganic,
|
|
needsReproduction: needsReproduction,
|
|
sowMonths: sowMonths,
|
|
transplantMonths: transplantMonths,
|
|
floweringMonths: floweringMonths,
|
|
fruitingMonths: fruitingMonths,
|
|
seedHarvestMonths: seedHarvestMonths,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$VarietiesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$VarietiesTable,
|
|
Variety,
|
|
$$VarietiesTableFilterComposer,
|
|
$$VarietiesTableOrderingComposer,
|
|
$$VarietiesTableAnnotationComposer,
|
|
$$VarietiesTableCreateCompanionBuilder,
|
|
$$VarietiesTableUpdateCompanionBuilder,
|
|
(Variety, BaseReferences<_$AppDatabase, $VarietiesTable, Variety>),
|
|
Variety,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$VarietyVernacularNamesTableCreateCompanionBuilder =
|
|
VarietyVernacularNamesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String varietyId,
|
|
required String name,
|
|
Value<String?> language,
|
|
Value<String?> region,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$VarietyVernacularNamesTableUpdateCompanionBuilder =
|
|
VarietyVernacularNamesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> varietyId,
|
|
Value<String> name,
|
|
Value<String?> language,
|
|
Value<String?> region,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$VarietyVernacularNamesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
|
|
$$VarietyVernacularNamesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get language => $composableBuilder(
|
|
column: $table.language,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get region => $composableBuilder(
|
|
column: $table.region,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$VarietyVernacularNamesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
|
|
$$VarietyVernacularNamesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get language => $composableBuilder(
|
|
column: $table.language,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get region => $composableBuilder(
|
|
column: $table.region,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$VarietyVernacularNamesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
|
|
$$VarietyVernacularNamesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get varietyId =>
|
|
$composableBuilder(column: $table.varietyId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get language =>
|
|
$composableBuilder(column: $table.language, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get region =>
|
|
$composableBuilder(column: $table.region, builder: (column) => column);
|
|
}
|
|
|
|
class $$VarietyVernacularNamesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$VarietyVernacularNamesTable,
|
|
VarietyVernacularName,
|
|
$$VarietyVernacularNamesTableFilterComposer,
|
|
$$VarietyVernacularNamesTableOrderingComposer,
|
|
$$VarietyVernacularNamesTableAnnotationComposer,
|
|
$$VarietyVernacularNamesTableCreateCompanionBuilder,
|
|
$$VarietyVernacularNamesTableUpdateCompanionBuilder,
|
|
(
|
|
VarietyVernacularName,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$VarietyVernacularNamesTable,
|
|
VarietyVernacularName
|
|
>,
|
|
),
|
|
VarietyVernacularName,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$VarietyVernacularNamesTableTableManager(
|
|
_$AppDatabase db,
|
|
$VarietyVernacularNamesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$VarietyVernacularNamesTableFilterComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createOrderingComposer: () =>
|
|
$$VarietyVernacularNamesTableOrderingComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
createComputedFieldComposer: () =>
|
|
$$VarietyVernacularNamesTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> varietyId = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> language = const Value.absent(),
|
|
Value<String?> region = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => VarietyVernacularNamesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
name: name,
|
|
language: language,
|
|
region: region,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String varietyId,
|
|
required String name,
|
|
Value<String?> language = const Value.absent(),
|
|
Value<String?> region = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => VarietyVernacularNamesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
name: name,
|
|
language: language,
|
|
region: region,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$VarietyVernacularNamesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$VarietyVernacularNamesTable,
|
|
VarietyVernacularName,
|
|
$$VarietyVernacularNamesTableFilterComposer,
|
|
$$VarietyVernacularNamesTableOrderingComposer,
|
|
$$VarietyVernacularNamesTableAnnotationComposer,
|
|
$$VarietyVernacularNamesTableCreateCompanionBuilder,
|
|
$$VarietyVernacularNamesTableUpdateCompanionBuilder,
|
|
(
|
|
VarietyVernacularName,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$VarietyVernacularNamesTable,
|
|
VarietyVernacularName
|
|
>,
|
|
),
|
|
VarietyVernacularName,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$SpeciesTableCreateCompanionBuilder =
|
|
SpeciesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String scientificName,
|
|
Value<String?> wikidataQid,
|
|
Value<int?> gbifKey,
|
|
Value<String?> family,
|
|
Value<bool> isBundled,
|
|
Value<int?> viabilityYears,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$SpeciesTableUpdateCompanionBuilder =
|
|
SpeciesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> scientificName,
|
|
Value<String?> wikidataQid,
|
|
Value<int?> gbifKey,
|
|
Value<String?> family,
|
|
Value<bool> isBundled,
|
|
Value<int?> viabilityYears,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$SpeciesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $SpeciesTable> {
|
|
$$SpeciesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scientificName => $composableBuilder(
|
|
column: $table.scientificName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get wikidataQid => $composableBuilder(
|
|
column: $table.wikidataQid,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get gbifKey => $composableBuilder(
|
|
column: $table.gbifKey,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get family => $composableBuilder(
|
|
column: $table.family,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isBundled => $composableBuilder(
|
|
column: $table.isBundled,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get viabilityYears => $composableBuilder(
|
|
column: $table.viabilityYears,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$SpeciesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $SpeciesTable> {
|
|
$$SpeciesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scientificName => $composableBuilder(
|
|
column: $table.scientificName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get wikidataQid => $composableBuilder(
|
|
column: $table.wikidataQid,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get gbifKey => $composableBuilder(
|
|
column: $table.gbifKey,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get family => $composableBuilder(
|
|
column: $table.family,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isBundled => $composableBuilder(
|
|
column: $table.isBundled,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get viabilityYears => $composableBuilder(
|
|
column: $table.viabilityYears,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$SpeciesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $SpeciesTable> {
|
|
$$SpeciesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get scientificName => $composableBuilder(
|
|
column: $table.scientificName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get wikidataQid => $composableBuilder(
|
|
column: $table.wikidataQid,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get gbifKey =>
|
|
$composableBuilder(column: $table.gbifKey, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get family =>
|
|
$composableBuilder(column: $table.family, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isBundled =>
|
|
$composableBuilder(column: $table.isBundled, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get viabilityYears => $composableBuilder(
|
|
column: $table.viabilityYears,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$SpeciesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$SpeciesTable,
|
|
Specy,
|
|
$$SpeciesTableFilterComposer,
|
|
$$SpeciesTableOrderingComposer,
|
|
$$SpeciesTableAnnotationComposer,
|
|
$$SpeciesTableCreateCompanionBuilder,
|
|
$$SpeciesTableUpdateCompanionBuilder,
|
|
(Specy, BaseReferences<_$AppDatabase, $SpeciesTable, Specy>),
|
|
Specy,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$SpeciesTableTableManager(_$AppDatabase db, $SpeciesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$SpeciesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$SpeciesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$SpeciesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> scientificName = const Value.absent(),
|
|
Value<String?> wikidataQid = const Value.absent(),
|
|
Value<int?> gbifKey = const Value.absent(),
|
|
Value<String?> family = const Value.absent(),
|
|
Value<bool> isBundled = const Value.absent(),
|
|
Value<int?> viabilityYears = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SpeciesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
scientificName: scientificName,
|
|
wikidataQid: wikidataQid,
|
|
gbifKey: gbifKey,
|
|
family: family,
|
|
isBundled: isBundled,
|
|
viabilityYears: viabilityYears,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String scientificName,
|
|
Value<String?> wikidataQid = const Value.absent(),
|
|
Value<int?> gbifKey = const Value.absent(),
|
|
Value<String?> family = const Value.absent(),
|
|
Value<bool> isBundled = const Value.absent(),
|
|
Value<int?> viabilityYears = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SpeciesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
scientificName: scientificName,
|
|
wikidataQid: wikidataQid,
|
|
gbifKey: gbifKey,
|
|
family: family,
|
|
isBundled: isBundled,
|
|
viabilityYears: viabilityYears,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$SpeciesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$SpeciesTable,
|
|
Specy,
|
|
$$SpeciesTableFilterComposer,
|
|
$$SpeciesTableOrderingComposer,
|
|
$$SpeciesTableAnnotationComposer,
|
|
$$SpeciesTableCreateCompanionBuilder,
|
|
$$SpeciesTableUpdateCompanionBuilder,
|
|
(Specy, BaseReferences<_$AppDatabase, $SpeciesTable, Specy>),
|
|
Specy,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$SpeciesCommonNamesTableCreateCompanionBuilder =
|
|
SpeciesCommonNamesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String speciesId,
|
|
required String name,
|
|
Value<String?> language,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$SpeciesCommonNamesTableUpdateCompanionBuilder =
|
|
SpeciesCommonNamesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> speciesId,
|
|
Value<String> name,
|
|
Value<String?> language,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$SpeciesCommonNamesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
|
|
$$SpeciesCommonNamesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get speciesId => $composableBuilder(
|
|
column: $table.speciesId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get language => $composableBuilder(
|
|
column: $table.language,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$SpeciesCommonNamesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
|
|
$$SpeciesCommonNamesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get speciesId => $composableBuilder(
|
|
column: $table.speciesId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get language => $composableBuilder(
|
|
column: $table.language,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$SpeciesCommonNamesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
|
|
$$SpeciesCommonNamesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get speciesId =>
|
|
$composableBuilder(column: $table.speciesId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get language =>
|
|
$composableBuilder(column: $table.language, builder: (column) => column);
|
|
}
|
|
|
|
class $$SpeciesCommonNamesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$SpeciesCommonNamesTable,
|
|
SpeciesCommonName,
|
|
$$SpeciesCommonNamesTableFilterComposer,
|
|
$$SpeciesCommonNamesTableOrderingComposer,
|
|
$$SpeciesCommonNamesTableAnnotationComposer,
|
|
$$SpeciesCommonNamesTableCreateCompanionBuilder,
|
|
$$SpeciesCommonNamesTableUpdateCompanionBuilder,
|
|
(
|
|
SpeciesCommonName,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$SpeciesCommonNamesTable,
|
|
SpeciesCommonName
|
|
>,
|
|
),
|
|
SpeciesCommonName,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$SpeciesCommonNamesTableTableManager(
|
|
_$AppDatabase db,
|
|
$SpeciesCommonNamesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$SpeciesCommonNamesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$SpeciesCommonNamesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$SpeciesCommonNamesTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> speciesId = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> language = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SpeciesCommonNamesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
speciesId: speciesId,
|
|
name: name,
|
|
language: language,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String speciesId,
|
|
required String name,
|
|
Value<String?> language = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SpeciesCommonNamesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
speciesId: speciesId,
|
|
name: name,
|
|
language: language,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$SpeciesCommonNamesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$SpeciesCommonNamesTable,
|
|
SpeciesCommonName,
|
|
$$SpeciesCommonNamesTableFilterComposer,
|
|
$$SpeciesCommonNamesTableOrderingComposer,
|
|
$$SpeciesCommonNamesTableAnnotationComposer,
|
|
$$SpeciesCommonNamesTableCreateCompanionBuilder,
|
|
$$SpeciesCommonNamesTableUpdateCompanionBuilder,
|
|
(
|
|
SpeciesCommonName,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$SpeciesCommonNamesTable,
|
|
SpeciesCommonName
|
|
>,
|
|
),
|
|
SpeciesCommonName,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$LotsTableCreateCompanionBuilder =
|
|
LotsCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String varietyId,
|
|
Value<LotType> type,
|
|
Value<int?> harvestYear,
|
|
Value<int?> harvestMonth,
|
|
Value<String?> quantityKind,
|
|
Value<double?> quantityPrecise,
|
|
Value<String?> quantityLabel,
|
|
Value<Presentation?> presentation,
|
|
Value<String?> storageLocation,
|
|
Value<OfferStatus> offerStatus,
|
|
Value<String?> seedbankId,
|
|
Value<String?> originName,
|
|
Value<String?> originPlace,
|
|
Value<Abundance?> abundance,
|
|
Value<PreservationFormat?> preservationFormat,
|
|
Value<double?> priceAmount,
|
|
Value<String?> priceCurrency,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$LotsTableUpdateCompanionBuilder =
|
|
LotsCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> varietyId,
|
|
Value<LotType> type,
|
|
Value<int?> harvestYear,
|
|
Value<int?> harvestMonth,
|
|
Value<String?> quantityKind,
|
|
Value<double?> quantityPrecise,
|
|
Value<String?> quantityLabel,
|
|
Value<Presentation?> presentation,
|
|
Value<String?> storageLocation,
|
|
Value<OfferStatus> offerStatus,
|
|
Value<String?> seedbankId,
|
|
Value<String?> originName,
|
|
Value<String?> originPlace,
|
|
Value<Abundance?> abundance,
|
|
Value<PreservationFormat?> preservationFormat,
|
|
Value<double?> priceAmount,
|
|
Value<String?> priceCurrency,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$LotsTableFilterComposer extends Composer<_$AppDatabase, $LotsTable> {
|
|
$$LotsTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<LotType, LotType, String> get type =>
|
|
$composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get harvestYear => $composableBuilder(
|
|
column: $table.harvestYear,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get harvestMonth => $composableBuilder(
|
|
column: $table.harvestMonth,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<Presentation?, Presentation, String>
|
|
get presentation => $composableBuilder(
|
|
column: $table.presentation,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get storageLocation => $composableBuilder(
|
|
column: $table.storageLocation,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<OfferStatus, OfferStatus, String>
|
|
get offerStatus => $composableBuilder(
|
|
column: $table.offerStatus,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get seedbankId => $composableBuilder(
|
|
column: $table.seedbankId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originName => $composableBuilder(
|
|
column: $table.originName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originPlace => $composableBuilder(
|
|
column: $table.originPlace,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<Abundance?, Abundance, String> get abundance =>
|
|
$composableBuilder(
|
|
column: $table.abundance,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<
|
|
PreservationFormat?,
|
|
PreservationFormat,
|
|
String
|
|
>
|
|
get preservationFormat => $composableBuilder(
|
|
column: $table.preservationFormat,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get priceAmount => $composableBuilder(
|
|
column: $table.priceAmount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get priceCurrency => $composableBuilder(
|
|
column: $table.priceCurrency,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$LotsTableOrderingComposer extends Composer<_$AppDatabase, $LotsTable> {
|
|
$$LotsTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get harvestYear => $composableBuilder(
|
|
column: $table.harvestYear,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get harvestMonth => $composableBuilder(
|
|
column: $table.harvestMonth,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get presentation => $composableBuilder(
|
|
column: $table.presentation,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get storageLocation => $composableBuilder(
|
|
column: $table.storageLocation,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get offerStatus => $composableBuilder(
|
|
column: $table.offerStatus,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get seedbankId => $composableBuilder(
|
|
column: $table.seedbankId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originName => $composableBuilder(
|
|
column: $table.originName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originPlace => $composableBuilder(
|
|
column: $table.originPlace,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get abundance => $composableBuilder(
|
|
column: $table.abundance,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get preservationFormat => $composableBuilder(
|
|
column: $table.preservationFormat,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get priceAmount => $composableBuilder(
|
|
column: $table.priceAmount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get priceCurrency => $composableBuilder(
|
|
column: $table.priceCurrency,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$LotsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $LotsTable> {
|
|
$$LotsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get varietyId =>
|
|
$composableBuilder(column: $table.varietyId, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<LotType, String> get type =>
|
|
$composableBuilder(column: $table.type, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get harvestYear => $composableBuilder(
|
|
column: $table.harvestYear,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get harvestMonth => $composableBuilder(
|
|
column: $table.harvestMonth,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<Presentation?, String> get presentation =>
|
|
$composableBuilder(
|
|
column: $table.presentation,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get storageLocation => $composableBuilder(
|
|
column: $table.storageLocation,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<OfferStatus, String> get offerStatus =>
|
|
$composableBuilder(
|
|
column: $table.offerStatus,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get seedbankId => $composableBuilder(
|
|
column: $table.seedbankId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originName => $composableBuilder(
|
|
column: $table.originName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get originPlace => $composableBuilder(
|
|
column: $table.originPlace,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<Abundance?, String> get abundance =>
|
|
$composableBuilder(column: $table.abundance, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<PreservationFormat?, String>
|
|
get preservationFormat => $composableBuilder(
|
|
column: $table.preservationFormat,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get priceAmount => $composableBuilder(
|
|
column: $table.priceAmount,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get priceCurrency => $composableBuilder(
|
|
column: $table.priceCurrency,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$LotsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$LotsTable,
|
|
Lot,
|
|
$$LotsTableFilterComposer,
|
|
$$LotsTableOrderingComposer,
|
|
$$LotsTableAnnotationComposer,
|
|
$$LotsTableCreateCompanionBuilder,
|
|
$$LotsTableUpdateCompanionBuilder,
|
|
(Lot, BaseReferences<_$AppDatabase, $LotsTable, Lot>),
|
|
Lot,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$LotsTableTableManager(_$AppDatabase db, $LotsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$LotsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$LotsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$LotsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> varietyId = const Value.absent(),
|
|
Value<LotType> type = const Value.absent(),
|
|
Value<int?> harvestYear = const Value.absent(),
|
|
Value<int?> harvestMonth = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<Presentation?> presentation = const Value.absent(),
|
|
Value<String?> storageLocation = const Value.absent(),
|
|
Value<OfferStatus> offerStatus = const Value.absent(),
|
|
Value<String?> seedbankId = const Value.absent(),
|
|
Value<String?> originName = const Value.absent(),
|
|
Value<String?> originPlace = const Value.absent(),
|
|
Value<Abundance?> abundance = const Value.absent(),
|
|
Value<PreservationFormat?> preservationFormat =
|
|
const Value.absent(),
|
|
Value<double?> priceAmount = const Value.absent(),
|
|
Value<String?> priceCurrency = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => LotsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
type: type,
|
|
harvestYear: harvestYear,
|
|
harvestMonth: harvestMonth,
|
|
quantityKind: quantityKind,
|
|
quantityPrecise: quantityPrecise,
|
|
quantityLabel: quantityLabel,
|
|
presentation: presentation,
|
|
storageLocation: storageLocation,
|
|
offerStatus: offerStatus,
|
|
seedbankId: seedbankId,
|
|
originName: originName,
|
|
originPlace: originPlace,
|
|
abundance: abundance,
|
|
preservationFormat: preservationFormat,
|
|
priceAmount: priceAmount,
|
|
priceCurrency: priceCurrency,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String varietyId,
|
|
Value<LotType> type = const Value.absent(),
|
|
Value<int?> harvestYear = const Value.absent(),
|
|
Value<int?> harvestMonth = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<Presentation?> presentation = const Value.absent(),
|
|
Value<String?> storageLocation = const Value.absent(),
|
|
Value<OfferStatus> offerStatus = const Value.absent(),
|
|
Value<String?> seedbankId = const Value.absent(),
|
|
Value<String?> originName = const Value.absent(),
|
|
Value<String?> originPlace = const Value.absent(),
|
|
Value<Abundance?> abundance = const Value.absent(),
|
|
Value<PreservationFormat?> preservationFormat =
|
|
const Value.absent(),
|
|
Value<double?> priceAmount = const Value.absent(),
|
|
Value<String?> priceCurrency = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => LotsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
type: type,
|
|
harvestYear: harvestYear,
|
|
harvestMonth: harvestMonth,
|
|
quantityKind: quantityKind,
|
|
quantityPrecise: quantityPrecise,
|
|
quantityLabel: quantityLabel,
|
|
presentation: presentation,
|
|
storageLocation: storageLocation,
|
|
offerStatus: offerStatus,
|
|
seedbankId: seedbankId,
|
|
originName: originName,
|
|
originPlace: originPlace,
|
|
abundance: abundance,
|
|
preservationFormat: preservationFormat,
|
|
priceAmount: priceAmount,
|
|
priceCurrency: priceCurrency,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$LotsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$LotsTable,
|
|
Lot,
|
|
$$LotsTableFilterComposer,
|
|
$$LotsTableOrderingComposer,
|
|
$$LotsTableAnnotationComposer,
|
|
$$LotsTableCreateCompanionBuilder,
|
|
$$LotsTableUpdateCompanionBuilder,
|
|
(Lot, BaseReferences<_$AppDatabase, $LotsTable, Lot>),
|
|
Lot,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$GerminationTestsTableCreateCompanionBuilder =
|
|
GerminationTestsCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String lotId,
|
|
Value<int?> testedOn,
|
|
Value<int?> sampleSize,
|
|
Value<int?> germinatedCount,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$GerminationTestsTableUpdateCompanionBuilder =
|
|
GerminationTestsCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> lotId,
|
|
Value<int?> testedOn,
|
|
Value<int?> sampleSize,
|
|
Value<int?> germinatedCount,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$GerminationTestsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $GerminationTestsTable> {
|
|
$$GerminationTestsTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get testedOn => $composableBuilder(
|
|
column: $table.testedOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sampleSize => $composableBuilder(
|
|
column: $table.sampleSize,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get germinatedCount => $composableBuilder(
|
|
column: $table.germinatedCount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$GerminationTestsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $GerminationTestsTable> {
|
|
$$GerminationTestsTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get testedOn => $composableBuilder(
|
|
column: $table.testedOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sampleSize => $composableBuilder(
|
|
column: $table.sampleSize,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get germinatedCount => $composableBuilder(
|
|
column: $table.germinatedCount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$GerminationTestsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $GerminationTestsTable> {
|
|
$$GerminationTestsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get lotId =>
|
|
$composableBuilder(column: $table.lotId, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get testedOn =>
|
|
$composableBuilder(column: $table.testedOn, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get sampleSize => $composableBuilder(
|
|
column: $table.sampleSize,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get germinatedCount => $composableBuilder(
|
|
column: $table.germinatedCount,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
}
|
|
|
|
class $$GerminationTestsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$GerminationTestsTable,
|
|
GerminationTest,
|
|
$$GerminationTestsTableFilterComposer,
|
|
$$GerminationTestsTableOrderingComposer,
|
|
$$GerminationTestsTableAnnotationComposer,
|
|
$$GerminationTestsTableCreateCompanionBuilder,
|
|
$$GerminationTestsTableUpdateCompanionBuilder,
|
|
(
|
|
GerminationTest,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$GerminationTestsTable,
|
|
GerminationTest
|
|
>,
|
|
),
|
|
GerminationTest,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$GerminationTestsTableTableManager(
|
|
_$AppDatabase db,
|
|
$GerminationTestsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$GerminationTestsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$GerminationTestsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$GerminationTestsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> lotId = const Value.absent(),
|
|
Value<int?> testedOn = const Value.absent(),
|
|
Value<int?> sampleSize = const Value.absent(),
|
|
Value<int?> germinatedCount = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => GerminationTestsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
testedOn: testedOn,
|
|
sampleSize: sampleSize,
|
|
germinatedCount: germinatedCount,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
Value<int?> testedOn = const Value.absent(),
|
|
Value<int?> sampleSize = const Value.absent(),
|
|
Value<int?> germinatedCount = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => GerminationTestsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
testedOn: testedOn,
|
|
sampleSize: sampleSize,
|
|
germinatedCount: germinatedCount,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$GerminationTestsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$GerminationTestsTable,
|
|
GerminationTest,
|
|
$$GerminationTestsTableFilterComposer,
|
|
$$GerminationTestsTableOrderingComposer,
|
|
$$GerminationTestsTableAnnotationComposer,
|
|
$$GerminationTestsTableCreateCompanionBuilder,
|
|
$$GerminationTestsTableUpdateCompanionBuilder,
|
|
(
|
|
GerminationTest,
|
|
BaseReferences<_$AppDatabase, $GerminationTestsTable, GerminationTest>,
|
|
),
|
|
GerminationTest,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$ConditionChecksTableCreateCompanionBuilder =
|
|
ConditionChecksCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String lotId,
|
|
Value<int?> checkedOn,
|
|
Value<int?> containerCount,
|
|
Value<DesiccantState?> desiccantState,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ConditionChecksTableUpdateCompanionBuilder =
|
|
ConditionChecksCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> lotId,
|
|
Value<int?> checkedOn,
|
|
Value<int?> containerCount,
|
|
Value<DesiccantState?> desiccantState,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ConditionChecksTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ConditionChecksTable> {
|
|
$$ConditionChecksTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get checkedOn => $composableBuilder(
|
|
column: $table.checkedOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get containerCount => $composableBuilder(
|
|
column: $table.containerCount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<DesiccantState?, DesiccantState, String>
|
|
get desiccantState => $composableBuilder(
|
|
column: $table.desiccantState,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ConditionChecksTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ConditionChecksTable> {
|
|
$$ConditionChecksTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get checkedOn => $composableBuilder(
|
|
column: $table.checkedOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get containerCount => $composableBuilder(
|
|
column: $table.containerCount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get desiccantState => $composableBuilder(
|
|
column: $table.desiccantState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ConditionChecksTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ConditionChecksTable> {
|
|
$$ConditionChecksTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get lotId =>
|
|
$composableBuilder(column: $table.lotId, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get checkedOn =>
|
|
$composableBuilder(column: $table.checkedOn, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get containerCount => $composableBuilder(
|
|
column: $table.containerCount,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<DesiccantState?, String>
|
|
get desiccantState => $composableBuilder(
|
|
column: $table.desiccantState,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
}
|
|
|
|
class $$ConditionChecksTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ConditionChecksTable,
|
|
ConditionCheck,
|
|
$$ConditionChecksTableFilterComposer,
|
|
$$ConditionChecksTableOrderingComposer,
|
|
$$ConditionChecksTableAnnotationComposer,
|
|
$$ConditionChecksTableCreateCompanionBuilder,
|
|
$$ConditionChecksTableUpdateCompanionBuilder,
|
|
(
|
|
ConditionCheck,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$ConditionChecksTable,
|
|
ConditionCheck
|
|
>,
|
|
),
|
|
ConditionCheck,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ConditionChecksTableTableManager(
|
|
_$AppDatabase db,
|
|
$ConditionChecksTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ConditionChecksTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ConditionChecksTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ConditionChecksTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> lotId = const Value.absent(),
|
|
Value<int?> checkedOn = const Value.absent(),
|
|
Value<int?> containerCount = const Value.absent(),
|
|
Value<DesiccantState?> desiccantState = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ConditionChecksCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
checkedOn: checkedOn,
|
|
containerCount: containerCount,
|
|
desiccantState: desiccantState,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
Value<int?> checkedOn = const Value.absent(),
|
|
Value<int?> containerCount = const Value.absent(),
|
|
Value<DesiccantState?> desiccantState = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ConditionChecksCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
checkedOn: checkedOn,
|
|
containerCount: containerCount,
|
|
desiccantState: desiccantState,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ConditionChecksTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ConditionChecksTable,
|
|
ConditionCheck,
|
|
$$ConditionChecksTableFilterComposer,
|
|
$$ConditionChecksTableOrderingComposer,
|
|
$$ConditionChecksTableAnnotationComposer,
|
|
$$ConditionChecksTableCreateCompanionBuilder,
|
|
$$ConditionChecksTableUpdateCompanionBuilder,
|
|
(
|
|
ConditionCheck,
|
|
BaseReferences<_$AppDatabase, $ConditionChecksTable, ConditionCheck>,
|
|
),
|
|
ConditionCheck,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$GardenOutcomesTableCreateCompanionBuilder =
|
|
GardenOutcomesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String lotId,
|
|
Value<int?> year,
|
|
Value<GardenOutcomeRating?> rating,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$GardenOutcomesTableUpdateCompanionBuilder =
|
|
GardenOutcomesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> lotId,
|
|
Value<int?> year,
|
|
Value<GardenOutcomeRating?> rating,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$GardenOutcomesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $GardenOutcomesTable> {
|
|
$$GardenOutcomesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get year => $composableBuilder(
|
|
column: $table.year,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<
|
|
GardenOutcomeRating?,
|
|
GardenOutcomeRating,
|
|
String
|
|
>
|
|
get rating => $composableBuilder(
|
|
column: $table.rating,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$GardenOutcomesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $GardenOutcomesTable> {
|
|
$$GardenOutcomesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get year => $composableBuilder(
|
|
column: $table.year,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get rating => $composableBuilder(
|
|
column: $table.rating,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$GardenOutcomesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $GardenOutcomesTable> {
|
|
$$GardenOutcomesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get lotId =>
|
|
$composableBuilder(column: $table.lotId, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get year =>
|
|
$composableBuilder(column: $table.year, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<GardenOutcomeRating?, String> get rating =>
|
|
$composableBuilder(column: $table.rating, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
}
|
|
|
|
class $$GardenOutcomesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$GardenOutcomesTable,
|
|
GardenOutcome,
|
|
$$GardenOutcomesTableFilterComposer,
|
|
$$GardenOutcomesTableOrderingComposer,
|
|
$$GardenOutcomesTableAnnotationComposer,
|
|
$$GardenOutcomesTableCreateCompanionBuilder,
|
|
$$GardenOutcomesTableUpdateCompanionBuilder,
|
|
(
|
|
GardenOutcome,
|
|
BaseReferences<_$AppDatabase, $GardenOutcomesTable, GardenOutcome>,
|
|
),
|
|
GardenOutcome,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$GardenOutcomesTableTableManager(
|
|
_$AppDatabase db,
|
|
$GardenOutcomesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$GardenOutcomesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$GardenOutcomesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$GardenOutcomesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> lotId = const Value.absent(),
|
|
Value<int?> year = const Value.absent(),
|
|
Value<GardenOutcomeRating?> rating = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => GardenOutcomesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
year: year,
|
|
rating: rating,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
Value<int?> year = const Value.absent(),
|
|
Value<GardenOutcomeRating?> rating = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => GardenOutcomesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
year: year,
|
|
rating: rating,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$GardenOutcomesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$GardenOutcomesTable,
|
|
GardenOutcome,
|
|
$$GardenOutcomesTableFilterComposer,
|
|
$$GardenOutcomesTableOrderingComposer,
|
|
$$GardenOutcomesTableAnnotationComposer,
|
|
$$GardenOutcomesTableCreateCompanionBuilder,
|
|
$$GardenOutcomesTableUpdateCompanionBuilder,
|
|
(
|
|
GardenOutcome,
|
|
BaseReferences<_$AppDatabase, $GardenOutcomesTable, GardenOutcome>,
|
|
),
|
|
GardenOutcome,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$MovementsTableCreateCompanionBuilder =
|
|
MovementsCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String lastAuthor,
|
|
Value<int> schemaRowVersion,
|
|
required String lotId,
|
|
required MovementType type,
|
|
Value<int?> occurredOn,
|
|
Value<String?> counterpartyId,
|
|
Value<String?> quantityKind,
|
|
Value<double?> quantityPrecise,
|
|
Value<String?> quantityLabel,
|
|
Value<String?> parentMovementId,
|
|
Value<String?> plantareId,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$MovementsTableUpdateCompanionBuilder =
|
|
MovementsCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> lastAuthor,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> lotId,
|
|
Value<MovementType> type,
|
|
Value<int?> occurredOn,
|
|
Value<String?> counterpartyId,
|
|
Value<String?> quantityKind,
|
|
Value<double?> quantityPrecise,
|
|
Value<String?> quantityLabel,
|
|
Value<String?> parentMovementId,
|
|
Value<String?> plantareId,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$MovementsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MovementsTable> {
|
|
$$MovementsTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<MovementType, MovementType, String> get type =>
|
|
$composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get occurredOn => $composableBuilder(
|
|
column: $table.occurredOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get counterpartyId => $composableBuilder(
|
|
column: $table.counterpartyId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get parentMovementId => $composableBuilder(
|
|
column: $table.parentMovementId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get plantareId => $composableBuilder(
|
|
column: $table.plantareId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$MovementsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MovementsTable> {
|
|
$$MovementsTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lotId => $composableBuilder(
|
|
column: $table.lotId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get occurredOn => $composableBuilder(
|
|
column: $table.occurredOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get counterpartyId => $composableBuilder(
|
|
column: $table.counterpartyId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get parentMovementId => $composableBuilder(
|
|
column: $table.parentMovementId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get plantareId => $composableBuilder(
|
|
column: $table.plantareId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$MovementsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MovementsTable> {
|
|
$$MovementsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get lotId =>
|
|
$composableBuilder(column: $table.lotId, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<MovementType, String> get type =>
|
|
$composableBuilder(column: $table.type, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get occurredOn => $composableBuilder(
|
|
column: $table.occurredOn,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get counterpartyId => $composableBuilder(
|
|
column: $table.counterpartyId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get quantityKind => $composableBuilder(
|
|
column: $table.quantityKind,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get quantityPrecise => $composableBuilder(
|
|
column: $table.quantityPrecise,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get quantityLabel => $composableBuilder(
|
|
column: $table.quantityLabel,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get parentMovementId => $composableBuilder(
|
|
column: $table.parentMovementId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get plantareId => $composableBuilder(
|
|
column: $table.plantareId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
}
|
|
|
|
class $$MovementsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$MovementsTable,
|
|
Movement,
|
|
$$MovementsTableFilterComposer,
|
|
$$MovementsTableOrderingComposer,
|
|
$$MovementsTableAnnotationComposer,
|
|
$$MovementsTableCreateCompanionBuilder,
|
|
$$MovementsTableUpdateCompanionBuilder,
|
|
(Movement, BaseReferences<_$AppDatabase, $MovementsTable, Movement>),
|
|
Movement,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$MovementsTableTableManager(_$AppDatabase db, $MovementsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MovementsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MovementsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MovementsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> lotId = const Value.absent(),
|
|
Value<MovementType> type = const Value.absent(),
|
|
Value<int?> occurredOn = const Value.absent(),
|
|
Value<String?> counterpartyId = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<String?> parentMovementId = const Value.absent(),
|
|
Value<String?> plantareId = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MovementsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
lastAuthor: lastAuthor,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
type: type,
|
|
occurredOn: occurredOn,
|
|
counterpartyId: counterpartyId,
|
|
quantityKind: quantityKind,
|
|
quantityPrecise: quantityPrecise,
|
|
quantityLabel: quantityLabel,
|
|
parentMovementId: parentMovementId,
|
|
plantareId: plantareId,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String lastAuthor,
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String lotId,
|
|
required MovementType type,
|
|
Value<int?> occurredOn = const Value.absent(),
|
|
Value<String?> counterpartyId = const Value.absent(),
|
|
Value<String?> quantityKind = const Value.absent(),
|
|
Value<double?> quantityPrecise = const Value.absent(),
|
|
Value<String?> quantityLabel = const Value.absent(),
|
|
Value<String?> parentMovementId = const Value.absent(),
|
|
Value<String?> plantareId = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MovementsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
lastAuthor: lastAuthor,
|
|
schemaRowVersion: schemaRowVersion,
|
|
lotId: lotId,
|
|
type: type,
|
|
occurredOn: occurredOn,
|
|
counterpartyId: counterpartyId,
|
|
quantityKind: quantityKind,
|
|
quantityPrecise: quantityPrecise,
|
|
quantityLabel: quantityLabel,
|
|
parentMovementId: parentMovementId,
|
|
plantareId: plantareId,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$MovementsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MovementsTable,
|
|
Movement,
|
|
$$MovementsTableFilterComposer,
|
|
$$MovementsTableOrderingComposer,
|
|
$$MovementsTableAnnotationComposer,
|
|
$$MovementsTableCreateCompanionBuilder,
|
|
$$MovementsTableUpdateCompanionBuilder,
|
|
(Movement, BaseReferences<_$AppDatabase, $MovementsTable, Movement>),
|
|
Movement,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$PartiesTableCreateCompanionBuilder =
|
|
PartiesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required String displayName,
|
|
Value<String?> publicKey,
|
|
Value<PartyKind> kind,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PartiesTableUpdateCompanionBuilder =
|
|
PartiesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String> displayName,
|
|
Value<String?> publicKey,
|
|
Value<PartyKind> kind,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$PartiesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $PartiesTable> {
|
|
$$PartiesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get publicKey => $composableBuilder(
|
|
column: $table.publicKey,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<PartyKind, PartyKind, String> get kind =>
|
|
$composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$PartiesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $PartiesTable> {
|
|
$$PartiesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get publicKey => $composableBuilder(
|
|
column: $table.publicKey,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$PartiesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $PartiesTable> {
|
|
$$PartiesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get publicKey =>
|
|
$composableBuilder(column: $table.publicKey, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<PartyKind, String> get kind =>
|
|
$composableBuilder(column: $table.kind, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
}
|
|
|
|
class $$PartiesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$PartiesTable,
|
|
Party,
|
|
$$PartiesTableFilterComposer,
|
|
$$PartiesTableOrderingComposer,
|
|
$$PartiesTableAnnotationComposer,
|
|
$$PartiesTableCreateCompanionBuilder,
|
|
$$PartiesTableUpdateCompanionBuilder,
|
|
(Party, BaseReferences<_$AppDatabase, $PartiesTable, Party>),
|
|
Party,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$PartiesTableTableManager(_$AppDatabase db, $PartiesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PartiesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PartiesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PartiesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String> displayName = const Value.absent(),
|
|
Value<String?> publicKey = const Value.absent(),
|
|
Value<PartyKind> kind = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PartiesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
displayName: displayName,
|
|
publicKey: publicKey,
|
|
kind: kind,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required String displayName,
|
|
Value<String?> publicKey = const Value.absent(),
|
|
Value<PartyKind> kind = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PartiesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
displayName: displayName,
|
|
publicKey: publicKey,
|
|
kind: kind,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PartiesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$PartiesTable,
|
|
Party,
|
|
$$PartiesTableFilterComposer,
|
|
$$PartiesTableOrderingComposer,
|
|
$$PartiesTableAnnotationComposer,
|
|
$$PartiesTableCreateCompanionBuilder,
|
|
$$PartiesTableUpdateCompanionBuilder,
|
|
(Party, BaseReferences<_$AppDatabase, $PartiesTable, Party>),
|
|
Party,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$AttachmentsTableCreateCompanionBuilder =
|
|
AttachmentsCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required AttachmentKind kind,
|
|
Value<String?> uri,
|
|
Value<Uint8List?> bytes,
|
|
Value<Uint8List?> thumbnail,
|
|
Value<String?> mimeType,
|
|
Value<int> sortOrder,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$AttachmentsTableUpdateCompanionBuilder =
|
|
AttachmentsCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<ParentType> parentType,
|
|
Value<String> parentId,
|
|
Value<AttachmentKind> kind,
|
|
Value<String?> uri,
|
|
Value<Uint8List?> bytes,
|
|
Value<Uint8List?> thumbnail,
|
|
Value<String?> mimeType,
|
|
Value<int> sortOrder,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$AttachmentsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $AttachmentsTable> {
|
|
$$AttachmentsTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<ParentType, ParentType, String>
|
|
get parentType => $composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get parentId => $composableBuilder(
|
|
column: $table.parentId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<AttachmentKind, AttachmentKind, String>
|
|
get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get uri => $composableBuilder(
|
|
column: $table.uri,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<Uint8List> get bytes => $composableBuilder(
|
|
column: $table.bytes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<Uint8List> get thumbnail => $composableBuilder(
|
|
column: $table.thumbnail,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get mimeType => $composableBuilder(
|
|
column: $table.mimeType,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sortOrder => $composableBuilder(
|
|
column: $table.sortOrder,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$AttachmentsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $AttachmentsTable> {
|
|
$$AttachmentsTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get parentType => $composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get parentId => $composableBuilder(
|
|
column: $table.parentId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get uri => $composableBuilder(
|
|
column: $table.uri,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<Uint8List> get bytes => $composableBuilder(
|
|
column: $table.bytes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<Uint8List> get thumbnail => $composableBuilder(
|
|
column: $table.thumbnail,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get mimeType => $composableBuilder(
|
|
column: $table.mimeType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sortOrder => $composableBuilder(
|
|
column: $table.sortOrder,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$AttachmentsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $AttachmentsTable> {
|
|
$$AttachmentsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<ParentType, String> get parentType =>
|
|
$composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get parentId =>
|
|
$composableBuilder(column: $table.parentId, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<AttachmentKind, String> get kind =>
|
|
$composableBuilder(column: $table.kind, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get uri =>
|
|
$composableBuilder(column: $table.uri, builder: (column) => column);
|
|
|
|
GeneratedColumn<Uint8List> get bytes =>
|
|
$composableBuilder(column: $table.bytes, builder: (column) => column);
|
|
|
|
GeneratedColumn<Uint8List> get thumbnail =>
|
|
$composableBuilder(column: $table.thumbnail, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get mimeType =>
|
|
$composableBuilder(column: $table.mimeType, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get sortOrder =>
|
|
$composableBuilder(column: $table.sortOrder, builder: (column) => column);
|
|
}
|
|
|
|
class $$AttachmentsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$AttachmentsTable,
|
|
Attachment,
|
|
$$AttachmentsTableFilterComposer,
|
|
$$AttachmentsTableOrderingComposer,
|
|
$$AttachmentsTableAnnotationComposer,
|
|
$$AttachmentsTableCreateCompanionBuilder,
|
|
$$AttachmentsTableUpdateCompanionBuilder,
|
|
(
|
|
Attachment,
|
|
BaseReferences<_$AppDatabase, $AttachmentsTable, Attachment>,
|
|
),
|
|
Attachment,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$AttachmentsTableTableManager(_$AppDatabase db, $AttachmentsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$AttachmentsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$AttachmentsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$AttachmentsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<ParentType> parentType = const Value.absent(),
|
|
Value<String> parentId = const Value.absent(),
|
|
Value<AttachmentKind> kind = const Value.absent(),
|
|
Value<String?> uri = const Value.absent(),
|
|
Value<Uint8List?> bytes = const Value.absent(),
|
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
|
Value<String?> mimeType = const Value.absent(),
|
|
Value<int> sortOrder = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AttachmentsCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
parentType: parentType,
|
|
parentId: parentId,
|
|
kind: kind,
|
|
uri: uri,
|
|
bytes: bytes,
|
|
thumbnail: thumbnail,
|
|
mimeType: mimeType,
|
|
sortOrder: sortOrder,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required AttachmentKind kind,
|
|
Value<String?> uri = const Value.absent(),
|
|
Value<Uint8List?> bytes = const Value.absent(),
|
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
|
Value<String?> mimeType = const Value.absent(),
|
|
Value<int> sortOrder = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AttachmentsCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
parentType: parentType,
|
|
parentId: parentId,
|
|
kind: kind,
|
|
uri: uri,
|
|
bytes: bytes,
|
|
thumbnail: thumbnail,
|
|
mimeType: mimeType,
|
|
sortOrder: sortOrder,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$AttachmentsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$AttachmentsTable,
|
|
Attachment,
|
|
$$AttachmentsTableFilterComposer,
|
|
$$AttachmentsTableOrderingComposer,
|
|
$$AttachmentsTableAnnotationComposer,
|
|
$$AttachmentsTableCreateCompanionBuilder,
|
|
$$AttachmentsTableUpdateCompanionBuilder,
|
|
(
|
|
Attachment,
|
|
BaseReferences<_$AppDatabase, $AttachmentsTable, Attachment>,
|
|
),
|
|
Attachment,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$ExternalLinksTableCreateCompanionBuilder =
|
|
ExternalLinksCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required String url,
|
|
Value<String?> title,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ExternalLinksTableUpdateCompanionBuilder =
|
|
ExternalLinksCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<ParentType> parentType,
|
|
Value<String> parentId,
|
|
Value<String> url,
|
|
Value<String?> title,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ExternalLinksTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ExternalLinksTable> {
|
|
$$ExternalLinksTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<ParentType, ParentType, String>
|
|
get parentType => $composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get parentId => $composableBuilder(
|
|
column: $table.parentId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get url => $composableBuilder(
|
|
column: $table.url,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ExternalLinksTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ExternalLinksTable> {
|
|
$$ExternalLinksTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get parentType => $composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get parentId => $composableBuilder(
|
|
column: $table.parentId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get url => $composableBuilder(
|
|
column: $table.url,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ExternalLinksTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ExternalLinksTable> {
|
|
$$ExternalLinksTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<ParentType, String> get parentType =>
|
|
$composableBuilder(
|
|
column: $table.parentType,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get parentId =>
|
|
$composableBuilder(column: $table.parentId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get url =>
|
|
$composableBuilder(column: $table.url, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
}
|
|
|
|
class $$ExternalLinksTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ExternalLinksTable,
|
|
ExternalLink,
|
|
$$ExternalLinksTableFilterComposer,
|
|
$$ExternalLinksTableOrderingComposer,
|
|
$$ExternalLinksTableAnnotationComposer,
|
|
$$ExternalLinksTableCreateCompanionBuilder,
|
|
$$ExternalLinksTableUpdateCompanionBuilder,
|
|
(
|
|
ExternalLink,
|
|
BaseReferences<_$AppDatabase, $ExternalLinksTable, ExternalLink>,
|
|
),
|
|
ExternalLink,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ExternalLinksTableTableManager(_$AppDatabase db, $ExternalLinksTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ExternalLinksTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ExternalLinksTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ExternalLinksTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<ParentType> parentType = const Value.absent(),
|
|
Value<String> parentId = const Value.absent(),
|
|
Value<String> url = const Value.absent(),
|
|
Value<String?> title = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExternalLinksCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
parentType: parentType,
|
|
parentId: parentId,
|
|
url: url,
|
|
title: title,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
required ParentType parentType,
|
|
required String parentId,
|
|
required String url,
|
|
Value<String?> title = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExternalLinksCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
parentType: parentType,
|
|
parentId: parentId,
|
|
url: url,
|
|
title: title,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ExternalLinksTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ExternalLinksTable,
|
|
ExternalLink,
|
|
$$ExternalLinksTableFilterComposer,
|
|
$$ExternalLinksTableOrderingComposer,
|
|
$$ExternalLinksTableAnnotationComposer,
|
|
$$ExternalLinksTableCreateCompanionBuilder,
|
|
$$ExternalLinksTableUpdateCompanionBuilder,
|
|
(
|
|
ExternalLink,
|
|
BaseReferences<_$AppDatabase, $ExternalLinksTable, ExternalLink>,
|
|
),
|
|
ExternalLink,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$PlantaresTableCreateCompanionBuilder =
|
|
PlantaresCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String?> varietyId,
|
|
required PlantareDirection direction,
|
|
Value<String?> counterparty,
|
|
Value<String?> owedDescription,
|
|
required int madeOn,
|
|
Value<int?> dueBy,
|
|
Value<PlantareStatus> status,
|
|
Value<int?> settledOn,
|
|
Value<String?> note,
|
|
Value<String?> pledgeId,
|
|
Value<String?> debtorKey,
|
|
Value<String?> creditorKey,
|
|
Value<String?> debtorSignature,
|
|
Value<String?> creditorSignature,
|
|
Value<String?> movementId,
|
|
Value<PlantareRemoteState?> remoteState,
|
|
Value<PlantareReturnKind> returnKind,
|
|
Value<double?> workHours,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PlantaresTableUpdateCompanionBuilder =
|
|
PlantaresCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String?> varietyId,
|
|
Value<PlantareDirection> direction,
|
|
Value<String?> counterparty,
|
|
Value<String?> owedDescription,
|
|
Value<int> madeOn,
|
|
Value<int?> dueBy,
|
|
Value<PlantareStatus> status,
|
|
Value<int?> settledOn,
|
|
Value<String?> note,
|
|
Value<String?> pledgeId,
|
|
Value<String?> debtorKey,
|
|
Value<String?> creditorKey,
|
|
Value<String?> debtorSignature,
|
|
Value<String?> creditorSignature,
|
|
Value<String?> movementId,
|
|
Value<PlantareRemoteState?> remoteState,
|
|
Value<PlantareReturnKind> returnKind,
|
|
Value<double?> workHours,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$PlantaresTableFilterComposer
|
|
extends Composer<_$AppDatabase, $PlantaresTable> {
|
|
$$PlantaresTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<PlantareDirection, PlantareDirection, String>
|
|
get direction => $composableBuilder(
|
|
column: $table.direction,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get owedDescription => $composableBuilder(
|
|
column: $table.owedDescription,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get madeOn => $composableBuilder(
|
|
column: $table.madeOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get dueBy => $composableBuilder(
|
|
column: $table.dueBy,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<PlantareStatus, PlantareStatus, String>
|
|
get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get settledOn => $composableBuilder(
|
|
column: $table.settledOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get pledgeId => $composableBuilder(
|
|
column: $table.pledgeId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get debtorKey => $composableBuilder(
|
|
column: $table.debtorKey,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get creditorKey => $composableBuilder(
|
|
column: $table.creditorKey,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get debtorSignature => $composableBuilder(
|
|
column: $table.debtorSignature,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get creditorSignature => $composableBuilder(
|
|
column: $table.creditorSignature,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get movementId => $composableBuilder(
|
|
column: $table.movementId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<
|
|
PlantareRemoteState?,
|
|
PlantareRemoteState,
|
|
String
|
|
>
|
|
get remoteState => $composableBuilder(
|
|
column: $table.remoteState,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<PlantareReturnKind, PlantareReturnKind, String>
|
|
get returnKind => $composableBuilder(
|
|
column: $table.returnKind,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get workHours => $composableBuilder(
|
|
column: $table.workHours,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$PlantaresTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $PlantaresTable> {
|
|
$$PlantaresTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get direction => $composableBuilder(
|
|
column: $table.direction,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get owedDescription => $composableBuilder(
|
|
column: $table.owedDescription,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get madeOn => $composableBuilder(
|
|
column: $table.madeOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get dueBy => $composableBuilder(
|
|
column: $table.dueBy,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get settledOn => $composableBuilder(
|
|
column: $table.settledOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get pledgeId => $composableBuilder(
|
|
column: $table.pledgeId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get debtorKey => $composableBuilder(
|
|
column: $table.debtorKey,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get creditorKey => $composableBuilder(
|
|
column: $table.creditorKey,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get debtorSignature => $composableBuilder(
|
|
column: $table.debtorSignature,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get creditorSignature => $composableBuilder(
|
|
column: $table.creditorSignature,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get movementId => $composableBuilder(
|
|
column: $table.movementId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get remoteState => $composableBuilder(
|
|
column: $table.remoteState,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get returnKind => $composableBuilder(
|
|
column: $table.returnKind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get workHours => $composableBuilder(
|
|
column: $table.workHours,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$PlantaresTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $PlantaresTable> {
|
|
$$PlantaresTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get varietyId =>
|
|
$composableBuilder(column: $table.varietyId, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<PlantareDirection, String> get direction =>
|
|
$composableBuilder(column: $table.direction, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get owedDescription => $composableBuilder(
|
|
column: $table.owedDescription,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get madeOn =>
|
|
$composableBuilder(column: $table.madeOn, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get dueBy =>
|
|
$composableBuilder(column: $table.dueBy, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<PlantareStatus, String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get settledOn =>
|
|
$composableBuilder(column: $table.settledOn, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get pledgeId =>
|
|
$composableBuilder(column: $table.pledgeId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get debtorKey =>
|
|
$composableBuilder(column: $table.debtorKey, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get creditorKey => $composableBuilder(
|
|
column: $table.creditorKey,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get debtorSignature => $composableBuilder(
|
|
column: $table.debtorSignature,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get creditorSignature => $composableBuilder(
|
|
column: $table.creditorSignature,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get movementId => $composableBuilder(
|
|
column: $table.movementId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<PlantareRemoteState?, String>
|
|
get remoteState => $composableBuilder(
|
|
column: $table.remoteState,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumnWithTypeConverter<PlantareReturnKind, String> get returnKind =>
|
|
$composableBuilder(
|
|
column: $table.returnKind,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get workHours =>
|
|
$composableBuilder(column: $table.workHours, builder: (column) => column);
|
|
}
|
|
|
|
class $$PlantaresTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$PlantaresTable,
|
|
Plantare,
|
|
$$PlantaresTableFilterComposer,
|
|
$$PlantaresTableOrderingComposer,
|
|
$$PlantaresTableAnnotationComposer,
|
|
$$PlantaresTableCreateCompanionBuilder,
|
|
$$PlantaresTableUpdateCompanionBuilder,
|
|
(Plantare, BaseReferences<_$AppDatabase, $PlantaresTable, Plantare>),
|
|
Plantare,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$PlantaresTableTableManager(_$AppDatabase db, $PlantaresTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PlantaresTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PlantaresTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PlantaresTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String?> varietyId = const Value.absent(),
|
|
Value<PlantareDirection> direction = const Value.absent(),
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<String?> owedDescription = const Value.absent(),
|
|
Value<int> madeOn = const Value.absent(),
|
|
Value<int?> dueBy = const Value.absent(),
|
|
Value<PlantareStatus> status = const Value.absent(),
|
|
Value<int?> settledOn = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> pledgeId = const Value.absent(),
|
|
Value<String?> debtorKey = const Value.absent(),
|
|
Value<String?> creditorKey = const Value.absent(),
|
|
Value<String?> debtorSignature = const Value.absent(),
|
|
Value<String?> creditorSignature = const Value.absent(),
|
|
Value<String?> movementId = const Value.absent(),
|
|
Value<PlantareRemoteState?> remoteState = const Value.absent(),
|
|
Value<PlantareReturnKind> returnKind = const Value.absent(),
|
|
Value<double?> workHours = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlantaresCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
direction: direction,
|
|
counterparty: counterparty,
|
|
owedDescription: owedDescription,
|
|
madeOn: madeOn,
|
|
dueBy: dueBy,
|
|
status: status,
|
|
settledOn: settledOn,
|
|
note: note,
|
|
pledgeId: pledgeId,
|
|
debtorKey: debtorKey,
|
|
creditorKey: creditorKey,
|
|
debtorSignature: debtorSignature,
|
|
creditorSignature: creditorSignature,
|
|
movementId: movementId,
|
|
remoteState: remoteState,
|
|
returnKind: returnKind,
|
|
workHours: workHours,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String?> varietyId = const Value.absent(),
|
|
required PlantareDirection direction,
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<String?> owedDescription = const Value.absent(),
|
|
required int madeOn,
|
|
Value<int?> dueBy = const Value.absent(),
|
|
Value<PlantareStatus> status = const Value.absent(),
|
|
Value<int?> settledOn = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> pledgeId = const Value.absent(),
|
|
Value<String?> debtorKey = const Value.absent(),
|
|
Value<String?> creditorKey = const Value.absent(),
|
|
Value<String?> debtorSignature = const Value.absent(),
|
|
Value<String?> creditorSignature = const Value.absent(),
|
|
Value<String?> movementId = const Value.absent(),
|
|
Value<PlantareRemoteState?> remoteState = const Value.absent(),
|
|
Value<PlantareReturnKind> returnKind = const Value.absent(),
|
|
Value<double?> workHours = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlantaresCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
direction: direction,
|
|
counterparty: counterparty,
|
|
owedDescription: owedDescription,
|
|
madeOn: madeOn,
|
|
dueBy: dueBy,
|
|
status: status,
|
|
settledOn: settledOn,
|
|
note: note,
|
|
pledgeId: pledgeId,
|
|
debtorKey: debtorKey,
|
|
creditorKey: creditorKey,
|
|
debtorSignature: debtorSignature,
|
|
creditorSignature: creditorSignature,
|
|
movementId: movementId,
|
|
remoteState: remoteState,
|
|
returnKind: returnKind,
|
|
workHours: workHours,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PlantaresTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$PlantaresTable,
|
|
Plantare,
|
|
$$PlantaresTableFilterComposer,
|
|
$$PlantaresTableOrderingComposer,
|
|
$$PlantaresTableAnnotationComposer,
|
|
$$PlantaresTableCreateCompanionBuilder,
|
|
$$PlantaresTableUpdateCompanionBuilder,
|
|
(Plantare, BaseReferences<_$AppDatabase, $PlantaresTable, Plantare>),
|
|
Plantare,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$SalesTableCreateCompanionBuilder =
|
|
SalesCompanion Function({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String?> varietyId,
|
|
required SaleDirection direction,
|
|
Value<String?> counterparty,
|
|
Value<double?> amount,
|
|
Value<String?> currency,
|
|
required int soldOn,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$SalesTableUpdateCompanionBuilder =
|
|
SalesCompanion Function({
|
|
Value<String> id,
|
|
Value<int> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<String> lastAuthor,
|
|
Value<bool> isDeleted,
|
|
Value<int> schemaRowVersion,
|
|
Value<String?> varietyId,
|
|
Value<SaleDirection> direction,
|
|
Value<String?> counterparty,
|
|
Value<double?> amount,
|
|
Value<String?> currency,
|
|
Value<int> soldOn,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$SalesTableFilterComposer extends Composer<_$AppDatabase, $SalesTable> {
|
|
$$SalesTableFilterComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnWithTypeConverterFilters<SaleDirection, SaleDirection, String>
|
|
get direction => $composableBuilder(
|
|
column: $table.direction,
|
|
builder: (column) => ColumnWithTypeConverterFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get amount => $composableBuilder(
|
|
column: $table.amount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get currency => $composableBuilder(
|
|
column: $table.currency,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get soldOn => $composableBuilder(
|
|
column: $table.soldOn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$SalesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $SalesTable> {
|
|
$$SalesTableOrderingComposer({
|
|
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<int> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get varietyId => $composableBuilder(
|
|
column: $table.varietyId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get direction => $composableBuilder(
|
|
column: $table.direction,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get amount => $composableBuilder(
|
|
column: $table.amount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get currency => $composableBuilder(
|
|
column: $table.currency,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get soldOn => $composableBuilder(
|
|
column: $table.soldOn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$SalesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $SalesTable> {
|
|
$$SalesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get lastAuthor => $composableBuilder(
|
|
column: $table.lastAuthor,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
|
|
column: $table.schemaRowVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get varietyId =>
|
|
$composableBuilder(column: $table.varietyId, builder: (column) => column);
|
|
|
|
GeneratedColumnWithTypeConverter<SaleDirection, String> get direction =>
|
|
$composableBuilder(column: $table.direction, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get counterparty => $composableBuilder(
|
|
column: $table.counterparty,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get amount =>
|
|
$composableBuilder(column: $table.amount, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get currency =>
|
|
$composableBuilder(column: $table.currency, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get soldOn =>
|
|
$composableBuilder(column: $table.soldOn, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
}
|
|
|
|
class $$SalesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$SalesTable,
|
|
Sale,
|
|
$$SalesTableFilterComposer,
|
|
$$SalesTableOrderingComposer,
|
|
$$SalesTableAnnotationComposer,
|
|
$$SalesTableCreateCompanionBuilder,
|
|
$$SalesTableUpdateCompanionBuilder,
|
|
(Sale, BaseReferences<_$AppDatabase, $SalesTable, Sale>),
|
|
Sale,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$SalesTableTableManager(_$AppDatabase db, $SalesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$SalesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$SalesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$SalesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<int> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<String> lastAuthor = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String?> varietyId = const Value.absent(),
|
|
Value<SaleDirection> direction = const Value.absent(),
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<double?> amount = const Value.absent(),
|
|
Value<String?> currency = const Value.absent(),
|
|
Value<int> soldOn = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SalesCompanion(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
direction: direction,
|
|
counterparty: counterparty,
|
|
amount: amount,
|
|
currency: currency,
|
|
soldOn: soldOn,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required int createdAt,
|
|
required String updatedAt,
|
|
required String lastAuthor,
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int> schemaRowVersion = const Value.absent(),
|
|
Value<String?> varietyId = const Value.absent(),
|
|
required SaleDirection direction,
|
|
Value<String?> counterparty = const Value.absent(),
|
|
Value<double?> amount = const Value.absent(),
|
|
Value<String?> currency = const Value.absent(),
|
|
required int soldOn,
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SalesCompanion.insert(
|
|
id: id,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
lastAuthor: lastAuthor,
|
|
isDeleted: isDeleted,
|
|
schemaRowVersion: schemaRowVersion,
|
|
varietyId: varietyId,
|
|
direction: direction,
|
|
counterparty: counterparty,
|
|
amount: amount,
|
|
currency: currency,
|
|
soldOn: soldOn,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$SalesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$SalesTable,
|
|
Sale,
|
|
$$SalesTableFilterComposer,
|
|
$$SalesTableOrderingComposer,
|
|
$$SalesTableAnnotationComposer,
|
|
$$SalesTableCreateCompanionBuilder,
|
|
$$SalesTableUpdateCompanionBuilder,
|
|
(Sale, BaseReferences<_$AppDatabase, $SalesTable, Sale>),
|
|
Sale,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$VarietiesTableTableManager get varieties =>
|
|
$$VarietiesTableTableManager(_db, _db.varieties);
|
|
$$VarietyVernacularNamesTableTableManager get varietyVernacularNames =>
|
|
$$VarietyVernacularNamesTableTableManager(
|
|
_db,
|
|
_db.varietyVernacularNames,
|
|
);
|
|
$$SpeciesTableTableManager get species =>
|
|
$$SpeciesTableTableManager(_db, _db.species);
|
|
$$SpeciesCommonNamesTableTableManager get speciesCommonNames =>
|
|
$$SpeciesCommonNamesTableTableManager(_db, _db.speciesCommonNames);
|
|
$$LotsTableTableManager get lots => $$LotsTableTableManager(_db, _db.lots);
|
|
$$GerminationTestsTableTableManager get germinationTests =>
|
|
$$GerminationTestsTableTableManager(_db, _db.germinationTests);
|
|
$$ConditionChecksTableTableManager get conditionChecks =>
|
|
$$ConditionChecksTableTableManager(_db, _db.conditionChecks);
|
|
$$GardenOutcomesTableTableManager get gardenOutcomes =>
|
|
$$GardenOutcomesTableTableManager(_db, _db.gardenOutcomes);
|
|
$$MovementsTableTableManager get movements =>
|
|
$$MovementsTableTableManager(_db, _db.movements);
|
|
$$PartiesTableTableManager get parties =>
|
|
$$PartiesTableTableManager(_db, _db.parties);
|
|
$$AttachmentsTableTableManager get attachments =>
|
|
$$AttachmentsTableTableManager(_db, _db.attachments);
|
|
$$ExternalLinksTableTableManager get externalLinks =>
|
|
$$ExternalLinksTableTableManager(_db, _db.externalLinks);
|
|
$$PlantaresTableTableManager get plantares =>
|
|
$$PlantaresTableTableManager(_db, _db.plantares);
|
|
$$SalesTableTableManager get sales =>
|
|
$$SalesTableTableManager(_db, _db.sales);
|
|
}
|