From e247cbf8c4aa062148927b4272d94273f38292f0 Mon Sep 17 00:00:00 2001 From: Gwenael G Date: Sat, 24 Jan 2015 02:42:03 +0100 Subject: [PATCH] Update Database/Migration/CreateSessionTable to work with the new session library --- ... => 20150123155112_CreateSessionTable.php} | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) rename application/database/migrations/{20141001052249_CreateSessionTable.php => 20150123155112_CreateSessionTable.php} (62%) diff --git a/application/database/migrations/20141001052249_CreateSessionTable.php b/application/database/migrations/20150123155112_CreateSessionTable.php similarity index 62% rename from application/database/migrations/20141001052249_CreateSessionTable.php rename to application/database/migrations/20150123155112_CreateSessionTable.php index e2c893c9..9d44a72f 100644 --- a/application/database/migrations/20141001052249_CreateSessionTable.php +++ b/application/database/migrations/20150123155112_CreateSessionTable.php @@ -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'); }