Compare View
Commits (5)
-
portabilis/ieducar#179
-
Alterado tipo de data dos campos data base em instituição; Referente a issue #40 See merge request !20
Showing
3 changed files
Show diff stats
ieducar/intranet/educar_instituicao_cad.php
@@ -194,6 +194,13 @@ class indice extends clsCadastro | @@ -194,6 +194,13 @@ class indice extends clsCadastro | ||
194 | $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); | 194 | $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); |
195 | $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); | 195 | $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); |
196 | 196 | ||
197 | + if ($this->data_base_remanejamento == '') | ||
198 | + unset($obj->data_base_remanejamento); | ||
199 | + | ||
200 | + if ($this->data_base_transferencia == '') | ||
201 | + unset($obj->data_base_transferencia); | ||
202 | + | ||
203 | + | ||
197 | $cadastrou = $obj->cadastra(); | 204 | $cadastrou = $obj->cadastra(); |
198 | if( $cadastrou ) | 205 | if( $cadastrou ) |
199 | { | 206 | { |
@@ -218,6 +225,12 @@ class indice extends clsCadastro | @@ -218,6 +225,12 @@ class indice extends clsCadastro | ||
218 | $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); | 225 | $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); |
219 | $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); | 226 | $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); |
220 | 227 | ||
228 | + if ($this->data_base_remanejamento == '') | ||
229 | + unset($obj->data_base_remanejamento); | ||
230 | + | ||
231 | + if ($this->data_base_transferencia == '') | ||
232 | + unset($obj->data_base_transferencia); | ||
233 | + | ||
221 | $editou = $obj->edita(); | 234 | $editou = $obj->edita(); |
222 | if( $editou ) | 235 | if( $editou ) |
223 | { | 236 | { |
ieducar/misc/database/migrations/20161007002450_add_columns_transferido_remanejado.php
@@ -9,8 +9,8 @@ class AddColumnsTransferidoRemanejado extends AbstractMigration | @@ -9,8 +9,8 @@ class AddColumnsTransferidoRemanejado extends AbstractMigration | ||
9 | { | 9 | { |
10 | $this->execute("ALTER TABLE pmieducar.matricula_turma ADD COLUMN transferido boolean;"); | 10 | $this->execute("ALTER TABLE pmieducar.matricula_turma ADD COLUMN transferido boolean;"); |
11 | $this->execute("ALTER TABLE pmieducar.matricula_turma ADD COLUMN remanejado boolean;"); | 11 | $this->execute("ALTER TABLE pmieducar.matricula_turma ADD COLUMN remanejado boolean;"); |
12 | - $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_remanejamento boolean;"); | ||
13 | - $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_transferencia boolean;"); | 12 | + $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_remanejamento date;"); |
13 | + $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_transferencia date;"); | ||
14 | } | 14 | } |
15 | 15 | ||
16 | public function down() | 16 | public function down() |
ieducar/misc/database/migrations/20170201162023_recria_colunas_data_base_em_instituicao.php
0 → 100644
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +use Phinx\Migration\AbstractMigration; | ||
4 | + | ||
5 | +class RecriaColunasDataBaseEmInstituicao extends AbstractMigration | ||
6 | +{ | ||
7 | + | ||
8 | + public function up() | ||
9 | + { | ||
10 | + $this->execute("ALTER TABLE pmieducar.instituicao DROP COLUMN data_base_remanejamento;"); | ||
11 | + $this->execute("ALTER TABLE pmieducar.instituicao DROP COLUMN data_base_transferencia;"); | ||
12 | + $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_remanejamento date;"); | ||
13 | + $this->execute("ALTER TABLE pmieducar.instituicao ADD COLUMN data_base_transferencia date;"); | ||
14 | + } | ||
15 | +} |