mikro-orm

Creating a Migration for Mikro-Orm


I'm currently trying to a create a new migration in my project after the initial one. I started with a script and although it's running throughout with no errors, the actual job didn't go through.

yarn mikro-orm migration:create

I decided to turn my script off and use the above CLI to get it working, and it still hasn't created but has continuously given my an output of...

No changes required, schema is up-to-date

I've already ran through an update on my schema to check if anything was wrong but there were no errors.


Solution

  • What happens when you run migration:up?

    I recommend experimenting with these commands:

    npx mikro-orm migration:up       # Migrate up to the latest version
    npx mikro-orm migration:down     # Migrate one step down
    npx mikro-orm migration:list     # List all executed migrations
    npx mikro-orm migration:pending  # List all pending migrations