Welcome Guest, Not a member yet? Register   Sign In
Prepare ci_sessions for future Migration
#1

Hello CodeIgnitians.

Recently I started to work on some project and decided to do it with CodeIgniter ( Laravel was the first choice ) and had an idea to prepare 
common needed libraries and controllers at hand ( like in Laravel ) and later just have a new copy of a prepared ( by a composer ) project and
start a new one with everything at hand.

I copied the two migrations from Laravel and make a migration for CI 4
1) 2014_10_12_000000_create_users_table
2) 2014_10_12_100000_create_password_resets_table  (has this line $table->string('email')->index())

and also prepared ci_session database from https://www.codeigniter.com/user_guide/l...ler-driver documentation

However there was a problem with KEY/INDEX ( yes I know they are the same for MySQL)

CREATE TABLE IF NOT EXISTS `ci_sessions` (
        `id` varchar(128) NOT NULL,
        `ip_address` varchar(45) NOT NULL,
        `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
        `data` blob NOT NULL,
        KEY `ci_sessions_timestamp` (`timestamp`)
);


the following code 

$this->forge->addKey('timestamp')

has not the same effect with the SQL statement written above which in MySQL it is done with CREATE INDEX statement.

Is there any solution or way to replicate the CREATE INDEX statment with $this->forge->!!!   ?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB