Files
negareh-api/src/seeders/attribute-value.seeder.ts
T
2026-02-01 15:50:17 +03:30

29 lines
676 B
TypeScript

// import type { EntityManager } from '@mikro-orm/core';
// import { attributeValueData } from './data/attribute-value.data';
// export class AttributeValueSeeder {
// async run(
// em: EntityManager,
// ): Promise<void> {
// const attributes = await em.findAll(Attribute)
// for (const attr of attributes) {
// const attrValues = attributeValueData.filter(a => a.attributeName === attr.name)
// for (const av of attrValues) {
// const a= em.create(AttributeValue, {
// value: av.value,
// attribute: attr
// });
// em.persist(a)
// }
// }
// await em.flush();
// }
// }