I'm working on a Craft site for a company that wanted me to change the usual folder structure of the project. Instead of it being
-config
-storage
-templates
…
-public
they wanted to group all the folders and files related to Craft itself into a separate folder so the folder structure would be like this
-craft
--config
--storage
--templates
…
-public
because they have a lot of folders for other things in the root of the server and wanted to be able to easily see which ones were related to Craft.
Everything is working fine except that in my local environment, I'm running DDEV so it looks like this:
-.ddev
-craft
-public
and to run composer
or php craft
console commands, I have to cd
into the craft
folder because that's where the Craft console bootstrap file and composer.json
are.
composer
commands work OK but any php craft
commands always return
Craft can’t connect to the database. Check your connection settings.
which I think is because the .ddev
folder is in the level above.
So I can't currently run any Craft console commands which I'm able to get around most of the time. Plugin updates I can do from the control panel and even migrations seem to complete properly most of the time by just visiting the control panel and then clicking the button to perform database updates.
But now I need to redo a migration that didn't complete properly before and I'm unable to.
So I need advice on how to get php craft
commands to work with the way I have the project structured. Or else how I can get the migration I missed to run without using the CLI.