yii-dbmigrations does not have a method named “performTransactional”
-
27-10-2019 - |
문제
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.
해결책
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