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
laravel-doctrine/orm 1.3.6 A Doctrine ORM bridge for Laravel 5
laravel-doctrine/scout 0.1.1 A Doctrine bridge for Laravel Scout
laravel/framework v5.4.28 The Laravel Framework.
I run the diff and then the migration and it builds my database etc...
Then I run diff again and it always creates a new migration with this line:
public function down(Schema $schema)
{
$this->addSql('CREATE SCHEMA public');
}
I searched for the issue online and found a similar issue for doctrine on the dbal github: doctrine/dbal#1110
Their is a suggested fix for those using doctrine with symfony...
I was able to implement the fix for myself, but figured I would create this issue in case someone wants to fix it and/or if another searches for a fix. Here is what I did.
I created this file:
<?php
namespace EngineBundle\Doctrine;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
class MigrationEventSubscriber implements EventSubscriber
{
public function getSubscribedEvents()
{
return array(
'postGenerateSchema',
);
}
public function postGenerateSchema(GenerateSchemaEventArgs $Args)
{
$Schema = $Args->getSchema();
if (! $Schema->hasNamespace('public')) {
$Schema->createNamespace('public');
}
}
}
Then I put the event subscriber into my doctrine.php config file
@isaackearl thanks for the heads up!
Personally, I'm not a fan of duplicating doctrine docs in here. What we can do tho is add some sort of warning message on our docs and point to the DBAL issue you linked.
@guiwoda Ya I went ahead I finally did that. Wasn't sure how much detail to add so I opted for being brief. If you would like me to change the note then let me know. laravel-doctrine/docs#71
laravel-doctrine/orm 1.3.6 A Doctrine ORM bridge for Laravel 5
laravel-doctrine/scout 0.1.1 A Doctrine bridge for Laravel Scout
laravel/framework v5.4.28 The Laravel Framework.
I run the diff and then the migration and it builds my database etc...
Then I run diff again and it always creates a new migration with this line:
I searched for the issue online and found a similar issue for doctrine on the dbal github: doctrine/dbal#1110
Their is a suggested fix for those using doctrine with symfony...
I was able to implement the fix for myself, but figured I would create this issue in case someone wants to fix it and/or if another searches for a fix. Here is what I did.
I created this file:
Then I put the event subscriber into my doctrine.php config file
I'm actually not really sure why that fixes it, still learning doctrine and how this config file works... If someone has a better fix let me know.
thanks.
The text was updated successfully, but these errors were encountered: