// 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: [ 'PRIMARY KEY(id)', ], columns: [ _column_5, _column_6, _column_7, _column_8, _column_9, ], 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 get isActive => columnsByName['is_active']! 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); i1.GeneratedColumn _column_9(String aliasedName) => i1.GeneratedColumn('is_active', aliasedName, false, type: i1.DriftSqlType.bool, defaultConstraints: i1.GeneratedColumn.constraintIsAlways( 'CHECK ("is_active" IN (0, 1))'), defaultValue: const CustomExpression('0')); final class Schema3 extends i0.VersionedSchema { Schema3({required super.database}) : super(version: 3); @override late final List entities = [ snLocalChatChannel, snLocalChatMessage, snLocalChannelMember, snLocalKeyPair, snLocalAccount, snLocalAttachment, snLocalSticker, snLocalStickerPack, idxChannelAlias, idxChatChannel, idxAccountName, idxAttachmentRid, idxAttachmentAccount, ]; 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 Shape3 snLocalChatMessage = Shape3( source: i0.VersionedTable( entityName: 'sn_local_chat_message', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_4, _column_10, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape4 snLocalChannelMember = Shape4( source: i0.VersionedTable( entityName: 'sn_local_channel_member', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_4, _column_6, _column_2, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape2 snLocalKeyPair = Shape2( source: i0.VersionedTable( entityName: 'sn_local_key_pair', withoutRowId: false, isStrict: false, tableConstraints: [ 'PRIMARY KEY(id)', ], columns: [ _column_5, _column_6, _column_7, _column_8, _column_9, ], attachedDatabase: database, ), alias: null); late final Shape5 snLocalAccount = Shape5( source: i0.VersionedTable( entityName: 'sn_local_account', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_12, _column_2, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape6 snLocalAttachment = Shape6( source: i0.VersionedTable( entityName: 'sn_local_attachment', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_13, _column_14, _column_2, _column_6, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape7 snLocalSticker = Shape7( source: i0.VersionedTable( entityName: 'sn_local_sticker', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_1, _column_15, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape8 snLocalStickerPack = Shape8( source: i0.VersionedTable( entityName: 'sn_local_sticker_pack', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); final i1.Index idxChannelAlias = i1.Index('idx_channel_alias', 'CREATE INDEX idx_channel_alias ON sn_local_chat_channel (alias)'); final i1.Index idxChatChannel = i1.Index('idx_chat_channel', 'CREATE INDEX idx_chat_channel ON sn_local_chat_message (channel_id)'); final i1.Index idxAccountName = i1.Index('idx_account_name', 'CREATE INDEX idx_account_name ON sn_local_account (name)'); final i1.Index idxAttachmentRid = i1.Index('idx_attachment_rid', 'CREATE INDEX idx_attachment_rid ON sn_local_attachment (rid)'); final i1.Index idxAttachmentAccount = i1.Index('idx_attachment_account', 'CREATE INDEX idx_attachment_account ON sn_local_attachment (account_id)'); } class Shape3 extends i0.VersionedTable { Shape3({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 senderId => columnsByName['sender_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_10(String aliasedName) => i1.GeneratedColumn('sender_id', aliasedName, true, type: i1.DriftSqlType.int); class Shape4 extends i0.VersionedTable { Shape4({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 accountId => columnsByName['account_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 get cacheExpiredAt => columnsByName['cache_expired_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_11(String aliasedName) => i1.GeneratedColumn('cache_expired_at', aliasedName, false, type: i1.DriftSqlType.dateTime); class Shape5 extends i0.VersionedTable { Shape5({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get name => columnsByName['name']! as i1.GeneratedColumn; i1.GeneratedColumn get content => columnsByName['content']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; i1.GeneratedColumn get cacheExpiredAt => columnsByName['cache_expired_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_12(String aliasedName) => i1.GeneratedColumn('name', aliasedName, false, type: i1.DriftSqlType.string); class Shape6 extends i0.VersionedTable { Shape6({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get rid => columnsByName['rid']! as i1.GeneratedColumn; i1.GeneratedColumn get uuid => columnsByName['uuid']! as i1.GeneratedColumn; i1.GeneratedColumn get content => columnsByName['content']! as i1.GeneratedColumn; i1.GeneratedColumn get accountId => columnsByName['account_id']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; i1.GeneratedColumn get cacheExpiredAt => columnsByName['cache_expired_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_13(String aliasedName) => i1.GeneratedColumn('rid', aliasedName, false, type: i1.DriftSqlType.string, defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE')); i1.GeneratedColumn _column_14(String aliasedName) => i1.GeneratedColumn('uuid', aliasedName, false, type: i1.DriftSqlType.string, defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE')); class Shape7 extends i0.VersionedTable { Shape7({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 fullAlias => columnsByName['full_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_15(String aliasedName) => i1.GeneratedColumn('full_alias', aliasedName, false, type: i1.DriftSqlType.string); class Shape8 extends i0.VersionedTable { Shape8({required super.source, required super.alias}) : super.aliased(); i1.GeneratedColumn get id => columnsByName['id']! as i1.GeneratedColumn; i1.GeneratedColumn get content => columnsByName['content']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; } final class Schema4 extends i0.VersionedSchema { Schema4({required super.database}) : super(version: 4); @override late final List entities = [ snLocalChatChannel, snLocalChatMessage, snLocalChannelMember, snLocalKeyPair, snLocalAccount, snLocalAttachment, snLocalSticker, snLocalStickerPack, snLocalRealm, idxChannelAlias, idxChatChannel, idxAccountName, idxAttachmentRid, idxAttachmentAccount, idxRealmAlias, idxRealmAccount, ]; 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 Shape3 snLocalChatMessage = Shape3( source: i0.VersionedTable( entityName: 'sn_local_chat_message', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_4, _column_10, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape4 snLocalChannelMember = Shape4( source: i0.VersionedTable( entityName: 'sn_local_channel_member', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_4, _column_6, _column_2, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape2 snLocalKeyPair = Shape2( source: i0.VersionedTable( entityName: 'sn_local_key_pair', withoutRowId: false, isStrict: false, tableConstraints: [ 'PRIMARY KEY(id)', ], columns: [ _column_5, _column_6, _column_7, _column_8, _column_9, ], attachedDatabase: database, ), alias: null); late final Shape5 snLocalAccount = Shape5( source: i0.VersionedTable( entityName: 'sn_local_account', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_12, _column_2, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape6 snLocalAttachment = Shape6( source: i0.VersionedTable( entityName: 'sn_local_attachment', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_13, _column_14, _column_2, _column_6, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); late final Shape7 snLocalSticker = Shape7( source: i0.VersionedTable( entityName: 'sn_local_sticker', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_1, _column_15, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape8 snLocalStickerPack = Shape8( source: i0.VersionedTable( entityName: 'sn_local_sticker_pack', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_2, _column_3, ], attachedDatabase: database, ), alias: null); late final Shape9 snLocalRealm = Shape9( source: i0.VersionedTable( entityName: 'sn_local_realm', withoutRowId: false, isStrict: false, tableConstraints: [], columns: [ _column_0, _column_16, _column_2, _column_6, _column_3, _column_11, ], attachedDatabase: database, ), alias: null); final i1.Index idxChannelAlias = i1.Index('idx_channel_alias', 'CREATE INDEX idx_channel_alias ON sn_local_chat_channel (alias)'); final i1.Index idxChatChannel = i1.Index('idx_chat_channel', 'CREATE INDEX idx_chat_channel ON sn_local_chat_message (channel_id)'); final i1.Index idxAccountName = i1.Index('idx_account_name', 'CREATE INDEX idx_account_name ON sn_local_account (name)'); final i1.Index idxAttachmentRid = i1.Index('idx_attachment_rid', 'CREATE INDEX idx_attachment_rid ON sn_local_attachment (rid)'); final i1.Index idxAttachmentAccount = i1.Index('idx_attachment_account', 'CREATE INDEX idx_attachment_account ON sn_local_attachment (account_id)'); final i1.Index idxRealmAlias = i1.Index('idx_realm_alias', 'CREATE INDEX idx_realm_alias ON sn_local_realm (alias)'); final i1.Index idxRealmAccount = i1.Index('idx_realm_account', 'CREATE INDEX idx_realm_account ON sn_local_realm (account_id)'); } class Shape9 extends i0.VersionedTable { Shape9({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 accountId => columnsByName['account_id']! as i1.GeneratedColumn; i1.GeneratedColumn get createdAt => columnsByName['created_at']! as i1.GeneratedColumn; i1.GeneratedColumn get cacheExpiredAt => columnsByName['cache_expired_at']! as i1.GeneratedColumn; } i1.GeneratedColumn _column_16(String aliasedName) => i1.GeneratedColumn('alias', aliasedName, false, type: i1.DriftSqlType.string, defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE')); i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, required Future Function(i1.Migrator m, Schema4 schema) from3To4, }) { 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; case 2: final schema = Schema3(database: database); final migrator = i1.Migrator(database, schema); await from2To3(migrator, schema); return 3; case 3: final schema = Schema4(database: database); final migrator = i1.Migrator(database, schema); await from3To4(migrator, schema); return 4; default: throw ArgumentError.value('Unknown migration from $currentVersion'); } }; } i1.OnUpgrade stepByStep({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, required Future Function(i1.Migrator m, Schema4 schema) from3To4, }) => i0.VersionedSchema.stepByStepHelper( step: migrationSteps( from1To2: from1To2, from2To3: from2To3, from3To4: from3To4, ));