Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/e3b6a9aa1e227b3c0436 to your computer and use it in GitHub Desktop.
Save doctrinebot/e3b6a9aa1e227b3c0436 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1616 - https://github.com/doctrine/doctrine2/issues/2256
From 577412277060724915484e13f4f381019d5a0cd0 Mon Sep 17 00:00:00 2001
From: Raphael Stolt <raphael.stolt@gmail.com>
Date: Tue, 24 Jan 2012 11:24:00 +0100
Subject: [PATCH] --dump-sql option omits ATTENTION line and adds semicolon to
last SQL statement
---
.../Console/Command/SchemaTool/CreateCommand.php | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
index d0b8818..a6b99e3 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
@@ -65,12 +65,11 @@ EOT
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
- $output->write('ATTENTION: This operation should not be executed in a production environment.' . PHP_EOL . PHP_EOL);
-
if ($input->getOption('dump-sql') === true) {
$sqls = $schemaTool->getCreateSchemaSql($metadatas);
- $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
+ $output->write(implode(';' . PHP_EOL, $sqls) . ';' . PHP_EOL);
} else {
+ $output->write('ATTENTION: This operation should not be executed in a production environment.' . PHP_EOL . PHP_EOL);
$output->write('Creating database schema...' . PHP_EOL);
$schemaTool->createSchema($metadatas);
$output->write('Database schema created successfully!' . PHP_EOL);
--
1.7.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment