/* * Copyright (c) 2024-2025 Fabian Freund. * * This file is part of WebLibre * (see https://weblibre.eu). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ // dart format width=80 import 'package:drift/internal/versioned_schema.dart' as i0; import 'package:drift/drift.dart' as i1; import 'dart:typed_data' as i2; import 'package:drift/drift.dart'; // ignore_for_file: type=lint,unused_import // GENERATED BY drift_dev, DO NOT MODIFY. final class Schema2 extends i0.VersionedSchema { Schema2({required super.database}) : super(version: 2); @override late final List entities = [ setting, iconCache, onboarding, riverpod, ]; late final Shape0 setting = Shape0( source: i0.VersionedTable( entityName: 'setting', withoutRowId: false, isStrict: true, tableConstraints: [], columns: [_column_0, _column_1, _column_2], attachedDatabase: database, ), alias: null, ); late final Shape1 iconCache = Shape1( source: i0.VersionedTable( entityName: 'icon_cache', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [_column_3, _column_4, _column_5], attachedDatabase: database, ), alias: null, ); late final Shape2 onboarding = Shape2( source: i0.VersionedTable( entityName: 'onboarding', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [_column_6, _column_7], attachedDatabase: database, ), alias: null, ); late final Shape3 riverpod = Shape3( source: i0.VersionedTable( entityName: 'riverpod', withoutRowId: true, isStrict: false, tableConstraints: [], columns: [_column_0, _column_8, _column_9, _column_10], attachedDatabase: database, ), alias: null, ); } class Shape0 extends i0.VersionedTable { Shape0({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get key => columnsByName['key']! as i1.GeneratedColumn; i1.GeneratedColumn get partitionKey => columnsByName['partition_key']! as i1.GeneratedColumn; i1.GeneratedColumn get value => columnsByName['value']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_0(String aliasedName) => i1.GeneratedColumn( 'key', aliasedName, false, type: i1.DriftSqlType.string, $customConstraints: 'PRIMARY KEY NOT NULL', ); i1.GeneratedColumn _column_1(String aliasedName) => i1.GeneratedColumn( 'partition_key', aliasedName, true, type: i1.DriftSqlType.string, $customConstraints: '', ); i1.GeneratedColumn _column_2(String aliasedName) => i1.GeneratedColumn( 'value', aliasedName, true, type: i1.DriftSqlType.any, $customConstraints: '', ); class Shape1 extends i0.VersionedTable { Shape1({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get origin => columnsByName['origin']! as i1.GeneratedColumn; i1.GeneratedColumn get iconData => columnsByName['icon_data']! as i1.GeneratedColumn; i1.GeneratedColumn get fetchDate => columnsByName['fetch_date']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_3(String aliasedName) => i1.GeneratedColumn( 'origin', aliasedName, false, type: i1.DriftSqlType.string, $customConstraints: 'PRIMARY KEY NOT NULL', ); i1.GeneratedColumn _column_4(String aliasedName) => i1.GeneratedColumn( 'icon_data', aliasedName, false, type: i1.DriftSqlType.blob, $customConstraints: 'NOT NULL', ); i1.GeneratedColumn _column_5(String aliasedName) => i1.GeneratedColumn( 'fetch_date', aliasedName, false, type: i1.DriftSqlType.dateTime, $customConstraints: 'NOT NULL', ); class Shape2 extends i0.VersionedTable { Shape2({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get revision => columnsByName['revision']! as i1.GeneratedColumn; i1.GeneratedColumn get completionDate => columnsByName['completion_date']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_6(String aliasedName) => i1.GeneratedColumn( 'revision', aliasedName, false, type: i1.DriftSqlType.int, $customConstraints: 'NOT NULL', ); i1.GeneratedColumn _column_7(String aliasedName) => i1.GeneratedColumn( 'completion_date', aliasedName, false, type: i1.DriftSqlType.dateTime, $customConstraints: 'NOT NULL', ); class Shape3 extends i0.VersionedTable { Shape3({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get key => columnsByName['key']! as i1.GeneratedColumn; i1.GeneratedColumn get json => columnsByName['json']! as i1.GeneratedColumn; i1.GeneratedColumn get expireAt => columnsByName['expireAt']! as i1.GeneratedColumn; i1.GeneratedColumn get destroyKey => columnsByName['destroyKey']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_8(String aliasedName) => i1.GeneratedColumn( 'json', aliasedName, false, type: i1.DriftSqlType.string, $customConstraints: 'NOT NULL', ); i1.GeneratedColumn _column_9(String aliasedName) => i1.GeneratedColumn( 'expireAt', aliasedName, true, type: i1.DriftSqlType.dateTime, $customConstraints: '', ); i1.GeneratedColumn _column_10(String aliasedName) => i1.GeneratedColumn( 'destroyKey', aliasedName, true, type: i1.DriftSqlType.string, $customConstraints: '', ); i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, }) { return (currentVersion, database) async { switch (currentVersion) { case 1: final schema = Schema2(database: database); final migrator = i1.Migrator(database, schema); await from1To2(migrator, schema); return 2; default: throw ArgumentError.value('Unknown migration from $currentVersion'); } }; } i1.OnUpgrade stepByStep({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, }) => i0.VersionedSchema.stepByStepHelper( step: migrationSteps(from1To2: from1To2), );