3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
5
import 'package:logging/logging.dart' ;
6
- import 'package:pub_dev/account/models.dart' ;
7
- import 'package:pub_dev/package/models.dart' ;
8
- import 'package:pub_dev/publisher/models.dart' ;
9
- import 'package:pub_dev/shared/datastore.dart' ;
10
6
11
7
final _logger = Logger ('backfill_new_fields' );
12
8
@@ -16,27 +12,5 @@ final _logger = Logger('backfill_new_fields');
16
12
/// CHANGELOG.md must be updated with the new fields, and the next
17
13
/// release could remove the backfill from here.
18
14
Future <void > backfillNewFields () async {
19
- await _removeKnownUnmappedFields ();
20
- }
21
-
22
- Future <void > _removeKnownUnmappedFields () async {
23
- _logger.info ('Removing unmapped fields...' );
24
-
25
- Future <void > removeIsBlocked <T extends ExpandoModel >() async {
26
- await for (final p in dbService.query <T >().run ()) {
27
- if (p.additionalProperties.isEmpty) continue ;
28
- if (p.additionalProperties.containsKey ('isBlocked' )) {
29
- await withRetryTransaction (dbService, (tx) async {
30
- final e = await tx.lookupValue <T >(p.key);
31
- e.additionalProperties.remove ('isBlocked' );
32
- tx.insert (e);
33
- });
34
- }
35
- }
36
- }
37
-
38
- await removeIsBlocked <Package >();
39
- await removeIsBlocked <Publisher >();
40
- await removeIsBlocked <User >();
41
- _logger.info ('Removing unmapped fields completed.' );
15
+ _logger.info ('No new fields.' );
42
16
}
0 commit comments