tane/apps/app_seeds/test/db/schema/schema_v1.dart
vjrj 040f15a898 feat(block1): inventory walking skeleton + first quick-add slice
Stand up the Tanemaki monorepo and the first end-to-end vertical slice of
Block 1 (offline, encrypted inventory): add a seed → see it in a categorized,
searchable list → it persists → reopen and it's still there.

Architecture (state management like G1nkgo, adapted to Tane's reality):
- flutter_bloc (Cubit-first), but the encrypted Drift DB is the single source
  of truth; cubits stream from repositories (no hydrated_bloc/Hive, which would
  write plaintext at rest).
- get_it composition root; go_router; slang i18n (ES/EN, Weblate-friendly JSON).

Workspace & core:
- pub workspace: packages/commons_core (pure Dart) + apps/app_seeds (Flutter).
- commons_core primitives: UUIDv7 IdGen, Hybrid Logical Clock, Quantity value
  type (+ plant-aware QuantityKind), IdentityService root-seed stub.

Data & security:
- Drift schemaVersion=1 with all 10 Block-1 tables + common CRDT columns
  (HLC updated_at, last_author, tombstones); Movement append-only.
- SQLCipher via an injectable executor that refuses to open a plaintext DB;
  DB key + root seed in the OS keystore (separate secrets).
- Exported drift_schema_v1.json + migration scaffold.

Tests (near-TDD; nothing merges without tests):
- commons_core units (24), Drift migration test, "no plaintext at rest"
  security guard (runs where SQLCipher is present, skips otherwise),
  repository, widget, full quick-add flow, file-reopen persistence, and a
  no-hardcoded-strings i18n guard. GitLab CI: format + analyze + test + coverage.

Follow-on Block-1 stories (item detail/edit, species catalog, germination UI)
and all of Block 2 remain out of scope.
2026-07-07 15:16:14 +02:00

1380 lines
37 KiB
Dart

// dart format width=80
import 'dart:typed_data' as i2;
// GENERATED BY drift_dev, DO NOT MODIFY.
// ignore_for_file: type=lint,unused_import
//
import 'package:drift/drift.dart';
class Varieties extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Varieties(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> label = GeneratedColumn<String>(
'label',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
'species_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> cultivarName = GeneratedColumn<String>(
'cultivar_name',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> category = GeneratedColumn<String>(
'category',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
label,
speciesId,
cultivarName,
category,
notes,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'varieties';
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Varieties createAlias(String alias) {
return Varieties(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class VarietyVernacularNames extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
VarietyVernacularNames(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
'variety_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> name = GeneratedColumn<String>(
'name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> language = GeneratedColumn<String>(
'language',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> region = GeneratedColumn<String>(
'region',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
VarietyVernacularNames createAlias(String alias) {
return VarietyVernacularNames(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class Species extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Species(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> scientificName = GeneratedColumn<String>(
'scientific_name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> wikidataQid = GeneratedColumn<String>(
'wikidata_qid',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<int> gbifKey = GeneratedColumn<int>(
'gbif_key',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> family = GeneratedColumn<String>(
'family',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<int> isBundled = GeneratedColumn<int>(
'is_bundled',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_bundled IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
scientificName,
wikidataQid,
gbifKey,
family,
isBundled,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'species';
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Species createAlias(String alias) {
return Species(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class SpeciesCommonNames extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
SpeciesCommonNames(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
'species_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> name = GeneratedColumn<String>(
'name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> language = GeneratedColumn<String>(
'language',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
SpeciesCommonNames createAlias(String alias) {
return SpeciesCommonNames(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class Lots extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Lots(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
'variety_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> harvestYear = GeneratedColumn<int>(
'harvest_year',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
'quantity_kind',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
'quantity_precise',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
'quantity_label',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> storageLocation = GeneratedColumn<String>(
'storage_location',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> offerStatus = GeneratedColumn<String>(
'offer_status',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT \'private\'',
defaultValue: const CustomExpression('\'private\''),
);
late final GeneratedColumn<String> seedbankId = GeneratedColumn<String>(
'seedbank_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
varietyId,
harvestYear,
quantityKind,
quantityPrecise,
quantityLabel,
storageLocation,
offerStatus,
seedbankId,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'lots';
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Lots createAlias(String alias) {
return Lots(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class GerminationTests extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
GerminationTests(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
'lot_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> testedOn = GeneratedColumn<int>(
'tested_on',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<int> sampleSize = GeneratedColumn<int>(
'sample_size',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<int> germinatedCount = GeneratedColumn<int>(
'germinated_count',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
GerminationTests createAlias(String alias) {
return GerminationTests(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class Movements extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Movements(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
'lot_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> type = GeneratedColumn<String>(
'type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> occurredOn = GeneratedColumn<int>(
'occurred_on',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> counterpartyId = GeneratedColumn<String>(
'counterparty_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
'quantity_kind',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
'quantity_precise',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
'quantity_label',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> parentMovementId = GeneratedColumn<String>(
'parent_movement_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> plantareId = GeneratedColumn<String>(
'plantare_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Movements createAlias(String alias) {
return Movements(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class Parties extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Parties(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> displayName = GeneratedColumn<String>(
'display_name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> publicKey = GeneratedColumn<String>(
'public_key',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> kind = GeneratedColumn<String>(
'kind',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT \'person\'',
defaultValue: const CustomExpression('\'person\''),
);
late final GeneratedColumn<String> note = GeneratedColumn<String>(
'note',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Parties createAlias(String alias) {
return Parties(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class Attachments extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
Attachments(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> parentType = GeneratedColumn<String>(
'parent_type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
'parent_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> kind = GeneratedColumn<String>(
'kind',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> uri = GeneratedColumn<String>(
'uri',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<i2.Uint8List> bytes =
GeneratedColumn<i2.Uint8List>(
'bytes',
aliasedName,
true,
type: DriftSqlType.blob,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
late final GeneratedColumn<String> mimeType = GeneratedColumn<String>(
'mime_type',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
parentType,
parentId,
kind,
uri,
bytes,
mimeType,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'attachments';
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
Attachments createAlias(String alias) {
return Attachments(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class ExternalLinks extends Table with TableInfo {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
ExternalLinks(this.attachedDatabase, [this._alias]);
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<int> isDeleted = GeneratedColumn<int>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_deleted IN (0, 1))',
defaultValue: const CustomExpression('0'),
);
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
$customConstraints: 'NOT NULL DEFAULT 1',
defaultValue: const CustomExpression('1'),
);
late final GeneratedColumn<String> parentType = GeneratedColumn<String>(
'parent_type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
'parent_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> url = GeneratedColumn<String>(
'url',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
$customConstraints: 'NOT NULL',
);
late final GeneratedColumn<String> title = GeneratedColumn<String>(
'title',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints: 'NULL',
);
@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
Set<GeneratedColumn> get $primaryKey => {id};
@override
Never map(Map<String, dynamic> data, {String? tablePrefix}) {
throw UnsupportedError('TableInfo.map in schema verification code');
}
@override
ExternalLinks createAlias(String alias) {
return ExternalLinks(attachedDatabase, alias);
}
@override
List<String> get customConstraints => const ['PRIMARY KEY(id)'];
@override
bool get dontWriteConstraints => true;
}
class DatabaseAtV1 extends GeneratedDatabase {
DatabaseAtV1(QueryExecutor e) : super(e);
late final Varieties varieties = Varieties(this);
late final VarietyVernacularNames varietyVernacularNames =
VarietyVernacularNames(this);
late final Species species = Species(this);
late final SpeciesCommonNames speciesCommonNames = SpeciesCommonNames(this);
late final Lots lots = Lots(this);
late final GerminationTests germinationTests = GerminationTests(this);
late final Movements movements = Movements(this);
late final Parties parties = Parties(this);
late final Attachments attachments = Attachments(this);
late final ExternalLinks externalLinks = ExternalLinks(this);
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [
varieties,
varietyVernacularNames,
species,
speciesCommonNames,
lots,
germinationTests,
movements,
parties,
attachments,
externalLinks,
];
@override
int get schemaVersion => 1;
}