-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create migrations changing directus messages datetime field to timestamp
- Loading branch information
1 parent
62176ac
commit 0b25ca1
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
api/migrations/directus/20160422124055_UpdateDirectusMessagesDateTimeColumn.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
use Ruckusing\Migration\Base as Ruckusing_Migration_Base; | ||
|
||
class UpdateDirectusMessagesDateTimeColumn extends Ruckusing_Migration_Base | ||
{ | ||
public function up() | ||
{ | ||
$this->change_column('directus_messages', 'datetime', 'TIMESTAMP', array( | ||
'null' => false, | ||
'default' => 'CURRENT_TIMESTAMP' | ||
)); | ||
}//up() | ||
|
||
public function down() | ||
{ | ||
$this->change_column('directus_messages', 'datetime', 'datetime', array( | ||
'null' => false, | ||
'default' => '0000-00-00 00:00:00' | ||
)); | ||
}//down() | ||
} |