dongwen3437 2011-01-31 00:32
浏览 30
已采纳

yii-dbmigrations没有名为“performTransactional”的方法

I have a new problem using the latest version of yii-dbmigration, when I run the migration the console shows the message below and the migration not work.

$ ./protected/yiic migrate
Migrations directory: protected/migrations/

=== Applying: m20110123200901_create_eav_table =================================
ERROR: m20110123200901_create_eav_table does not have a method named "performTransactional".

The code of migration is:

<?php

class m20110123200901_create_eav_table extends CDbMigration {

    public function up() {
      $t = $this->newTable('eav');
      $t->primary_key('id');
      $t->integer('section_id');
      $t->integer('entry_id');
      $t->integer('field_id');
      $t->string('attribute');
      $t->text('value');
      $t->datetime('created_at');
      $t->datetime('updated_at');
      $this->addTable($t);
    }

    public function down() {
      $this->removeTable('eav');
    }

}

Anyone know what happens?

Thanks.

Edited

Hi guys, I found the problem, but I don't know the solution.

The problem occur on the Yii v1.1.7-dev, when I'm using a another version (like v1.1.5-dev) the migrations works right.

Anyone know how to fix it?

Thanks.

  • 写回答

1条回答 默认 最新

  • dousi1097 2011-01-31 12:44
    关注

    Ok guys, I found the problem and the solution.

    I was using the yii-dbmigration extension, and the yii has a implementation of migrations since v1.1.6, so the two versions were conflicting when I was run the migrations.

    The solutions is, uninstall the extension and use the new native migration.

    A personal opinion about the yii native migration feature and the yii extension db-migration is that the second likes more easy and elegant to work because it has a great oop implementation on up/down method.

    Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计