A
A
Alexey Verkhovtsev2019-03-21 18:48:33
symfony
Alexey Verkhovtsev, 2019-03-21 18:48:33

How to use different databases for different Symfony 4 environments?

My main database is PostgreSQL, I want to use Sqlite for tests, because it will be faster for tests. I created a doctrine.yaml in the config/test folder with the following content

doctrine:
    dbal:
        driver: 'pdo_sqlite'
        url: 'sqlite:///%kernel.project_dir%/var/test.db3'

I wrote the line in phpunit.xml.dist
Everything seems to be fine, but I also need to create migrations for the test base. how to do it? Because they are created for postgres

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question