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

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

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装