forum

Home / DeveloperSection / Forums / YII migrations and bu default values for table columns

YII migrations and bu default values for table columns

Royce Roy 3173 15-May-2013
Hi Everyone!

public function up(){

        $this->createTable('POST', array(
            'id' => 'pk',
            'isremoved' => 'integer NOT NULL',
            'removaldate' => 'timestamp NULL',
            'post' => 'text NOT NULL',
            'creationdate' => 'timestamp NOT NULL',
        ));
}

This is the up function for migration. As u see it is query for creating new table. By default YII creates default value for timestamp column equal to CURRENT_TIMESTAMP and crates additional parameter and sets it equal to ON UPDATE CURRENT_TIMESTAMP.

I do not need current value for timestamp and I do not need to update this column on updating row. What i must to do? By the way, u use MySQL

Thanks in advance! 


php php 
Updated on 15-May-2013

Can you answer this question?


Answer

1 Answers

Liked By