how to create a Migration using Typeorm in Medusa.

Опубликовано: 15 Май 2026
на канале: ZeeCoding
239
3

There are two ways to create a migration file: create and write its content manually, or create and generate its content.

If you're creating a custom entity, then it's recommended to generate the migration file. However, if you're extending an entity from Medusa's core, then you should create and write the migration manually.

Option 2: Write Migration File
With this option, you'll use Typeorm's CLI tool to create the migration file, but you'll write the content yourself.

Run the following command in the root directory of your Medusa backend project:

npx typeorm migration:create src/migrations/PostCreate