I want to create a migration, the up method of which will execute the create_table function.
For instance:
class m101129_185401_create_news_table extends CDbMigration
{
public function up ()
{
$ this-> createTable ('tbl_news', array (
'id' => 'pk',
'title' => 'string NOT NULL',
'content' => 'text',
));
}
public function down ()
{
$ this-> dropTable ('tbl_news');
}
}
How to specify field length in migration? For instance. What would I write if I need to indicate that the length of the header field should be 100.
source
share