Skip to content

Commit

Permalink
create migrations changing directus messages datetime field to timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Apr 22, 2016
1 parent 62176ac commit 0b25ca1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function up()
"null"=>false
)
);
$t->column("datetime", "datetime", array(
$t->column("datetime", "TIMESTAMP", array(
"null"=>false,
"default"=>"0000-00-00 00:00:00"
"default"=>"CURRENT_TIMESTAMP"
)
);
$t->column("attachment", "integer", array(
Expand Down
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()
}

0 comments on commit 0b25ca1

Please sign in to comment.