You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that I've executed this command after (cd tests/Application && APP_ENV=test bin/console doctrine:database:create), which indeed creates a database in my PostgreSQL. If I inspect the database, there's indeed public schema already.
Full stack trace
!
! [CAUTION] This operation should not be executed in a production environment!
!
Creating database schema...
In ToolsException.php line 19:
Schema-Tool failed with Error 'An exception occurred while executing a query: SQLSTATE[42P06]: Duplicate schema: 7 ERROR: schema "pu
blic" already exists' while executing DDL: CREATE SCHEMA public
In ExceptionConverter.php line 87:
An exception occurred while executing a query: SQLSTATE[42P06]: Duplicate schema: 7 ERROR: schema "public" already exists
In Exception.php line 28:
SQLSTATE[42P06]: Duplicate schema: 7 ERROR: schema "public" already exists
In Connection.php line 33:
SQLSTATE[42P06]: Duplicate schema: 7 ERROR: schema "public" already exists
doctrine:schema:create [--em EM] [--dump-sql]
If I do (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create --dump-sql), I indeed see that the command doctrine:schema:create tried to create the schema public
There are some workarounds here doctrine/dbal#1110, but I'm not sure how to adapt them to the sylius plugin case. I suppose may need to add these workarounds inside tests/Application, but it would be nice to have an authoritative answer from a Sylius developer
The text was updated successfully, but these errors were encountered:
Sylius version affected: ~1.13.0
Description
I get errors like
schema "public" already exists
when executing(cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
when setting up a new Sylius plugin, as explained in the README: https://github.com/Sylius/PluginSkeleton?tab=readme-ov-file#traditionalNote that I've executed this command after
(cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
, which indeed creates a database in my PostgreSQL. If I inspect the database, there's indeedpublic
schema already.Full stack trace
Steps to reproduce
Follow the instructions here https://github.com/Sylius/PluginSkeleton and in the documentation https://docs.sylius.com/en/latest/book/plugins/guide/naming.html
Notes
(cd tests/Application && APP_ENV=test bin/console doctrine:schema:create --dump-sql)
, I indeed see that the commanddoctrine:schema:create
tried to create the schema publicThis may to be related to DBAL-1168: Schema's getMigrateFromSql always adds CREATE SCHEMA doctrine/dbal#1110
This may be related to this [PostgreSQL] Sylius installation fix #15425
Even if this problem is more related to doctrine, there should be a workaround in Sylius
The sequence of commands in step 2 here https://github.com/Sylius/PluginSkeleton?tab=readme-ov-file#traditional does not lead to these errors if I use MySQL
Possible Solution
I am not sure.
There are some workarounds here doctrine/dbal#1110, but I'm not sure how to adapt them to the sylius plugin case. I suppose may need to add these workarounds inside
tests/Application
, but it would be nice to have an authoritative answer from a Sylius developerThe text was updated successfully, but these errors were encountered: