* @author Raphael Jackstadt * @copyright 2014-2017 Emre Akay * @copyright 2018 Magefly * @license https://opensource.org/licenses/MIT MIT License * @link https://github.com/magefly/CodeIgniter-Aauth */ namespace App\Database\Migrations; use CodeIgniter\Database\Migration; /** * Create CI session table * * @package CodeIgniter-Aauth * * @codeCoverageIgnore */ class Migration_create_ci_sessions_table extends Migration { /** * Create Table * * @return void */ public function up() { $this->forge->addField([ 'id' => [ 'type' => 'VARCHAR', 'constraint' => 128, 'null' => false, ], 'ip_address' => [ 'type' => 'VARCHAR', 'constraint' => 45, 'null' => false, ], 'timestamp' => [ 'type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => false, 'default' => 0, ], 'data' => [ 'type' => 'TEXT', 'null' => false, 'default' => '', ], ]); $this->forge->addKey('id', true); $this->forge->addKey('timestamp'); $this->forge->createTable('ci_sessions', true); } //-------------------------------------------------------------------- /** * Drops Table * * @return void */ public function down() { $this->forge->dropTable('ci_sessions', true); } }