Commit 4c865069ae8b71a50606ad2ed8b0953d0094ce54
1 parent
d8773235
Exists in
master
Adicionado patch para o Phing DbDeployTask suportar o PostgreSQL.
Showing
4 changed files
with
104 additions
and
3 deletions
Show diff stats
ieducar/misc/build.xml
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | url="pgsql:host=${project.conf.dbdeploy.hostname};dbname=${project.conf.dbdeploy.dbname}" |
138 | 138 | userid="${project.conf.dbdeploy.username}" |
139 | 139 | password="${project.conf.dbdeploy.password}" |
140 | - dir="${project.conf.curdir}/misc/database/deltas" | |
140 | + dir="${project.conf.curdir}/ieducar/misc/database/deltas" | |
141 | 141 | outputfile="${project.conf.builddir}/${project.conf.dbdeploy.deployfile}" |
142 | 142 | undooutputfile="${project.conf.builddir}/${project.conf.dbdeploy.undofile}" /> |
143 | 143 | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +-- | |
2 | +-- @author Eriksen Costa <eriksencosta@gmail.com> | |
3 | +-- @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL | |
4 | +-- @link http://phing.info/trac/ticket/603 Ticket 603 no Trac do Phing | |
5 | +-- | |
6 | + | |
7 | +Patch para o Phing para adicionar suporte ao PostgreSQL no DbDeployTask. | |
8 | + | |
9 | +Esse patch foi criado para a versão 2.4.3 do Phing e foi enviado para os | |
10 | +desenvolvedores do projeto através do Trac, anexado ao ticket 603: | |
11 | + | |
12 | +http://phing.info/trac/ticket/603 | |
13 | + | |
14 | +Após aplicar esse patch em sua cópia local do Phing, você poderá utilizar a task | |
15 | +"migrate" do misc/build.xml: | |
16 | + | |
17 | +phinf -f misc/build.xml migrate | |
18 | + | |
19 | +Mais detalhes sobre os migrations de banco de dados em: | |
20 | + | |
21 | +http://svn.softwarepublico.gov.br/trac/ieducar/wiki/Dev/1.X/BancoDeDados | |
0 | 22 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,80 @@ |
1 | +diff --git tasks/ext/dbdeploy/DbmsSyntaxFactory.php tasks/ext/dbdeploy/DbmsSyntaxFactory.php | |
2 | +index ffa601e..e9ef75b 100644 | |
3 | +--- tasks/ext/dbdeploy/DbmsSyntaxFactory.php | |
4 | ++++ tasks/ext/dbdeploy/DbmsSyntaxFactory.php | |
5 | +@@ -18,7 +18,7 @@ | |
6 | + * and is licensed under the LGPL. For more information please see | |
7 | + * <http://phing.info>. | |
8 | + */ | |
9 | +- | |
10 | ++ | |
11 | + require_once 'phing/Task.php'; | |
12 | + require_once 'phing/tasks/ext/dbdeploy/DbmsSyntax.php'; | |
13 | + | |
14 | +@@ -33,12 +33,12 @@ require_once 'phing/tasks/ext/dbdeploy/DbmsSyntax.php'; | |
15 | + class DbmsSyntaxFactory | |
16 | + { | |
17 | + private $dbms; | |
18 | +- | |
19 | ++ | |
20 | + public function __construct($dbms) | |
21 | + { | |
22 | + $this->dbms = $dbms; | |
23 | + } | |
24 | +- | |
25 | ++ | |
26 | + public function getDbmsSyntax() | |
27 | + { | |
28 | + switch ($this->dbms){ | |
29 | +@@ -51,6 +51,9 @@ class DbmsSyntaxFactory | |
30 | + case('mssql'): | |
31 | + require_once 'phing/tasks/ext/dbdeploy/DbmsSyntaxMsSql.php'; | |
32 | + return new DbmsSyntaxMsSql(); | |
33 | ++ case('pgsql'): | |
34 | ++ require_once 'phing/tasks/ext/dbdeploy/DbmsSyntaxPgsql.php'; | |
35 | ++ return new DbmsSyntaxPgsql(); | |
36 | + default: | |
37 | + throw new Exception($this->dbms . ' is not supported by dbdeploy task.'); | |
38 | + } | |
39 | +diff --git tasks/ext/dbdeploy/DbmsSyntaxPgsql.php tasks/ext/dbdeploy/DbmsSyntaxPgsql.php | |
40 | +new file mode 100644 | |
41 | +index 0000000..4fe8f36 | |
42 | +--- /dev/null | |
43 | ++++ tasks/ext/dbdeploy/DbmsSyntaxPgsql.php | |
44 | +@@ -0,0 +1,36 @@ | |
45 | ++<?php | |
46 | ++/* | |
47 | ++ * $Id$ | |
48 | ++ * | |
49 | ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
50 | ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
51 | ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
52 | ++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
53 | ++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
54 | ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
55 | ++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
56 | ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
57 | ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
58 | ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
59 | ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
60 | ++ * | |
61 | ++ * This software consists of voluntary contributions made by many individuals | |
62 | ++ * and is licensed under the LGPL. For more information please see | |
63 | ++ * <http://phing.info>. | |
64 | ++ */ | |
65 | ++ | |
66 | ++/** | |
67 | ++ * Utility class for generating necessary server-specific SQL commands | |
68 | ++ * | |
69 | ++ * @author Eriksen Costa <eriksen.costa@infranology.com.br> | |
70 | ++ * @version $Revision$ | |
71 | ++ * @package phing.tasks.ext.dbdeploy | |
72 | ++ */ | |
73 | ++ | |
74 | ++class DbmsSyntaxPgsql extends DbmsSyntax | |
75 | ++{ | |
76 | ++ public function generateTimestamp() | |
77 | ++ { | |
78 | ++ return "current_timestamp"; | |
79 | ++ } | |
80 | ++} | ... | ... |
ieducar/misc/patches/phpunit/cleanMock.README
1 | 1 | -- |
2 | 2 | -- @author Eriksen Costa Paixão <eriksen.paixao_bs@cobra.com.br> |
3 | 3 | -- @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL |
4 | --- @link http://phing.info/docs/guide/current/ Phing Documentation | |
4 | +-- @link http://github.com/eriksencosta/phpunit/commit/ae26bcc3c3bc81321f741c6d99e8389b1b937fb4 PHPUnit fork | |
5 | 5 | -- |
6 | 6 | |
7 | 7 | 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 |
15 | 15 | O código simplesmente a desaloca o objeto na memória, disponibilizando-o ao GC |
16 | 16 | do PHP. |
17 | 17 | |
18 | -No entanto, essa correção quebrou alguns testes do i-Educar que lidam com | |
18 | +No entanto, essa correção quebrou alguns testes do i-Educar que lidam com | |
19 | 19 | classes legadas (namespace App). As instâncias dessas classes são mantidas no |
20 | 20 | registry da classe CoreExt_Entity para facilitar o setup dos testes. |
21 | 21 | ... | ... |