-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
i added enum export for status property in my model, that resulted in following error trying to generate migrations:
error: Cannot read properties of undefined (reading 'name')
TypeError: Cannot read properties of undefined (reading 'name')
at Function.className (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/utils/Utils.js:627:28)
at MetadataStorage.get (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/metadata/MetadataStorage.js:52:36)
at MetadataDiscovery.getSchema (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/metadata/MetadataDiscovery.js:276:36)
at MetadataDiscovery.discoverReferences (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/metadata/MetadataDiscovery.js:221:33)
at MetadataDiscovery.findEntities (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/metadata/MetadataDiscovery.js:147:14)
at MetadataDiscovery.discover (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/metadata/MetadataDiscovery.js:43:20)
at MikroORM.discoverEntities (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/MikroORM.js:177:46)
at Function.init (~/project/medusa-plugin-quotes/node_modules/@mikro-orm/core/MikroORM.js:49:19)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async generateMigrations (~/project/medusa-plugin-quotes/node_modules/@medusajs/medusa/src/commands/plugin/db/generate.ts:133:17)
the model:
import { model } from "@medusajs/framework/utils"
export enum QuoteStatus {
PENDING_MERCHANT = "pending_merchant",
PENDING_CUSTOMER = "pending_customer",
ACCEPTED = "accepted",
CUSTOMER_REJECTED = "customer_rejected",
MERCHANT_REJECTED = "merchant_rejected",
}
const Quote = model.define("quote", {
id: model.id().primaryKey(),
status: model.enum(Object.values(QuoteStatus)).default(QuoteStatus.PENDING_MERCHANT),
})
export default Quote
Metadata
Metadata
Assignees
Labels
No labels