Closed Aloxen closed 1 year ago
As far i know doctrine-migrations is not compatible with MongoDB ODM (it only supports DBAL). For MongoDB you could use this: https://github.com/doesntmattr/mongodb-migrations (but i've never tried before)
It setup a postgres database
version: '3'
services:
database: image: postgres:${POSTGRES_VERSION:-15}-alpine environment: POSTGRES_DB: ${POSTGRES_DB:-app}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
volumes:
database_data:
This is my docker-compose.yml
APP_ENV=dev APP_SECRET=06bdab0ca09208aff2fe982e0b99181c
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
and this my .env file
I am not a professional but everything looks like it is setup for postgres. I have always worked with mariadb but now that security set it up that way I thought why not try postgres
try to install in your php container the driver for postgres
I am kinda a newbie, can you explain it more detailed?
in the PHP Dockerfile remove mongodb-stable and add in the line where docker-php-ext-install pgsql pdo pdo_pgsql instead. Rebuild the php container.
Is that PHP Dockerfile in my projectfolder because curently I am not running any php container via docker
I did some digging and many people have the problem because the PDO drivers, but I checked and I have them installed on my system. I also checked if the db is up and I can talk to it via the integrated tool of php storm. What does doctrine need, that I haven't installed yet?
Hey, I installed the security bundle, doctrine, maker and annotations to make a user system. After that I ran symfony console make:user and created the standard user (yes to everything). After that, I am supposed to create a magration with
symfony console make:migration
but it returns an exception. I have recently reset my linux, so that could be a reason why that happens, but I am not sure at all.This is the exception: ` [critical] Error thrown while running command "make:migration". Message: "An exception occurred in the driver: could not find driver"
In ExceptionConverter.php line 87:
An exception occurred in the driver: could not find driver
In Exception.php line 28:
could not find driver
In Driver.php line 35:
could not find driver
make:migration
2023-09-22T14:00:01+02:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle" now to avoid errors or add an explicit @return annotation to suppress this message. `
Does anyone know what I need to configure?