From 3bee9b6d92c63f3411204c82c26b6cb405718ce0 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Mon, 7 Mar 2016 22:55:04 +0100 Subject: [PATCH] Database session table added --- .../20160307223100_add_sessions.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 application/migrations/20160307223100_add_sessions.php diff --git a/application/migrations/20160307223100_add_sessions.php b/application/migrations/20160307223100_add_sessions.php new file mode 100644 index 0000000..6ceb1eb --- /dev/null +++ b/application/migrations/20160307223100_add_sessions.php @@ -0,0 +1,40 @@ +dbforge->add_field(array( + 'id' => array( + 'type' => 'VARCHAR', + 'constraint' => '40', + ), + 'ip_address' => array( + 'type' => 'VARCHAR', + 'constraint' => '45', + ), + 'timestamp' => array( + 'type' => 'INT', + 'constraint' => '10', + 'unsigned' => TRUE, + 'default' => '0' + ), + 'data' => array( + 'type' => 'BLOB', + ), + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->create_table('sessions'); + + } + + public function down() + { + $this->dbforge->drop_table('sessions'); + } +} \ No newline at end of file