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

This commit is contained in:
Adrien de Peretti authored and GitHub committed 2023-04-04 17:33:49 +02:00
1 parent 7a3194c313
commit 4488ec6852
2 files changed
+8 -2

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): Category seeding result in non null constraint error
+3 -2
View File
@@ -13,8 +13,8 @@ import Logger from "../loaders/logger"
import featureFlagLoader from "../loaders/feature-flags" import featureFlagLoader from "../loaders/feature-flags"
import { import {
ProductService,
ProductCategoryService, ProductCategoryService,
ProductService,
ProductVariantService, ProductVariantService,
RegionService, RegionService,
ShippingOptionService, ShippingOptionService,
@@ -22,7 +22,6 @@ import {
StoreService, StoreService,
UserService, UserService,
} from "../services" } from "../services"
import { ProductCategory } from "../models"
import { ConfigModule } from "../types/global" import { ConfigModule } from "../types/global"
import { CreateProductInput } from "../types/product" import { CreateProductInput } from "../types/product"
import { CreateProductCategoryInput } from "../types/product-category" import { CreateProductCategoryInput } from "../types/product-category"
@@ -234,9 +233,11 @@ const seed = async function ({ directory, migrate, seedFile }: SeedOptions) {
} }
} }
if (dbType !== "sqlite") {
for (const c of categories) { for (const c of categories) {
await createProductCategory(c, null) await createProductCategory(c, null)
} }
}
}) })
track("CLI_SEED_COMPLETED") track("CLI_SEED_COMPLETED")