// dart format width=80 import 'package:drift/internal/versioned_schema.dart' as i0; import 'package:drift/drift.dart' as i1; 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 = [ snLocalChatChannel, snLocalChatMessage, snLocalKeyPair, ]; late final Shape0 snLocalChatChannel = Shape0( source: i0.VersionedTable( entityName: 'sn_local_chat_channel', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_1, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape1 snLocalChatMessage = Shape1( source: i0.VersionedTable( entityName: 'sn_local_chat_message', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_4, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape2 snLocalKeyPair = Shape2( source: i0.VersionedTable( entityName: 'sn_local_key_pair', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_5, _column_6, _column_7, _column_8, ], attachedDatabase: database, ), alias: null); } class Shape0 extends i0.VersionedTable { Shape0({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get alias => columnsByName['alias']! as i1.GeneratedColumn; i1.GeneratedColumn get content => columnsByName['content']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_0(String aliasedName) => i1.GeneratedColumn('id', aliasedName, false, hasAutoIncrement: true, type: i1.DriftSqlType.int, defaultConstraints: i1.GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); i1.GeneratedColumn _column_1(String aliasedName) => i1.GeneratedColumn('alias', aliasedName, false, type: i1.DriftSqlType.string); i1.GeneratedColumn _column_2(String aliasedName) => i1.GeneratedColumn('content', aliasedName, false, type: i1.DriftSqlType.string); i1.GeneratedColumn _column_3(String aliasedName) => i1.GeneratedColumn('created_at', aliasedName, false, type: i1.DriftSqlType.dateTime, defaultValue: const CustomExpression( 'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)')); class Shape1 extends i0.VersionedTable { Shape1({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get channelId => columnsByName['channel_id']! as i1.GeneratedColumn; i1.GeneratedColumn get content => columnsByName['content']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_4(String aliasedName) => i1.GeneratedColumn('channel_id', aliasedName, false, type: i1.DriftSqlType.int); class Shape2 extends i0.VersionedTable { Shape2({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get accountId => columnsByName['account_id']! as i1.GeneratedColumn; i1.GeneratedColumn get publicKey => columnsByName['public_key']! as i1.GeneratedColumn; i1.GeneratedColumn get privateKey => columnsByName['private_key']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_5(String aliasedName) => i1.GeneratedColumn('id', aliasedName, false, type: i1.DriftSqlType.string); i1.GeneratedColumn _column_6(String aliasedName) => i1.GeneratedColumn('account_id', aliasedName, false, type: i1.DriftSqlType.int); i1.GeneratedColumn _column_7(String aliasedName) => i1.GeneratedColumn('public_key', aliasedName, false, type: i1.DriftSqlType.string); i1.GeneratedColumn _column_8(String aliasedName) => i1.GeneratedColumn('private_key', aliasedName, true, type: i1.DriftSqlType.string); 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, ));