vendure icon indicating copy to clipboard operation
vendure copied to clipboard

`npx vendure migrate` doesn't detect migrations placed in the root of the project

Open dim-anis opened this issue 9 months ago • 1 comments

Describe the bug CLI tool gives two options for where to place the newly created migration files. When placed in the root of the project migrations are ignored. However, when placed in the src everything works as intended.

To Reproduce Steps to reproduce the behavior:

  1. Choose root when prompted in the cli
  2. Try running migrations
  3. No pending migrations found!

Expected behavior Migration files should be detected in both the root and the src.

Environment (please complete the following information):

  • @vendure/core version: 2.2.3
  • Nodejs version: 20.12.0
  • Database (mysql/postgres etc): postgresql

dim-anis avatar May 06 '24 09:05 dim-anis

you need to add an additional path to the dbConnectionOptions to also read the migrations folders in the root migrations: [path.join(__dirname, './migrations/*.+(js|ts)'),path.join(__dirname, '../migrations/*.+(js|ts)')],

moussaab-moulim avatar Jul 30 '24 02:07 moussaab-moulim