I created a table using oil generate CLI command and the table was created as required.
php oil generate scaffold <details>
Now I wanted to change few columns and add a new column to the table strcutre. I used the oil refine and it ran.
php oil refine migrate -all
But there is no changes done to the table. Migration details are provided below (chnage of a column - 'created').
Old migration file: 003_create_categories.php
<?php
namespace Fuel\Migrations;
class Create_categories
{
public function up()
{
\DBUtil::create_table('categories', array(
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
'name' => array('constraint' => 255, 'type' => 'varchar'),
'description' => array('type' => 'text'),
'image' => array('constraint' => 255, 'type' => 'varchar'),
'created' => array('type' => 'datetime'),
'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
), array('id'));
}
public function down() {
\DBUtil::drop_table('categories');
}
}
New migration file: 004_create_categories.php
<?php
namespace Fuel\Migrations;
class Create_categories
{
public function up()
{
\DBUtil::create_table('categories', array(
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
'name' => array('constraint' => 255, 'type' => 'varchar'),
'description' => array('type' => 'text'),
'image' => array('constraint' => 255, 'type' => 'varchar'),
'status' => array('type' => 'tinyint'),
'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
), array('id'));
}
public function down() {
\DBUtil::drop_table('categories');
}
}