Skip to content

Commit 814d81e

Browse files
committed
refactor(seeding): remove local ads seeding and indexing
- Remove local ads seeding process from database initialization - Delete local_ads collection indexing by adType - Set AdPlatformType.admob as the default primaryAdPlatform
1 parent 194513b commit 814d81e

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/src/services/database_seeding_service.dart

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ class DatabaseSeedingService {
4040
getId: (item) => item.id,
4141
toJson: (item) => item.toJson(),
4242
);
43-
await _seedCollection<LocalAd>(
44-
collectionName: 'local_ads',
45-
fixtureData: localAdsFixturesData,
46-
getId: (ad) => ad.id,
47-
// ignore: unnecessary_lambdas
48-
toJson: (item) => LocalAd.toJson(item),
49-
);
5043

5144
_log.info('Database seeding process completed.');
5245
}
@@ -130,7 +123,7 @@ class DatabaseSeedingService {
130123
// Ensure primaryAdPlatform is not 'demo' for initial setup
131124
// since its not intended for any use outside the mobile client.
132125
final productionReadyAdConfig = initialConfig.adConfig.copyWith(
133-
primaryAdPlatform: AdPlatformType.local,
126+
primaryAdPlatform: AdPlatformType.admob,
134127
);
135128

136129
final productionReadyConfig = initialConfig.copyWith(
@@ -191,13 +184,6 @@ class DatabaseSeedingService {
191184
.collection('countries')
192185
.createIndex(keys: {'name': 1}, name: 'countries_name_index');
193186

194-
/// Index for searching local ads by adType.
195-
/// This index supports efficient queries and filtering on the 'adType' field
196-
/// of local ad documents.
197-
await _db
198-
.collection('local_ads')
199-
.createIndex(keys: {'adType': 1}, name: 'local_ads_adType_index');
200-
201187
// --- TTL and Unique Indexes via runCommand ---
202188
// The following indexes are created using the generic `runCommand` because
203189
// they require specific options not exposed by the simpler `createIndex`

0 commit comments

Comments
 (0)