|
| 1 | +// dart format width=80 |
| 2 | +import 'package:drift/drift.dart' as i1; |
| 3 | +import 'package:drift/drift.dart'; // GENERATED BY drift_dev, DO NOT MODIFY. |
| 4 | +import 'package:drift/internal/versioned_schema.dart' as i0; |
| 5 | + |
| 6 | +// ignore_for_file: type=lint,unused_import |
| 7 | +// |
| 8 | +final class Schema2 extends i0.VersionedSchema { |
| 9 | + Schema2({required super.database}) : super(version: 2); |
| 10 | + @override |
| 11 | + late final List<i1.DatabaseSchemaEntity> entities = [ |
| 12 | + totps, |
| 13 | + deletedTotps, |
| 14 | + pendingBackendPushOperations, |
| 15 | + backendPushOperationErrors, |
| 16 | + ]; |
| 17 | + late final Shape0 totps = Shape0( |
| 18 | + source: i0.VersionedTable( |
| 19 | + entityName: 'totps', |
| 20 | + withoutRowId: false, |
| 21 | + isStrict: false, |
| 22 | + tableConstraints: ['PRIMARY KEY(uuid)'], |
| 23 | + columns: [ |
| 24 | + _column_0, |
| 25 | + _column_1, |
| 26 | + _column_2, |
| 27 | + _column_3, |
| 28 | + _column_4, |
| 29 | + _column_5, |
| 30 | + _column_6, |
| 31 | + _column_7, |
| 32 | + _column_8, |
| 33 | + _column_9, |
| 34 | + ], |
| 35 | + attachedDatabase: database, |
| 36 | + ), |
| 37 | + alias: null, |
| 38 | + ); |
| 39 | + late final Shape1 deletedTotps = Shape1( |
| 40 | + source: i0.VersionedTable( |
| 41 | + entityName: 'deleted_totps', |
| 42 | + withoutRowId: false, |
| 43 | + isStrict: false, |
| 44 | + tableConstraints: ['PRIMARY KEY(uuid)'], |
| 45 | + columns: [_column_0, _column_10], |
| 46 | + attachedDatabase: database, |
| 47 | + ), |
| 48 | + alias: null, |
| 49 | + ); |
| 50 | + late final Shape2 pendingBackendPushOperations = Shape2( |
| 51 | + source: i0.VersionedTable( |
| 52 | + entityName: 'pending_backend_push_operations', |
| 53 | + withoutRowId: false, |
| 54 | + isStrict: false, |
| 55 | + tableConstraints: ['PRIMARY KEY(uuid)'], |
| 56 | + columns: [_column_0, _column_11, _column_12, _column_13], |
| 57 | + attachedDatabase: database, |
| 58 | + ), |
| 59 | + alias: null, |
| 60 | + ); |
| 61 | + late final Shape3 backendPushOperationErrors = Shape3( |
| 62 | + source: i0.VersionedTable( |
| 63 | + entityName: 'backend_push_operation_errors', |
| 64 | + withoutRowId: false, |
| 65 | + isStrict: false, |
| 66 | + tableConstraints: [], |
| 67 | + columns: [_column_14, _column_15, _column_16, _column_17, _column_13], |
| 68 | + attachedDatabase: database, |
| 69 | + ), |
| 70 | + alias: null, |
| 71 | + ); |
| 72 | +} |
| 73 | + |
| 74 | +class Shape0 extends i0.VersionedTable { |
| 75 | + Shape0({required super.source, required super.alias}) : super.aliased(); |
| 76 | + i1.GeneratedColumn<String> get uuid => |
| 77 | + columnsByName['uuid']! as i1.GeneratedColumn<String>; |
| 78 | + i1.GeneratedColumn<String> get secret => |
| 79 | + columnsByName['secret']! as i1.GeneratedColumn<String>; |
| 80 | + i1.GeneratedColumn<String> get label => |
| 81 | + columnsByName['label']! as i1.GeneratedColumn<String>; |
| 82 | + i1.GeneratedColumn<String> get issuer => |
| 83 | + columnsByName['issuer']! as i1.GeneratedColumn<String>; |
| 84 | + i1.GeneratedColumn<String> get algorithm => |
| 85 | + columnsByName['algorithm']! as i1.GeneratedColumn<String>; |
| 86 | + i1.GeneratedColumn<int> get digits => |
| 87 | + columnsByName['digits']! as i1.GeneratedColumn<int>; |
| 88 | + i1.GeneratedColumn<int> get validity => |
| 89 | + columnsByName['validity']! as i1.GeneratedColumn<int>; |
| 90 | + i1.GeneratedColumn<String> get imageUrl => |
| 91 | + columnsByName['image_url']! as i1.GeneratedColumn<String>; |
| 92 | + i1.GeneratedColumn<String> get encryptionSalt => |
| 93 | + columnsByName['encryption_salt']! as i1.GeneratedColumn<String>; |
| 94 | + i1.GeneratedColumn<int> get updatedAt => |
| 95 | + columnsByName['updated_at']! as i1.GeneratedColumn<int>; |
| 96 | +} |
| 97 | + |
| 98 | +i1.GeneratedColumn<String> _column_0(String aliasedName) => |
| 99 | + i1.GeneratedColumn<String>( |
| 100 | + 'uuid', |
| 101 | + aliasedName, |
| 102 | + false, |
| 103 | + type: i1.DriftSqlType.string, |
| 104 | + $customConstraints: 'NOT NULL', |
| 105 | + ); |
| 106 | +i1.GeneratedColumn<String> _column_1(String aliasedName) => |
| 107 | + i1.GeneratedColumn<String>( |
| 108 | + 'secret', |
| 109 | + aliasedName, |
| 110 | + false, |
| 111 | + type: i1.DriftSqlType.string, |
| 112 | + $customConstraints: 'NOT NULL', |
| 113 | + ); |
| 114 | +i1.GeneratedColumn<String> _column_2(String aliasedName) => |
| 115 | + i1.GeneratedColumn<String>( |
| 116 | + 'label', |
| 117 | + aliasedName, |
| 118 | + true, |
| 119 | + type: i1.DriftSqlType.string, |
| 120 | + $customConstraints: 'NULL', |
| 121 | + ); |
| 122 | +i1.GeneratedColumn<String> _column_3(String aliasedName) => |
| 123 | + i1.GeneratedColumn<String>( |
| 124 | + 'issuer', |
| 125 | + aliasedName, |
| 126 | + true, |
| 127 | + type: i1.DriftSqlType.string, |
| 128 | + $customConstraints: 'NULL', |
| 129 | + ); |
| 130 | +i1.GeneratedColumn<String> _column_4(String aliasedName) => |
| 131 | + i1.GeneratedColumn<String>( |
| 132 | + 'algorithm', |
| 133 | + aliasedName, |
| 134 | + true, |
| 135 | + type: i1.DriftSqlType.string, |
| 136 | + $customConstraints: 'NULL', |
| 137 | + ); |
| 138 | +i1.GeneratedColumn<int> _column_5(String aliasedName) => |
| 139 | + i1.GeneratedColumn<int>( |
| 140 | + 'digits', |
| 141 | + aliasedName, |
| 142 | + true, |
| 143 | + type: i1.DriftSqlType.int, |
| 144 | + $customConstraints: 'NULL', |
| 145 | + ); |
| 146 | +i1.GeneratedColumn<int> _column_6(String aliasedName) => |
| 147 | + i1.GeneratedColumn<int>( |
| 148 | + 'validity', |
| 149 | + aliasedName, |
| 150 | + true, |
| 151 | + type: i1.DriftSqlType.int, |
| 152 | + $customConstraints: 'NULL', |
| 153 | + ); |
| 154 | +i1.GeneratedColumn<String> _column_7(String aliasedName) => |
| 155 | + i1.GeneratedColumn<String>( |
| 156 | + 'image_url', |
| 157 | + aliasedName, |
| 158 | + true, |
| 159 | + type: i1.DriftSqlType.string, |
| 160 | + $customConstraints: 'NULL', |
| 161 | + ); |
| 162 | +i1.GeneratedColumn<String> _column_8(String aliasedName) => |
| 163 | + i1.GeneratedColumn<String>( |
| 164 | + 'encryption_salt', |
| 165 | + aliasedName, |
| 166 | + false, |
| 167 | + type: i1.DriftSqlType.string, |
| 168 | + $customConstraints: 'NOT NULL', |
| 169 | + ); |
| 170 | +i1.GeneratedColumn<int> _column_9(String aliasedName) => |
| 171 | + i1.GeneratedColumn<int>( |
| 172 | + 'updated_at', |
| 173 | + aliasedName, |
| 174 | + false, |
| 175 | + type: i1.DriftSqlType.int, |
| 176 | + $customConstraints: 'NOT NULL DEFAULT 0', |
| 177 | + defaultValue: const i1.CustomExpression('0'), |
| 178 | + ); |
| 179 | + |
| 180 | +class Shape1 extends i0.VersionedTable { |
| 181 | + Shape1({required super.source, required super.alias}) : super.aliased(); |
| 182 | + i1.GeneratedColumn<String> get uuid => |
| 183 | + columnsByName['uuid']! as i1.GeneratedColumn<String>; |
| 184 | + i1.GeneratedColumn<int> get deletedAt => |
| 185 | + columnsByName['deleted_at']! as i1.GeneratedColumn<int>; |
| 186 | +} |
| 187 | + |
| 188 | +i1.GeneratedColumn<int> _column_10( |
| 189 | + String aliasedName, |
| 190 | +) => i1.GeneratedColumn<int>( |
| 191 | + 'deleted_at', |
| 192 | + aliasedName, |
| 193 | + false, |
| 194 | + type: i1.DriftSqlType.int, |
| 195 | + $customConstraints: |
| 196 | + 'NOT NULL DEFAULT (CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER))', |
| 197 | + defaultValue: const i1.CustomExpression( |
| 198 | + 'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)', |
| 199 | + ), |
| 200 | +); |
| 201 | + |
| 202 | +class Shape2 extends i0.VersionedTable { |
| 203 | + Shape2({required super.source, required super.alias}) : super.aliased(); |
| 204 | + i1.GeneratedColumn<String> get uuid => |
| 205 | + columnsByName['uuid']! as i1.GeneratedColumn<String>; |
| 206 | + i1.GeneratedColumn<String> get kind => |
| 207 | + columnsByName['kind']! as i1.GeneratedColumn<String>; |
| 208 | + i1.GeneratedColumn<String> get jsonPayload => |
| 209 | + columnsByName['json_payload']! as i1.GeneratedColumn<String>; |
| 210 | + i1.GeneratedColumn<int> get createdAt => |
| 211 | + columnsByName['created_at']! as i1.GeneratedColumn<int>; |
| 212 | +} |
| 213 | + |
| 214 | +i1.GeneratedColumn<String> _column_11(String aliasedName) => |
| 215 | + i1.GeneratedColumn<String>( |
| 216 | + 'kind', |
| 217 | + aliasedName, |
| 218 | + false, |
| 219 | + type: i1.DriftSqlType.string, |
| 220 | + $customConstraints: 'NOT NULL', |
| 221 | + ); |
| 222 | +i1.GeneratedColumn<String> _column_12(String aliasedName) => |
| 223 | + i1.GeneratedColumn<String>( |
| 224 | + 'json_payload', |
| 225 | + aliasedName, |
| 226 | + false, |
| 227 | + type: i1.DriftSqlType.string, |
| 228 | + $customConstraints: 'NOT NULL', |
| 229 | + ); |
| 230 | +i1.GeneratedColumn<int> _column_13( |
| 231 | + String aliasedName, |
| 232 | +) => i1.GeneratedColumn<int>( |
| 233 | + 'created_at', |
| 234 | + aliasedName, |
| 235 | + false, |
| 236 | + type: i1.DriftSqlType.int, |
| 237 | + $customConstraints: |
| 238 | + 'NOT NULL DEFAULT (CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER))', |
| 239 | + defaultValue: const i1.CustomExpression( |
| 240 | + 'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)', |
| 241 | + ), |
| 242 | +); |
| 243 | + |
| 244 | +class Shape3 extends i0.VersionedTable { |
| 245 | + Shape3({required super.source, required super.alias}) : super.aliased(); |
| 246 | + i1.GeneratedColumn<String> get operationUuid => |
| 247 | + columnsByName['operation_uuid']! as i1.GeneratedColumn<String>; |
| 248 | + i1.GeneratedColumn<String> get totpUuid => |
| 249 | + columnsByName['totp_uuid']! as i1.GeneratedColumn<String>; |
| 250 | + i1.GeneratedColumn<String> get errorKind => |
| 251 | + columnsByName['error_kind']! as i1.GeneratedColumn<String>; |
| 252 | + i1.GeneratedColumn<String> get errorDetails => |
| 253 | + columnsByName['error_details']! as i1.GeneratedColumn<String>; |
| 254 | + i1.GeneratedColumn<int> get createdAt => |
| 255 | + columnsByName['created_at']! as i1.GeneratedColumn<int>; |
| 256 | +} |
| 257 | + |
| 258 | +i1.GeneratedColumn<String> _column_14(String aliasedName) => |
| 259 | + i1.GeneratedColumn<String>( |
| 260 | + 'operation_uuid', |
| 261 | + aliasedName, |
| 262 | + false, |
| 263 | + type: i1.DriftSqlType.string, |
| 264 | + $customConstraints: 'NOT NULL', |
| 265 | + ); |
| 266 | +i1.GeneratedColumn<String> _column_15(String aliasedName) => |
| 267 | + i1.GeneratedColumn<String>( |
| 268 | + 'totp_uuid', |
| 269 | + aliasedName, |
| 270 | + false, |
| 271 | + type: i1.DriftSqlType.string, |
| 272 | + $customConstraints: 'NOT NULL', |
| 273 | + ); |
| 274 | +i1.GeneratedColumn<String> _column_16(String aliasedName) => |
| 275 | + i1.GeneratedColumn<String>( |
| 276 | + 'error_kind', |
| 277 | + aliasedName, |
| 278 | + false, |
| 279 | + type: i1.DriftSqlType.string, |
| 280 | + $customConstraints: 'NOT NULL', |
| 281 | + ); |
| 282 | +i1.GeneratedColumn<String> _column_17(String aliasedName) => |
| 283 | + i1.GeneratedColumn<String>( |
| 284 | + 'error_details', |
| 285 | + aliasedName, |
| 286 | + true, |
| 287 | + type: i1.DriftSqlType.string, |
| 288 | + $customConstraints: 'NULL', |
| 289 | + ); |
| 290 | +i0.MigrationStepWithVersion migrationSteps({ |
| 291 | + required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2, |
| 292 | +}) { |
| 293 | + return (currentVersion, database) async { |
| 294 | + switch (currentVersion) { |
| 295 | + case 1: |
| 296 | + final schema = Schema2(database: database); |
| 297 | + final migrator = i1.Migrator(database, schema); |
| 298 | + await from1To2(migrator, schema); |
| 299 | + return 2; |
| 300 | + default: |
| 301 | + throw ArgumentError.value('Unknown migration from $currentVersion'); |
| 302 | + } |
| 303 | + }; |
| 304 | +} |
| 305 | + |
| 306 | +i1.OnUpgrade stepByStep({ |
| 307 | + required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2, |
| 308 | +}) => i0.VersionedSchema.stepByStepHelper( |
| 309 | + step: migrationSteps(from1To2: from1To2), |
| 310 | +); |
0 commit comments