-3

Hiii, I'm starting to get familair with Yii 2. What i'm trying to do is instead of using the migrated database, use my own database. Can someone tell me the best way to do that and where i should be looking. I'm using the basic template.

Thanks in advance.

Bogust
  • 1
  • 1
  • Basic template doesn't come with migrations but if you want to use your own table for authentication. You have to go in your config file `web.php` and indicate what model to use. `'user' => [ 'identityClass' => 'backend\models\MyModelName',`. So your model have to implement **IdentityInterface**, for other tables just use **gii**. – Thiago Augustus Oliveira Sep 12 '15 at 00:55
  • i did not know that!! thanks – Bogust Sep 12 '15 at 13:48

1 Answers1

0

I do not recommend doing it this way because you will lose compatibility with other features and also when there are updates. It is wise to use the MIGRATIONS to generate the correct structure.

In any case, if you really want to change, you have q to do this in the way: vendor\amnah\yii2-user\models or extends it.

gugoan
  • 718
  • 2
  • 6
  • 28
  • What i'm gonna do is rearrange my table to match somehow the table of the migrated one in hope to keep the functions as they are thanks! – Bogust Sep 12 '15 at 13:51