Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Error migrating application with multiple database.js files using env folder #49

Open
vstollen opened this issue Oct 29, 2022 · 1 comment

Comments

@vstollen
Copy link

While migrating my application I got the error:

error: Cannot find module '/[...]/strapi-project/config/database.js'
Require stack:
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/lib/v4/migration-helpers/update-application-folder-structure.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/lib/v4/migration-helpers/index.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/lib/v4/index.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/lib/index.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/bin/commands/migrate.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/bin/commands/default-commands.js
- /home/<user>/.npm/_npx/636cd3a3cca06392/node_modules/@strapi/codemods/bin/cli.js

I do not have a config/database.js, because I use environments using the env folder: https://docs-v3.strapi.io/developer-docs/latest/setup-deployment-guides/configurations.html#formats

It would be nice, if codemods supported this case gracefully.

Tested using @strapi/[email protected]

@derrickmehaffy
Copy link
Member

Regardless if you have several database.js files you should always have the root one as we merge keys.

Not having the root database.js is absolutely not recommended and will cause issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants