Open benblub opened 1 year ago
Moved to orm repository, since core of the command is there
WITH (Force)
was added in PG 13 and doctrine supports a minimum version of 9.4, so it'd break projects using a version less than 13 to use that syntax.
To add this would probably require creating a new Postgres13 platform in DBAL that overrides getDropDatabaseSQL
to use the new syntax. For lesser versions, there is this 3-statement procedure here which could be put in the 9.4 platform's getDropDatabaseSQL
if it wouldn't error. The SQL returned from that method is passed to Connection->executeStatement()
which would complain about trying to execute multiple statements.
In the meantime, you can create your own custom PG13 platform that extends from 10, overrides getDropDatabaseSQL
, and configure your project to use it
The command doesn't work, even with the force option if some connection is open (postgreSQL). As example you have a opened connection with your DB Tool or the EntityManager has not closed a connection (can be happen while running tests)
https://www.postgresql.org/docs/current/sql-dropdatabase.html Shows a force option but
doctrine:database:drop --force
doesn't use the force option from postreSQL?you need to be a superuser but that should not be the problem
Related https://github.com/zenstruck/foundry/issues/455 https://github.com/zenstruck/foundry/issues/72