// 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 Schema7 extends i0.VersionedSchema {
  Schema7({required super.database}) : super(version: 7);
  @override
  late final List<i1.DatabaseSchemaEntity> entities = [
    chatRooms,
    chatMembers,
    chatMessages,
    postDrafts,
  ];
  late final Shape0 chatRooms = Shape0(
    source: i0.VersionedTable(
      entityName: 'chat_rooms',
      withoutRowId: false,
      isStrict: false,
      tableConstraints: ['PRIMARY KEY(id)'],
      columns: [
        _column_0,
        _column_1,
        _column_2,
        _column_3,
        _column_4,
        _column_5,
        _column_6,
        _column_7,
        _column_8,
        _column_9,
        _column_10,
        _column_11,
      ],
      attachedDatabase: database,
    ),
    alias: null,
  );
  late final Shape1 chatMembers = Shape1(
    source: i0.VersionedTable(
      entityName: 'chat_members',
      withoutRowId: false,
      isStrict: false,
      tableConstraints: ['PRIMARY KEY(id)'],
      columns: [
        _column_0,
        _column_12,
        _column_13,
        _column_14,
        _column_15,
        _column_16,
        _column_17,
        _column_18,
        _column_19,
        _column_20,
        _column_21,
        _column_22,
        _column_23,
        _column_9,
        _column_10,
        _column_11,
      ],
      attachedDatabase: database,
    ),
    alias: null,
  );
  late final Shape2 chatMessages = Shape2(
    source: i0.VersionedTable(
      entityName: 'chat_messages',
      withoutRowId: false,
      isStrict: false,
      tableConstraints: ['PRIMARY KEY(id)'],
      columns: [
        _column_0,
        _column_24,
        _column_25,
        _column_26,
        _column_27,
        _column_28,
        _column_9,
        _column_29,
        _column_30,
        _column_31,
        _column_11,
        _column_32,
        _column_33,
        _column_34,
        _column_35,
        _column_36,
        _column_37,
        _column_38,
        _column_39,
      ],
      attachedDatabase: database,
    ),
    alias: null,
  );
  late final Shape3 postDrafts = Shape3(
    source: i0.VersionedTable(
      entityName: 'post_drafts',
      withoutRowId: false,
      isStrict: false,
      tableConstraints: ['PRIMARY KEY(id)'],
      columns: [
        _column_0,
        _column_40,
        _column_2,
        _column_26,
        _column_41,
        _column_42,
        _column_43,
        _column_44,
      ],
      attachedDatabase: database,
    ),
    alias: null,
  );
}

class Shape0 extends i0.VersionedTable {
  Shape0({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get id =>
      columnsByName['id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get name =>
      columnsByName['name']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get description =>
      columnsByName['description']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get type =>
      columnsByName['type']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get isPublic =>
      columnsByName['is_public']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<bool> get isCommunity =>
      columnsByName['is_community']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<String> get picture =>
      columnsByName['picture']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get background =>
      columnsByName['background']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get realmId =>
      columnsByName['realm_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get updatedAt =>
      columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get deletedAt =>
      columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_0(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'id',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_1(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'name',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_2(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'description',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<int> _column_3(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'type',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
    );
i1.GeneratedColumn<bool> _column_4(String aliasedName) =>
    i1.GeneratedColumn<bool>(
      'is_public',
      aliasedName,
      true,
      type: i1.DriftSqlType.bool,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'CHECK ("is_public" IN (0, 1))',
      ),
      defaultValue: const CustomExpression('0'),
    );
i1.GeneratedColumn<bool> _column_5(String aliasedName) =>
    i1.GeneratedColumn<bool>(
      'is_community',
      aliasedName,
      true,
      type: i1.DriftSqlType.bool,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'CHECK ("is_community" IN (0, 1))',
      ),
      defaultValue: const CustomExpression('0'),
    );
i1.GeneratedColumn<String> _column_6(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'picture',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_7(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'background',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_8(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'realm_id',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<DateTime> _column_9(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'created_at',
      aliasedName,
      false,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<DateTime> _column_10(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'updated_at',
      aliasedName,
      false,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<DateTime> _column_11(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'deleted_at',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );

class Shape1 extends i0.VersionedTable {
  Shape1({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get id =>
      columnsByName['id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get chatRoomId =>
      columnsByName['chat_room_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get accountId =>
      columnsByName['account_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get account =>
      columnsByName['account']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get nick =>
      columnsByName['nick']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get role =>
      columnsByName['role']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get notify =>
      columnsByName['notify']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get joinedAt =>
      columnsByName['joined_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get breakUntil =>
      columnsByName['break_until']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get timeoutUntil =>
      columnsByName['timeout_until']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<bool> get isBot =>
      columnsByName['is_bot']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<String> get status =>
      columnsByName['status']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get lastTyped =>
      columnsByName['last_typed']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get updatedAt =>
      columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get deletedAt =>
      columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
}

i1.GeneratedColumn<String> _column_12(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'chat_room_id',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'REFERENCES chat_rooms (id)',
      ),
    );
i1.GeneratedColumn<String> _column_13(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'account_id',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_14(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'account',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_15(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'nick',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<int> _column_16(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'role',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
    );
i1.GeneratedColumn<int> _column_17(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'notify',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
    );
i1.GeneratedColumn<DateTime> _column_18(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'joined_at',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<DateTime> _column_19(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'break_until',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<DateTime> _column_20(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'timeout_until',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<bool> _column_21(String aliasedName) =>
    i1.GeneratedColumn<bool>(
      'is_bot',
      aliasedName,
      false,
      type: i1.DriftSqlType.bool,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'CHECK ("is_bot" IN (0, 1))',
      ),
    );
i1.GeneratedColumn<String> _column_22(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'status',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<DateTime> _column_23(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'last_typed',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );

class Shape2 extends i0.VersionedTable {
  Shape2({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get id =>
      columnsByName['id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get roomId =>
      columnsByName['room_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get senderId =>
      columnsByName['sender_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get content =>
      columnsByName['content']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get nonce =>
      columnsByName['nonce']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get data =>
      columnsByName['data']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get createdAt =>
      columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<int> get status =>
      columnsByName['status']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<bool> get isDeleted =>
      columnsByName['is_deleted']! as i1.GeneratedColumn<bool>;
  i1.GeneratedColumn<DateTime> get updatedAt =>
      columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<DateTime> get deletedAt =>
      columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<String> get type =>
      columnsByName['type']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get meta =>
      columnsByName['meta']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get membersMentioned =>
      columnsByName['members_mentioned']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<DateTime> get editedAt =>
      columnsByName['edited_at']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<String> get attachments =>
      columnsByName['attachments']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get reactions =>
      columnsByName['reactions']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get repliedMessageId =>
      columnsByName['replied_message_id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get forwardedMessageId =>
      columnsByName['forwarded_message_id']! as i1.GeneratedColumn<String>;
}

i1.GeneratedColumn<String> _column_24(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'room_id',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'REFERENCES chat_rooms (id)',
      ),
    );
i1.GeneratedColumn<String> _column_25(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'sender_id',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'REFERENCES chat_members (id)',
      ),
    );
i1.GeneratedColumn<String> _column_26(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'content',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_27(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'nonce',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_28(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'data',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<int> _column_29(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'status',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
    );
i1.GeneratedColumn<bool> _column_30(String aliasedName) =>
    i1.GeneratedColumn<bool>(
      'is_deleted',
      aliasedName,
      true,
      type: i1.DriftSqlType.bool,
      defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
        'CHECK ("is_deleted" IN (0, 1))',
      ),
      defaultValue: const CustomExpression('0'),
    );
i1.GeneratedColumn<DateTime> _column_31(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'updated_at',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<String> _column_32(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'type',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultValue: const CustomExpression('\'text\''),
    );
i1.GeneratedColumn<String> _column_33(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'meta',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultValue: const CustomExpression('\'{}\''),
    );
i1.GeneratedColumn<String> _column_34(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'members_mentioned',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultValue: const CustomExpression('\'[]\''),
    );
i1.GeneratedColumn<DateTime> _column_35(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'edited_at',
      aliasedName,
      true,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<String> _column_36(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'attachments',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultValue: const CustomExpression('\'[]\''),
    );
i1.GeneratedColumn<String> _column_37(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'reactions',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
      defaultValue: const CustomExpression('\'[]\''),
    );
i1.GeneratedColumn<String> _column_38(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'replied_message_id',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<String> _column_39(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'forwarded_message_id',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );

class Shape3 extends i0.VersionedTable {
  Shape3({required super.source, required super.alias}) : super.aliased();
  i1.GeneratedColumn<String> get id =>
      columnsByName['id']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get title =>
      columnsByName['title']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get description =>
      columnsByName['description']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<String> get content =>
      columnsByName['content']! as i1.GeneratedColumn<String>;
  i1.GeneratedColumn<int> get visibility =>
      columnsByName['visibility']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<int> get type =>
      columnsByName['type']! as i1.GeneratedColumn<int>;
  i1.GeneratedColumn<DateTime> get lastModified =>
      columnsByName['last_modified']! as i1.GeneratedColumn<DateTime>;
  i1.GeneratedColumn<String> get postData =>
      columnsByName['post_data']! as i1.GeneratedColumn<String>;
}

i1.GeneratedColumn<String> _column_40(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'title',
      aliasedName,
      true,
      type: i1.DriftSqlType.string,
    );
i1.GeneratedColumn<int> _column_41(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'visibility',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
      defaultValue: const CustomExpression('0'),
    );
i1.GeneratedColumn<int> _column_42(String aliasedName) =>
    i1.GeneratedColumn<int>(
      'type',
      aliasedName,
      false,
      type: i1.DriftSqlType.int,
      defaultValue: const CustomExpression('0'),
    );
i1.GeneratedColumn<DateTime> _column_43(String aliasedName) =>
    i1.GeneratedColumn<DateTime>(
      'last_modified',
      aliasedName,
      false,
      type: i1.DriftSqlType.dateTime,
    );
i1.GeneratedColumn<String> _column_44(String aliasedName) =>
    i1.GeneratedColumn<String>(
      'post_data',
      aliasedName,
      false,
      type: i1.DriftSqlType.string,
    );
i0.MigrationStepWithVersion migrationSteps({
  required Future<void> Function(i1.Migrator m, Schema7 schema) from6To7,
}) {
  return (currentVersion, database) async {
    switch (currentVersion) {
      case 6:
        final schema = Schema7(database: database);
        final migrator = i1.Migrator(database, schema);
        await from6To7(migrator, schema);
        return 7;
      default:
        throw ArgumentError.value('Unknown migration from $currentVersion');
    }
  };
}

i1.OnUpgrade stepByStep({
  required Future<void> Function(i1.Migrator m, Schema7 schema) from6To7,
}) => i0.VersionedSchema.stepByStepHelper(
  step: migrationSteps(from6To7: from6To7),
);
