bizley / yii2-podium

Yii 2 forum module project
Apache License 2.0
167 stars 59 forks source link

Not unique index name #68

Closed Katenkka closed 7 years ago

Katenkka commented 7 years ago

Yesterday I finally managed to install the latest version of Podium with DbManager :champagne: But while installing I came across the problem that index idx-auth_item-type was already presented in my DB. It got there during yii2-user package installation so I had to add a migration to my main app that renamed existing index to something like blah-blah-idx-auth_item-type. Do you have any idea how to avoid those cases? Or maybe I should create an issue in amnah/yii2-user repository?

bizley commented 7 years ago

Have you created table for DbManager before installing Podium?

Katenkka commented 7 years ago

Yes. Changed the configuration to 'authManager' => [ 'class' => 'yii\rbac\DbManager', ],, ran a DbManager migration, then installed Podium.

Katenkka commented 7 years ago

I'm sorry, I wrote

It got there during yii2-user package

but really it was during DbManager migration run, of course

bizley commented 7 years ago

Argh... Right, I'm using table names without prefix for index names which can lead to collision. Fix on the way.

Katenkka commented 7 years ago

Thanks! Well, DbManager migration doesn't use prefixes either :wink:

bizley commented 7 years ago

From now on indexes and foreign keys name parts with table names include podium prefix. Unfortunately there are so many of them I decided not to include the change in Podium update so only fresh installation is affected.

bizley commented 7 years ago

I keep this open untill 0.6.

bizley commented 7 years ago

0.6 released.