From 4c865069ae8b71a50606ad2ed8b0953d0094ce54 Mon Sep 17 00:00:00 2001 From: Eriksen Costa Date: Sun, 5 Dec 2010 21:36:53 -0200 Subject: [PATCH] Adicionado patch para o Phing DbDeployTask suportar o PostgreSQL. --- ieducar/misc/build.xml | 2 +- ieducar/misc/patches/phing/DbDeployPgsql.README | 21 +++++++++++++++++++++ ieducar/misc/patches/phing/DbDeployPgsql.patch | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/misc/patches/phpunit/cleanMock.README | 4 ++-- 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 ieducar/misc/patches/phing/DbDeployPgsql.README create mode 100644 ieducar/misc/patches/phing/DbDeployPgsql.patch diff --git a/ieducar/misc/build.xml b/ieducar/misc/build.xml index 571f253..4c1f62a 100644 --- a/ieducar/misc/build.xml +++ b/ieducar/misc/build.xml @@ -137,7 +137,7 @@ url="pgsql:host=${project.conf.dbdeploy.hostname};dbname=${project.conf.dbdeploy.dbname}" userid="${project.conf.dbdeploy.username}" password="${project.conf.dbdeploy.password}" - dir="${project.conf.curdir}/misc/database/deltas" + dir="${project.conf.curdir}/ieducar/misc/database/deltas" outputfile="${project.conf.builddir}/${project.conf.dbdeploy.deployfile}" undooutputfile="${project.conf.builddir}/${project.conf.dbdeploy.undofile}" /> diff --git a/ieducar/misc/patches/phing/DbDeployPgsql.README b/ieducar/misc/patches/phing/DbDeployPgsql.README new file mode 100644 index 0000000..2523598 --- /dev/null +++ b/ieducar/misc/patches/phing/DbDeployPgsql.README @@ -0,0 +1,21 @@ +-- +-- @author Eriksen Costa +-- @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL +-- @link http://phing.info/trac/ticket/603 Ticket 603 no Trac do Phing +-- + +Patch para o Phing para adicionar suporte ao PostgreSQL no DbDeployTask. + +Esse patch foi criado para a versão 2.4.3 do Phing e foi enviado para os +desenvolvedores do projeto através do Trac, anexado ao ticket 603: + +http://phing.info/trac/ticket/603 + +Após aplicar esse patch em sua cópia local do Phing, você poderá utilizar a task +"migrate" do misc/build.xml: + +phinf -f misc/build.xml migrate + +Mais detalhes sobre os migrations de banco de dados em: + +http://svn.softwarepublico.gov.br/trac/ieducar/wiki/Dev/1.X/BancoDeDados \ No newline at end of file diff --git a/ieducar/misc/patches/phing/DbDeployPgsql.patch b/ieducar/misc/patches/phing/DbDeployPgsql.patch new file mode 100644 index 0000000..9e157da --- /dev/null +++ b/ieducar/misc/patches/phing/DbDeployPgsql.patch @@ -0,0 +1,80 @@ +diff --git tasks/ext/dbdeploy/DbmsSyntaxFactory.php tasks/ext/dbdeploy/DbmsSyntaxFactory.php +index ffa601e..e9ef75b 100644 +--- tasks/ext/dbdeploy/DbmsSyntaxFactory.php ++++ tasks/ext/dbdeploy/DbmsSyntaxFactory.php +@@ -18,7 +18,7 @@ + * and is licensed under the LGPL. For more information please see + * . + */ +- ++ + require_once 'phing/Task.php'; + require_once 'phing/tasks/ext/dbdeploy/DbmsSyntax.php'; + +@@ -33,12 +33,12 @@ require_once 'phing/tasks/ext/dbdeploy/DbmsSyntax.php'; + class DbmsSyntaxFactory + { + private $dbms; +- ++ + public function __construct($dbms) + { + $this->dbms = $dbms; + } +- ++ + public function getDbmsSyntax() + { + switch ($this->dbms){ +@@ -51,6 +51,9 @@ class DbmsSyntaxFactory + case('mssql'): + require_once 'phing/tasks/ext/dbdeploy/DbmsSyntaxMsSql.php'; + return new DbmsSyntaxMsSql(); ++ case('pgsql'): ++ require_once 'phing/tasks/ext/dbdeploy/DbmsSyntaxPgsql.php'; ++ return new DbmsSyntaxPgsql(); + default: + throw new Exception($this->dbms . ' is not supported by dbdeploy task.'); + } +diff --git tasks/ext/dbdeploy/DbmsSyntaxPgsql.php tasks/ext/dbdeploy/DbmsSyntaxPgsql.php +new file mode 100644 +index 0000000..4fe8f36 +--- /dev/null ++++ tasks/ext/dbdeploy/DbmsSyntaxPgsql.php +@@ -0,0 +1,36 @@ ++. ++ */ ++ ++/** ++ * Utility class for generating necessary server-specific SQL commands ++ * ++ * @author Eriksen Costa ++ * @version $Revision$ ++ * @package phing.tasks.ext.dbdeploy ++ */ ++ ++class DbmsSyntaxPgsql extends DbmsSyntax ++{ ++ public function generateTimestamp() ++ { ++ return "current_timestamp"; ++ } ++} diff --git a/ieducar/misc/patches/phpunit/cleanMock.README b/ieducar/misc/patches/phpunit/cleanMock.README index b5cbe05..92456a3 100644 --- a/ieducar/misc/patches/phpunit/cleanMock.README +++ b/ieducar/misc/patches/phpunit/cleanMock.README @@ -1,7 +1,7 @@ -- -- @author Eriksen Costa Paixão -- @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL --- @link http://phing.info/docs/guide/current/ Phing Documentation +-- @link http://github.com/eriksencosta/phpunit/commit/ae26bcc3c3bc81321f741c6d99e8389b1b937fb4 PHPUnit fork -- Patch para o PHPUnit com a diretiva de configuração "cleanMock" para o arquivo @@ -15,7 +15,7 @@ http://github.com/sebastianbergmann/phpunit/commit/8b5044ff919f51e1da653e49bc741 O código simplesmente a desaloca o objeto na memória, disponibilizando-o ao GC do PHP. -No entanto, essa correção quebrou alguns testes do i-Educar que lidam com +No entanto, essa correção quebrou alguns testes do i-Educar que lidam com classes legadas (namespace App). As instâncias dessas classes são mantidas no registry da classe CoreExt_Entity para facilitar o setup dos testes. -- libgit2 0.21.2