-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Migrations not being generated, but schema recognized #1419
Comments
|
@stof Wow, you're here fast. Apologies for mentioning the |
Does the table of your entity already exist in the database at the time you run the
|
It was happening when the DB was empty and with only the However: Sincy my previous comment I made some changes but also deleted and restarted the whole environment (removed containers/volumes), and now it all works fine. I'm actually unsure as to what I changed with regards to entities or Doctrine configuration. Sorry to have wasted your time; closing as no longer reproducable (on my machine). |
Bug Report
composer.json
Summary
Multiple problems with the same result:
bin/console doctrine:migrations:diff
it creates a template file with emptygetDescription
andup
methods.down
method has$this->addSql('CREATE SCHEMA public');
. This last part of the issue is already reportedCREATE SCHEMA public
is added to all down migrations in Postgres #1415.Workaround: run
bin/console doctrine:database:create
, which will create the whole database.Additional (likely related) issues and observations:
bin/console doctrine:schema:validate
correctly validates the schema. Showing valid if the schema is matching entities and invalid if a table is deleted.bin/console doctrine:schema:dump-schema
correctly dumps the database schema into a migration.CREATE SCHEMA public
is added to all down migrations in Postgres #1415 is not present in this outputCurrent behavior
No migrations are being generated (up or down).
How to reproduce
composer.json
included above)./config/doctrine
)./config/packages/doctrine.yml
:./migrations
, ensure config matches in./config/packages/doctrine_migrations.yml
->'DoctrineMigrations': '%kernel.project_dir%/migrations'
Expected behavior
Full config/classes used:
compose.yml - extract for PostgreSQL
src/Event/Event.php
config/doctrine/Event.Event.orm.xml
The text was updated successfully, but these errors were encountered: