Skip to content

Commit 96e525a

Browse files
authored
Cleanup the removal of the now-unused isBlocked fields. (#8663)
1 parent bac53bd commit 96e525a

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

app/lib/tool/backfill/backfill_new_fields.dart

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
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';
106

117
final _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.
1814
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.');
4216
}

0 commit comments

Comments
 (0)