Closed DrMabuse23 closed 10 years ago
the migration file
<?php
class m130701_104658_create_table_user extends CDbMigration
{
public function safeUp()
{
$this->createTable('{{user}}', array(
'id'=>'pk',
'username'=>'string NOT NULL',
'password'=>'string NOT NULL',
'email'=>'string NOT NULL',
'firstname'=>'string',
'lastname'=>'string',
'activation_key'=>'string',
'created_on'=>'timestamp',
'updated_on'=>'timestamp',
'last_visit_on'=>'timestamp',
'password_set_on'=>'timestamp',
'email_verified'=>'boolean NOT NULL DEFAULT FALSE',
'is_active'=>'boolean NOT NULL DEFAULT FALSE',
'is_disabled'=>'boolean NOT NULL DEFAULT FALSE',
));
$this->createIndex('{{user}}_username_idx', '{{user}}', 'username', true);
$this->createIndex('{{user}}_email_idx', '{{user}}', 'email', true);
$this->createIndex('{{user}}_email_verified_idx', '{{user}}', 'email_verified');
$this->createIndex('{{user}}_is_active_idx', '{{user}}', 'is_active');
$this->createIndex('{{user}}_is_disabled_idx', '{{user}}', 'is_disabled');
}
public function safeDown()
{
$this->dropTable('{{user}}');
}
}
console/config/env
<?php
/**
*
* @author Antonio Ramirez <amigo.cobos@gmail.com>
* @link http://www.ramirezcobos.com/
* @link http://www.2amigos.us/
* @copyright 2013 2amigOS! Consultation Group LLC
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
return array(
'modules' => array(
'gii' => array(
'class' => 'system.gii.GiiModule',
'password' => 'yii',
'ipFilters' => array('127.0.0.1','::1'),
),
),
'components' => array(
// configure to suit your needs
'db' => array(
'connectionString' =>'mysql:host=localhost;dbname=yii-prototype',
'username' => 'root',
'password' => 'root',
'enableProfiling' => true,
'enableParamLogging' => true,
'charset' => 'utf8',
),
),
'params' => array(
'yii.handleErrors' => true,
'yii.debug' => true,
'yii.traceLevel' => 3,
)
);
wow @brewing very hard to read this issue code :)
@brewing
Your migration class name m130701_104660_create_table_user
doesn't match the name of the file m130701_104658_create_table_user
very fast ....
Hi Antonio, i use the migration but i got this error.