So according to the documentation I added a deleted_at field to my migrations file, so now to run the update can I do something like oil refine migrate post:down and oil refine migrate post:up ?
I also updated the observers in my model
protected static $_observers = array(
'Orm\Observer_CreatedAt' => array(
'events' => array('before_insert'),
'mysql_timestamp' => true,
'property' => 'my_created',
),
'Orm\Observer_UpdatedAt' => array(
'events' => array('before_update'),
'mysql_timestamp' => true,
),
);
namespace Fuel\Migrations;
class Create_post
{
public function up()
{
\DBUtil::create_table('blog_post', array(
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
'name' => array('constraint' => 255, 'type' => 'varchar'),
'slug' => array('constraint' => 255, 'type' => 'varchar'),
'content' => array('type' => 'text'),
'category_id' => array('constraint' => 11, 'type' => 'int'),
'user_id' => array('constraint' => 11, 'type' => 'int'),
'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'deleted_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
), array('id'));
ALTER TABLE [TABLE NAME] modify [COLUMN NAME] integer null;
Or alternatively, in the migration file you can add 'deleted_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), in the public function up() if you will be using oil to generate the tables
It looks like you're new here. If you want to get involved, click one of these buttons!