Exemplo n.º 1
0
 public function down()
 {
     $auth = Yii::app()->authManager;
     $authItems = array('postsModeration', 'poster', 'postReader', 'posting', 'userPageOwner', 'manageOwnPost', 'createPost', 'readPost', 'updatePost', 'deletePost');
     foreach ($authItems as $item) {
         $auth->removeAuthItem($item);
     }
     $this->dropForeignKey('fk_profile_target_id', 'user_profile');
     $this->dropColumn('user_profile', 'target_id');
     RateableDbManagerHelper::dropTables('post', $this);
     $this->dropTable('post');
     $this->dropTable('target');
 }
 public function safeDown()
 {
     CommentableDbManagerHelper::dropTables('petition', $this);
     RateableDbManagerHelper::dropTables('petition', $this);
     $this->dropTable('petition');
 }
 public function safeDown()
 {
     RateableDbManagerHelper::dropTables('candidate', $this);
     CommentableDbManagerHelper::dropTables('candidate', $this);
 }
 /**
  * @param string $commentableTableName
  * @param CDbMigration $migration
  */
 public static function dropTables($commentableTableName, $migration)
 {
     RateableDbManagerHelper::dropTables($commentableTableName . '_comment', $migration);
     $migration->dropTable($commentableTableName . '_comment');
 }