test: fix seed helper, was causing errors in versions suite
This commit is contained in:
@@ -73,10 +73,9 @@ export async function seedDB({
|
|||||||
// Dropping the db breaks indexes (on mongoose - did not test extensively on postgres yet), so we recreate them here
|
// Dropping the db breaks indexes (on mongoose - did not test extensively on postgres yet), so we recreate them here
|
||||||
if (shouldResetDB) {
|
if (shouldResetDB) {
|
||||||
if (isMongoose(_payload)) {
|
if (isMongoose(_payload)) {
|
||||||
const db = _payload.db as MongooseAdapter
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
Object.entries(db.collections).map(async ([_, collection]) => {
|
...collectionSlugs.map(async (collectionSlug) => {
|
||||||
await collection.createIndexes()
|
await _payload.db.collections[collectionSlug].createIndexes()
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user