fix(medusa): Ignore categories seeding for sqlite (#3713)

This commit is contained in:
Adrien de Peretti
2023-04-04 17:33:49 +02:00
committed by GitHub
parent 7a3194c313
commit 4488ec6852
2 changed files with 10 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): Category seeding result in non null constraint error

View File

@@ -13,8 +13,8 @@ import Logger from "../loaders/logger"
import featureFlagLoader from "../loaders/feature-flags"
import {
ProductService,
ProductCategoryService,
ProductService,
ProductVariantService,
RegionService,
ShippingOptionService,
@@ -22,7 +22,6 @@ import {
StoreService,
UserService,
} from "../services"
import { ProductCategory } from "../models"
import { ConfigModule } from "../types/global"
import { CreateProductInput } from "../types/product"
import { CreateProductCategoryInput } from "../types/product-category"
@@ -234,8 +233,10 @@ const seed = async function ({ directory, migrate, seedFile }: SeedOptions) {
}
}
for (const c of categories) {
await createProductCategory(c, null)
if (dbType !== "sqlite") {
for (const c of categories) {
await createProductCategory(c, null)
}
}
})