33// BSD-style license that can be found in the LICENSE file.
44
55import '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' ;
106
117final _logger = Logger ('backfill_new_fields' );
128
@@ -16,27 +12,5 @@ final _logger = Logger('backfill_new_fields');
1612/// CHANGELOG.md must be updated with the new fields, and the next
1713/// release could remove the backfill from here.
1814Future <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.' );
4216}
0 commit comments