-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doctrine:schema:drop --full-database drops "public" schema of PostgreSQL #5596
Comments
Note: putting |
@allan-simon we addressed some PostgreSQL schema introspection issues in |
@morozov I'm having the same problem, after upgrading from version
|
Could you provide a reproducer for the problem?
These commands are not part of the DBAL. Does reproducing this issue require defining some schema? |
@morozov it may be that to get what to delete doctrine:schema:drop --full-database call a method from dbal that now is returning more than before ? (I think I will try to dig to see if I can isolate said method in dbal (if any) |
at least I can tell you , running it on a vanilla postgresql database |
@morozov I've created a new issue since it only looks remotely related to this one, see #5598. |
this behaviour has not changed pre/post upgrade what seem to have changed between the last version where the bug was not here https://github.com/doctrine/dbal/blob/3.3.7/src/Schema/Schema.php#L445-L450 and the behaviour changed with this https://github.com/doctrine/dbal/blob/3.4.0/src/Schema/Schema.php#L445-L451 |
thanks , actually I think there's different face of the main behaviour change the fact that That explains hence why in your issue at the end it talks about |
I think
public schema as it does not belong to the application scope (the same as you don't expect it to drop system tables )
|
The best solution I can see is changing https://github.com/doctrine/dbal/blob/3.4.x/src/Schema/PostgreSQLSchemaManager.php#L122 to exclude "public" from here why ? to the extreme that ironically the only test that will be failing if we change this behaviour is |
As postgresql expects public to be existing as it is the default schema https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-CATALOG Application code is not supposed to play with, the same way as we don't return other system-related schemas Fixes doctrine#5596
Closing based on #5600 (comment). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Report
Summary
Since the upgrade of dbal 3.4.0 , dbal seems to expose the schema "public" to other commands
so when you try to reset your database , the schema "public" is deleted, and you can't run anymore doctrine migrations command
Current behaviour
doctrine:schema:drop --full-database remove public schema
How to reproduce
doctrine:schema:drop --full-database
console doctrine:migrations:migrate
you will see
Expected behaviour
public
schema being the default schema in postgres, it should not be droppedor at least we should have a way to recreate it (I tried putting it in my migrations, but as the create table doctrine_migration_versions happens before our first migration is executed I'm stucked)
The text was updated successfully, but these errors were encountered: