Yii Framework Forum: Cdbmigration's Refreshtableschema Not Sufficient - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cdbmigration's Refreshtableschema Not Sufficient The table schema is still remembered by model Rate Topic: -----

#1 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 370
  • Joined: 08-June 10
  • Location:France (Ile-de-France/Val d'Oise)

Posted 16 May 2013 - 12:35 PM

When doing a migration, a call to CDbMigration->refreshTableSchema is not sufficient, the model also needs a 'refreshMetaData'.


This is require if one wants to do an operation on a new column for instance.


        $this->addColumn(Planning::model()->tableName(),'example','int'));

        $this->refreshTableSchema(Planning::model()->tableName());
        Planning::model()->refreshMetaData();
        Planning::model()->updateAll(array('example'=>1));



Possibly the informed reader has an idea on how to do this in 'refreshTableSchema' instead.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users