vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.78k stars 1.03k forks source link

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

Open dim-anis opened 6 months ago

dim-anis commented 6 months ago

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):

moussaab-moulim commented 3 months ago

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)')],