Files
medusa-store/packages/fulfillment/mikro-orm.config.dev.ts
Adrien de Peretti 3fd68d1979 feat(fulfillment): Initialize models work (#6328)
**What**
Initialize work on the fulfillment module entities.

This pr finally also include the indexes as i was working on some utilities i though it would make sense to test them directly.

Also this pr add a new utility to generate proper index for our entity properties. It also include a new monkey patch for the migration generator to handle most of if exists/not exists cases. The monkey patch is a workaround the fact that the transpilation does work well with the ECMA used by mikro orm and therefore we end up with some constructor issue when mikro orm try to instanciate the custom generator class extension.

**Comment**

- The rule part will likely evolved when we reach the point of rule filtering based data, so no need for details review I believe

FIXES CORE-1714
FIXES CORE-1715
FIXES CORE-1718
FIXES CORE-1722
FIXES CORE-1723


Current schema diagram
![fulfillment-models](https://github.com/medusajs/medusa/assets/25098370/0d7900ad-2cdc-4879-9f49-90d1577eb516)
2024-02-08 16:39:05 +00:00

13 lines
320 B
TypeScript

import * as entities from "./src/models"
import { TSMigrationGenerator } from "@medusajs/utils"
module.exports = {
entities: Object.values(entities),
schema: "public",
clientUrl: "postgres://postgres@localhost/medusa-fulfillment",
type: "postgresql",
migrations: {
generator: TSMigrationGenerator,
},
}