0

I have generated a Model using gii of an InnoDB view, which worked.

Then trying to use the gii CRUD generator for the model, I am getting this error

The table associated with app\models\Future must have a primary key(s).

I have also looked into this question. But the table doesn't have any primary key and also I can't create any primary key because the DB is 3rd party DB.

Is there any way to create CRUD without having a primary key?

Any help would be highly appreciated.

Moeez
  • 494
  • 9
  • 55
  • 147

1 Answers1

0

Try to define PK using:

public static function primaryKey()
{
    return ['name'];
}
rob006
  • 21,383
  • 5
  • 53
  • 74
Milan Suthar
  • 352
  • 1
  • 2
  • 17