Crud Generator without primary key in tables

hello code friends, i have a little problem when i used the Crud Generator, in my database i don’t used primary key in my tables because the database must be like that, so my question is, how i can to generate my Crud Generator without primary keys in my tables??

same problem bro but no one help us

1 Like

i solved with define the primary key in the model, for example




class Usermodel extends CActiveRecord {

     public function primaryKey()

     {

          return 'id_usuario';

     }



and yeah, no one help, this is my reference http://collectioncode.com/frameworks_php/definir-llave-primaria-en-yii-framework/

Thanks for Sharing dude, saved me time.