DesignMint
  • DesignMint Designer Docs
  • DesignMint Medusa Monorepo Setup
  • admin
    • integration-tests
      • Integration Tests
    • src
      • Admin Customizations
      • Custom API Routes
      • Custom scheduled jobs
      • Module Links
      • Custom Module
      • Custom CLI Script
      • Custom subscribers
      • Custom Workflows
  • storefront
  • DesignMint License Notice
Powered by GitBook
On this page
  1. admin
  2. src

Module Links

PreviousCustom scheduled jobsNextCustom Module

Last updated 18 days ago

A module link forms an association between two data models of different modules, while maintaining module isolation.

Learn more about links in

For example:

import BlogModule from "../modules/blog"
import ProductModule from "@medusajs/medusa/product"
import { defineLink } from "@medusajs/framework/utils"

export default defineLink(
  ProductModule.linkable.product,
  BlogModule.linkable.post
)

This defines a link between the Product Module's product data model and the Blog Module (custom module)'s post data model.

Then, in the Medusa application, run the following command to sync the links to the database:

npx medusa db:migrate
this documentation