Skip to content

Commit

Permalink
Update Database/Migration/CreateSessionTable to work with the new ses…
Browse files Browse the repository at this point in the history
…sion library
  • Loading branch information
ggallon committed Jan 24, 2015
1 parent 05ecd36 commit e247cbf
Showing 1 changed file with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,42 @@
* Migration: CreateSessionTable
*
* Created by: SprintPHP
* Created on: 2014-10-01 05:22:49 am
* Created on: 2014-01-23 15:51:12 am
*/
class Migration_Createsessiontable extends CI_Migration {

public function up ()
{
$fields = array(
'session_id' => array(
'id' => array(
'type' => 'varchar',
'constraint' => 40,
'default' => '0',
'null' => false
),
'ip_address' => array(
'type' => 'varchar',
'constraint' => 45,
'default' => '0',
'null' => false
),
'user_agent' => array(
'type' => 'varchar',
'constraint' => 120,
'null' => false,
),
'last_activity' => array(
'type' => 'bigint',
'constraint' => 20,
'timestamp' => array(
'type' => 'int',
'constraint' => 10,
'unsigned' => true,
'default' => '0',
'null' => false
'null' => false,
),
'user_data' => array(
'type' => 'text',
'data' => array(
'type' => 'blob',
'default' => '',
'null' => false
)
);

$this->dbforge->add_field($fields);

$this->dbforge->add_key('session_id', true);
$this->dbforge->add_key('last_activity');
$this->dbforge->add_key('id', TRUE);
$this->dbforge->add_key('ip_address', TRUE);
$this->dbforge->add_key('timestamp');

$this->dbforge->create_table('ci_sessions');
}
Expand Down

0 comments on commit e247cbf

Please sign in to comment.