This repository has been archived by the owner on Aug 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add
CREATE SCHEMA public
commands to down migrations (#551)
* Stop trying to create schema in down migrations * Remove `CREATE SCHEMA public` from migrations The command doesn't work and is incorrectly added by DBAL: doctrine/dbal#1110 * Update syntax to match code style * Remove event listener services to separate file * Remove deprecated step from rollback procedure You don't need to remove `CREATE SCHEMA public` commands now because this PR does it for you * Update deleted directory Deleting `var/cache` itself causes a permissions mishap. Instead, delete the contents of that directory like every other script does.
- Loading branch information
Showing
20 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
services: | ||
kernel.listener.responseConverter: | ||
class: AppBundle\EventListener\RestInputOuputFormatter | ||
arguments: [ "@jms_serializer", "@logger", ["json"], "json", "%kernel.debug%" ] | ||
public: true | ||
tags: | ||
- { name: kernel.event_listener, event: kernel.view, method: onKernelView } | ||
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException } | ||
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } | ||
|
||
doctrine.listener: | ||
class: AppBundle\EventListener\DoctrineListener | ||
tags: | ||
- { name: doctrine.event_listener, event: prePersist, method: prePersist } | ||
- { name: doctrine.event_listener, event: preRemove, method: preRemove } | ||
|
||
AppBundle\EventListener\FixDefaultSchemaListener: | ||
class: AppBundle\EventListener\FixDefaultSchemaListener | ||
tags: | ||
- { name: doctrine.event_listener, event: postGenerateSchema, method: postGenerateSchema } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace AppBundle\EventListener; | ||
|
||
use Doctrine\Common\EventSubscriber; | ||
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; | ||
|
||
class FixDefaultSchemaListener implements EventSubscriber | ||
{ | ||
public function getSubscribedEvents() | ||
{ | ||
return ['postGenerateSchema']; | ||
} | ||
|
||
public function postGenerateSchema(GenerateSchemaEventArgs $args) | ||
{ | ||
$schema = $args->getSchema(); | ||
|
||
if (!$schema->hasNamespace('public')) { | ||
$schema->createNamespace('public'); | ||
} | ||
} | ||
} |