Skip to content

Commit 1cfd23a

Browse files
committed
FIX: Phinx migration up/down
1 parent 550a8ab commit 1cfd23a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

db/migrations/20180927071437_allow_null_on_docs_updated_at_cols.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
use Phinx\Migration\AbstractMigration;
44

5-
class AllowNullOnDocsUpdatedAtCols extends AbstractMigration {
6-
public function change() {
5+
class AllowNullOnDocsUpdatedAtCols extends AbstractMigration
6+
{
7+
public function up()
8+
{
79
$this->table('documents')
810
->changeColumn('updated_at', 'datetime', ['null' => true])
911
->changeColumn('updated_by', 'string', ['null' => true])
@@ -13,4 +15,15 @@ public function change() {
1315
->changeColumn('updated_by', 'string', ['null' => true])
1416
->update();
1517
}
18+
public function down()
19+
{
20+
$this->table('documents')
21+
->changeColumn('updated_at', 'datetime')
22+
->changeColumn('updated_by', 'string')
23+
->update();
24+
$this->table('folders')
25+
->changeColumn('updated_at', 'datetime')
26+
->changeColumn('updated_by', 'string')
27+
->update();
28+
}
1629
}

0 commit comments

Comments
 (0)