Created
October 18, 2011 18:48
-
-
Save Kindari/1296302 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Fuel\Migrations; | |
class Create_sessions { | |
public function up() | |
{ | |
\DBUtil::create_table('sessions', array( | |
'session_id' => array('constraint' => 40, 'type' => 'varchar'), | |
'previous_id' => array('constraint' => 40, 'type' => 'varchar'), | |
'user_agent' => array('type' => 'text'), | |
'ip_address' => array('constraint' => 16, 'type' => 'varchar'), | |
'created' => array('constraint' => 10, 'type' => 'int', 'default' => 0), | |
'updated' => array('constraint' => 10, 'type' => 'int', 'default' => 0), | |
'payload' => array('type' => 'longtext'), | |
), array('session_id')); | |
$query = \DB::query("ALTER TABLE sessions ADD UNIQUE `PREVIOUS` (previous_id);"); | |
$query->execute(); | |
} | |
public function down() | |
{ | |
\DBUtil::drop_table('sessions'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment