Skip to content
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

Automatic creation of schema's #1400

Open
jasperweyne opened this issue Feb 14, 2024 · 2 comments
Open

Automatic creation of schema's #1400

jasperweyne opened this issue Feb 14, 2024 · 2 comments

Comments

@jasperweyne
Copy link

Feature Request

Q A
New Feature yes
RFC ?
BC Break no

Summary

When using Doctrine Migrations for the first time, a table is automatically created, which allows for quick and easy usage. In PostgreSQL, the default schema is public schema, which is automatically created by PostgreSQL itself. Since it is the default schema, it is used by default by Doctrine Migrations as well.

Although this works fine for user accounts who are owner of that database, or a user with superuser privileges, accounts who aren't the database owner aren't privileged to create anything in the public schema anymore since PostgreSQL 15. In this case, the doctrine_migration_versions table can't be created. The intuitive option would be to change the migrations table to a different schema, where the user has creation privileges. However, in contrast to tables, schema's aren't automatically created by Doctrine Migrations. Therefore, my suggestion would be to automatically create the relevant schema on schema-aware database implementations, as this would match the behaviour of table creation as well.

@stof
Copy link
Member

stof commented Feb 14, 2024

Is it actually possible to create a schema when you are not the database owner ? If no, the automatic creation would not make sense either.

@jasperweyne
Copy link
Author

jasperweyne commented Feb 15, 2024

@stof As far as I could find/test, that is possible. Creating tables/other resources within the public schema is limited, but creating other schema's, as well as creating resources within those schema's, is permitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants